Class: Licit::Command
- Inherits:
-
Object
- Object
- Licit::Command
- Defined in:
- lib/licit/command.rb
Instance Method Summary collapse
- #check(licenser) ⇒ Object
- #find_file(probes) ⇒ Object
- #fix(licenser) ⇒ Object
- #load_config ⇒ Object
- #run ⇒ Object
Instance Method Details
#check(licenser) ⇒ Object
13 14 15 16 17 |
# File 'lib/licit/command.rb', line 13 def check(licenser) (licenser.check_files | licenser.check_headers).each do |severity, file, | puts end end |
#find_file(probes) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/licit/command.rb', line 33 def find_file probes probes.each do |file| return file if File.exist? file end nil end |
#fix(licenser) ⇒ Object
19 20 21 22 |
# File 'lib/licit/command.rb', line 19 def fix(licenser) licenser.fix_files licenser.fix_headers end |
#load_config ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/licit/command.rb', line 24 def load_config config_file = find_file ['licit.yml', 'config/licit.yml'] unless config_file puts "Could not find licit.yml config file" exit 1 end YAML.load_file(config_file).each_with_object({}) { |(k,v), h| h[k.to_sym] = v } end |