Skip to content

Commit

Permalink
⚠️ instance variable @templates not initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
amatsuda committed May 2, 2017
1 parent 4820dec commit db605c6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/pre-commit/installer.rb
Expand Up @@ -43,14 +43,14 @@ def install
end

def templates
return @templates if @templates
pattern = File.join(TEMPLATE_DIR, "*")

@templates =
Dir.glob(pattern).inject({}) do |hash, file|
key = file.match(/\/([^\/]+?)$/)[1]
hash[key] = file
hash
@templates ||= begin
pattern = File.join(TEMPLATE_DIR, "*")

Dir.glob(pattern).inject({}) do |hash, file|
key = file.match(/\/([^\/]+?)$/)[1]
hash[key] = file
hash
end
end
end

Expand Down

0 comments on commit db605c6

Please sign in to comment.