Class: Checkup::CLI::Utility
- Inherits:
-
Thor
- Object
- Thor
- Checkup::CLI::Utility
- Includes:
- Thor::Actions
- Defined in:
- lib/checkup/cli/utility.rb
Instance Method Summary collapse
Instance Method Details
#list ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/checkup/cli/utility.rb', line 32 def list root_path = [:root_path] if root_path == "" root_path = Checkup::Config::DEFAULT_ROOT_PATH end load root_path Model.all.each do |model| puts model.trigger end end |
#perform ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/checkup/cli/utility.rb', line 9 def perform root_path = [:root_path] if root_path == "" root_path = Checkup::Config::DEFAULT_ROOT_PATH end load root_path triggers = [:trigger].split(",") triggers.map!(&:strip).map! {|t| t.include?('*') ? Model.find_matching(t) : t }.flatten! triggers.each do |trigger| model = Model.find(trigger) model.perform! Logger.clear! end end |