Class: DailyWeeklyMonthly::Cli

Inherits:
Object
  • Object
show all
Defined in:
lib/daily_weekly_monthly/cli.rb

Constant Summary collapse

OPTIONS =
[
  :dir,
  :ext,
  :week_day,
  :month_day,
  :keep_days,
  :keep_weeks,
  :keep_months,
  :smtp_server,
  :smtp_port,
  :notify,
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Cli

Returns a new instance of Cli.



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

def initialize args
  @options = {}
  @command = parse args
  raise "Please supply a command to run" if @command.empty?
  @command = @command.join(" ")
end

Instance Method Details

#callObject



26
27
28
# File 'lib/daily_weekly_monthly/cli.rb', line 26

def call
  DailyWeeklyMonthly.start @command, @options
end