Skip to content

Commit

Permalink
Close padrino-gen template file
Browse files Browse the repository at this point in the history
  • Loading branch information
sshaw committed Aug 29, 2017
1 parent a2aa9a2 commit 177ce11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion padrino-gen/lib/padrino-gen/generators/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def execute_runner(kind, template_file)
when template_file =~ %r{^https?://} && template_file !~ /gist/
template_file
when template_file =~ /gist/ && template_file !~ /raw/
raw_link, _ = *open(template_file).read.scan(/<a\s+href\s?\=\"(.*?)\"\>raw/)
raw_link, _ = *open(template_file) { |io| io.read.scan(/<a\s+href\s?\=\"(.*?)\"\>raw/) }
raw_link ? "https://gist.github.com#{raw_link[0]}" : template_file
when File.extname(template_file).empty? # referencing official plugin (i.e hoptoad)
"https://raw.github.com/padrino/padrino-recipes/master/#{kind.to_s.pluralize}/#{template_file}_#{kind}.rb"
Expand Down

0 comments on commit 177ce11

Please sign in to comment.