Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/envied/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/envied/env_var_extractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>] the collection of globs
Expand Down