Module: Luffa::Environment

Defined in:
lib/luffa/environment.rb

Class Method Summary collapse

Class Method Details

.ci?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/luffa/environment.rb', line 13

def self.ci?
  self.travis_ci? || self.jenkins_ci?
end

.debug?Boolean

Returns true if debugging is enabled.

Returns:

  • (Boolean)


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

def self.debug?
  ENV['DEBUG'] == '1'
end

.developer_dirObject



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

def self.developer_dir
  value = ENV['DEVELOPER_DIR']
  if value && value != ''
    value
  else
    nil
  end
end

.jenkins_ci?Boolean

Returns:

  • (Boolean)


8
9
10
11
# File 'lib/luffa/environment.rb', line 8

def self.jenkins_ci?
  value = ENV['JENKINS_HOME']
  !value.nil? && value != ''
end

.travis_ci?Boolean

Returns:

  • (Boolean)


3
4
5
6
# File 'lib/luffa/environment.rb', line 3

def self.travis_ci?
  value = ENV['TRAVIS']
  !value.nil? && value != ''
end