Files

Class/Module Index [+]

Quicksearch

Chef::Resource::Cron

Public Class Methods

new(name, run_context=nil) click to toggle source
# File lib/chef/resource/cron.rb, line 30
def initialize(name, run_context=nil)
  super
  @resource_name = :cron
  @action = :create
  @allowed_actions.push(:create, :delete)
  @minute = "*"
  @hour = "*"
  @day = "*"
  @month = "*"
  @weekday = "*"
  @command = nil
  @user = "root"
  @mailto = nil
  @path = nil
  @shell = nil
  @home = nil
  @environment = {}
end

Public Instance Methods

command(arg=nil) click to toggle source
# File lib/chef/resource/cron.rb, line 166
def command(arg=nil)
  set_or_return(
    :command,
    arg,
    :kind_of => String
  )
end
day(arg=nil) click to toggle source
# File lib/chef/resource/cron.rb, line 83
def day(arg=nil)
  if arg.is_a?(Integer)
    converted_arg = arg.to_s
  else
    converted_arg = arg
  end
  begin
    if integerize(arg) > 31 then raise RangeError end
  rescue ArgumentError
  end
  set_or_return(
    :day,
    converted_arg,
    :kind_of => String
  )
end
environment(arg=nil) click to toggle source
# File lib/chef/resource/cron.rb, line 182
def environment(arg=nil)
  set_or_return(
    :environment,
    arg,
    :kind_of => Hash
  )
end
home(arg=nil) click to toggle source
# File lib/chef/resource/cron.rb, line 150
def home(arg=nil)
  set_or_return(
    :home,
    arg,
    :kind_of => String
  )
end
hour(arg=nil) click to toggle source
# File lib/chef/resource/cron.rb, line 66
def hour(arg=nil)
  if arg.is_a?(Integer)
    converted_arg = arg.to_s
  else
    converted_arg = arg
  end
  begin
    if integerize(arg) > 23 then raise RangeError end
  rescue ArgumentError
  end
  set_or_return(
    :hour,
    converted_arg,
    :kind_of => String
  )
end
mailto(arg=nil) click to toggle source
# File lib/chef/resource/cron.rb, line 134
def mailto(arg=nil)
  set_or_return(
    :mailto,
    arg,
    :kind_of => String
  )
end
minute(arg=nil) click to toggle source
# File lib/chef/resource/cron.rb, line 49
def minute(arg=nil)
  if arg.is_a?(Integer)
    converted_arg = arg.to_s
  else
    converted_arg = arg
  end
  begin
    if integerize(arg) > 59 then raise RangeError end
  rescue ArgumentError
  end
  set_or_return(
    :minute,
    converted_arg,
    :kind_of => String
  )
end
month(arg=nil) click to toggle source
# File lib/chef/resource/cron.rb, line 100
def month(arg=nil)
  if arg.is_a?(Integer)
    converted_arg = arg.to_s
  else
    converted_arg = arg
  end
  begin
    if integerize(arg) > 12 then raise RangeError end
  rescue ArgumentError
  end
  set_or_return(
    :month,
    converted_arg,
    :kind_of => String
  )
end
path(arg=nil) click to toggle source
# File lib/chef/resource/cron.rb, line 142
def path(arg=nil)
  set_or_return(
    :path,
    arg,
    :kind_of => String
  )
end
shell(arg=nil) click to toggle source
# File lib/chef/resource/cron.rb, line 158
def shell(arg=nil)
  set_or_return(
    :shell,
    arg,
    :kind_of => String
  )
end
user(arg=nil) click to toggle source
# File lib/chef/resource/cron.rb, line 174
def user(arg=nil)
  set_or_return(
    :user,
    arg,
    :kind_of => String
  )
end
weekday(arg=nil) click to toggle source
# File lib/chef/resource/cron.rb, line 117
def weekday(arg=nil)
  if arg.is_a?(Integer)
    converted_arg = arg.to_s
  else
    converted_arg = arg
  end
  begin
    if integerize(arg) > 7 then raise RangeError end
  rescue ArgumentError
  end
  set_or_return(
    :weekday,
    converted_arg,
    :kind_of => String
  )
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.