diff --git a/lib/envied/cli.rb b/lib/envied/cli.rb index b3388b3..c3cfef9 100644 --- a/lib/envied/cli.rb +++ b/lib/envied/cli.rb @@ -25,10 +25,10 @@ def version def extract globs = options[:globs] globs << "{test,spec}/*" if options[:tests] - var_occurences = ENVied::EnvVarExtractor.new(globs: globs).extract + var_occurrences = ENVied::EnvVarExtractor.new(globs: globs).extract - puts "Found %d occurrences of %d variables:" % [var_occurences.values.flatten.size, var_occurences.size] - var_occurences.sort.each do |var, occs| + puts "Found %d occurrences of %d variables:" % [var_occurrences.values.flatten.size, var_occurrences.size] + var_occurrences.sort.each do |var, occs| puts var occs.sort_by{|i| i[:path].size }.each do |occ| puts "* %s:%s" % occ.values_at(:path, :line) diff --git a/lib/envied/env_var_extractor.rb b/lib/envied/env_var_extractor.rb index 5a05515..d3a6b68 100644 --- a/lib/envied/env_var_extractor.rb +++ b/lib/envied/env_var_extractor.rb @@ -42,7 +42,7 @@ def capture_variables(line) end # Extract all keys recursively from files found via `globs`. - # Any occurence of `ENV['A']` or `ENV.fetch('A')` in code (not in comments), will result + # Any occurrence of `ENV['A']` or `ENV.fetch('A')` in code (not in comments), will result # in 'A' being extracted. # # @param globs [Array] the collection of globs