Class: Expire::CLI

Inherits:
Thor
  • Object
show all
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

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (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 options[:help]
    invoke :help, ["newest"]
  else
    require_relative "commands/newest"
    Expire::Commands::Newest.new(path, options).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 options[:help]
    invoke :help, ["oldest"]
  else
    require_relative "commands/oldest"
    Expire::Commands::Oldest.new(path, options).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 options[:help]
    invoke :help, ["purge"]
  else
    require_relative "commands/purge"
    Expire::Commands::Purge.new(path, options).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 options[:help]
    invoke :help, ["remove"]
  else
    require_relative "commands/remove"
    Expire::Commands::Remove.new(path: path).execute
  end
end

#rule_classesObject



49
50
51
52
53
54
55
56
# File 'lib/expire/cli.rb', line 49

def rule_classes(*)
  if options[:help]
    invoke :help, ["rule_classes"]
  else
    require_relative "commands/rule_classes"
    Expire::Commands::RuleClasses.new(options).execute
  end
end

#rule_namesObject



33
34
35
36
37
38
39
40
# File 'lib/expire/cli.rb', line 33

def rule_names(*)
  if options[:help]
    invoke :help, ["rule_names"]
  else
    require_relative "commands/rule_names"
    Expire::Commands::RuleNames.new(options).execute
  end
end

#rule_option_namesObject



17
18
19
20
21
22
23
24
# File 'lib/expire/cli.rb', line 17

def rule_option_names(*)
  if options[:help]
    invoke :help, ["rule_option_names"]
  else
    require_relative "commands/rule_option_names"
    Expire::Commands::RuleOptionNames.new(options).execute
  end
end