Module: Whenever

Defined in:
lib/whenever.rb,
lib/whenever/os.rb,
lib/whenever/job.rb,
lib/whenever/cron.rb,
lib/whenever/version.rb,
lib/whenever/job_list.rb,
lib/whenever/command_line.rb,
lib/whenever/numeric_seconds.rb,
lib/whenever/output_redirection.rb,
lib/whenever/capistrano/v2/support.rb

Defined Under Namespace

Modules: CapistranoSupport, OS, Output Classes: CommandLine, Job, JobList, NumericSeconds

Constant Summary collapse

VERSION =
'1.0.0'

Class Method Summary collapse

Class Method Details

.bin_rails?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/whenever.rb', line 23

def self.bin_rails?
  File.exist?(File.join(path, 'bin', 'rails'))
end

.bundler?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/whenever.rb', line 31

def self.bundler?
  File.exist?(File.join(path, 'Gemfile'))
end

.cron(options) ⇒ Object



11
12
13
# File 'lib/whenever.rb', line 11

def self.cron(options)
  Whenever::JobList.new(options).generate_cron_output
end

.pathObject



19
20
21
# File 'lib/whenever.rb', line 19

def self.path
  Dir.pwd
end

.script_rails?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/whenever.rb', line 27

def self.script_rails?
  File.exist?(File.join(path, 'script', 'rails'))
end

.seconds(number, units) ⇒ Object



15
16
17
# File 'lib/whenever.rb', line 15

def self.seconds(number, units)
  Whenever::NumericSeconds.seconds(number, units)
end