Class: Expire::CLI
- Inherits:
-
Thor
- Object
- Thor
- Expire::CLI
- Defined in:
- lib/expire/cli.rb
Overview
Command line interface rubocop:disable Metrics/ClassLength
Defined Under Namespace
Classes: Playground
Class Method Summary collapse
Instance Method Summary collapse
- #newest(path) ⇒ Object
- #oldest(path) ⇒ Object
- #purge(path) ⇒ Object
- #remove(path) ⇒ Object
- #rule_classes ⇒ Object
- #rule_names ⇒ Object
- #rule_option_names ⇒ Object
Class Method Details
.exit_on_failure? ⇒ Boolean
217 218 219 |
# File 'lib/expire/cli.rb', line 217 def self.exit_on_failure? true end |
Instance Method Details
#newest(path) ⇒ Object
85 86 87 88 89 90 91 92 |
# File 'lib/expire/cli.rb', line 85 def newest(path) if [:help] invoke :help, ["newest"] else require_relative "commands/newest" Expire::Commands::Newest.new(path, ).execute end end |
#oldest(path) ⇒ Object
73 74 75 76 77 78 79 80 |
# File 'lib/expire/cli.rb', line 73 def oldest(path) if [:help] invoke :help, ["oldest"] else require_relative "commands/oldest" Expire::Commands::Oldest.new(path, ).execute end end |
#purge(path) ⇒ Object
205 206 207 208 209 210 211 212 |
# File 'lib/expire/cli.rb', line 205 def purge(path) if [:help] invoke :help, ["purge"] else require_relative "commands/purge" Expire::Commands::Purge.new(path, ).execute end end |
#remove(path) ⇒ Object
61 62 63 64 65 66 67 68 |
# File 'lib/expire/cli.rb', line 61 def remove(path) if [:help] invoke :help, ["remove"] else require_relative "commands/remove" Expire::Commands::Remove.new(path: path).execute end end |
#rule_classes ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/expire/cli.rb', line 49 def rule_classes(*) if [:help] invoke :help, ["rule_classes"] else require_relative "commands/rule_classes" Expire::Commands::RuleClasses.new().execute end end |
#rule_names ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/expire/cli.rb', line 33 def rule_names(*) if [:help] invoke :help, ["rule_names"] else require_relative "commands/rule_names" Expire::Commands::RuleNames.new().execute end end |
#rule_option_names ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/expire/cli.rb', line 17 def rule_option_names(*) if [:help] invoke :help, ["rule_option_names"] else require_relative "commands/rule_option_names" Expire::Commands::RuleOptionNames.new().execute end end |