Class: Checker::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/checker/options.rb

Class Method Summary collapse

Class Method Details

.get_config(conf, default = nil) ⇒ Object



4
5
6
7
# File 'lib/checker/options.rb', line 4

def get_config(conf, default = nil)
  config = `git config checker.#{conf}`.chomp
  (config.empty? && !default.nil?) ? default : config
end

.modules_to_checkObject



9
10
11
# File 'lib/checker/options.rb', line 9

def modules_to_check
  get_config("check", "all").split(",").map(&:strip)
end

.prevent_commit_on_warningObject



13
14
15
# File 'lib/checker/options.rb', line 13

def prevent_commit_on_warning
  get_config("commit-on-warning", "true") == "false"
end

.use_rails_for_sassObject



17
18
19
# File 'lib/checker/options.rb', line 17

def use_rails_for_sass
  get_config("rails-for-sass", "true") == "true"
end