Module: Raad

Defined in:
lib/raad/env.rb,
lib/raad/logger.rb,
lib/raad/runner.rb,
lib/raad/service.rb,
lib/raad/version.rb,
lib/raad/configuration.rb

Defined Under Namespace

Modules: Configuration, Logger Classes: Runner, Service

Constant Summary collapse

VERSION =
"0.4.0"

Class Method Summary collapse

Class Method Details

.development?Boolean

are we in the development environment

Returns:

  • (Boolean)

    true if current environemnt is development, false otherwise



36
37
38
# File 'lib/raad/env.rb', line 36

def development?
  @env == :development
end

.envSymbol

retrieves the current environment

Returns:

  • (Symbol)

    the current environment



10
11
12
# File 'lib/raad/env.rb', line 10

def env
  @env
end

.env=(env) ⇒ Object

sets the current environment

Parameters:

  • env (String or Symbol)

    the environment [development|production|stage|test]



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

def env=(env)
  case(env.to_s)
  when 'dev', 'development' then @env = :development
  when 'prod', 'production' then @env = :production
  when 'stage', 'staging' then @env = :stage
  when 'test' then @env = :test
  end
end

.jruby?Boolean

are we running inside jruby

Returns:

  • (Boolean)

    true if runnig inside jruby



57
58
59
# File 'lib/raad/env.rb', line 57

def jruby?
  defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
end

.production?Boolean

Determines if we are in the production environment

Returns:

  • (Boolean)

    true if current environemnt is production, false otherwise



29
30
31
# File 'lib/raad/env.rb', line 29

def production?
  @env == :production
end

.ruby_pathString

absolute path of current interpreter

Returns:

  • (String)

    absolute path of current interpreter



64
65
66
# File 'lib/raad/env.rb', line 64

def ruby_path
  File.join(Config::CONFIG["bindir"], Config::CONFIG["RUBY_INSTALL_NAME"] + Config::CONFIG["EXEEXT"])
end

.stage?Boolean

are we in the staging environment

Returns:

  • (Boolean)

    true if current environemnt is staging, false otherwise



43
44
45
# File 'lib/raad/env.rb', line 43

def stage?
  @env == :stage
end

.test?Boolean

are we in the test environment

Returns:

  • (Boolean)

    true if current environemnt is test, false otherwise



50
51
52
# File 'lib/raad/env.rb', line 50

def test?
  @env == :test
end