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.3.1"

Class Method Summary collapse

Class Method Details

.development?Boolean

Determines if we are in the development environment

Returns:

  • (Boolean)

    true if current environemnt is development, false otherwise



34
35
36
# File 'lib/raad/env.rb', line 34

def development?
  @env == :development
end

.envSymbol

Retrieves the current environment

Returns:

  • (Symbol)

    the current environment



8
9
10
# File 'lib/raad/env.rb', line 8

def env
  @env
end

.env=(env) ⇒ Object

Sets the current environment

Parameters:

  • env (String or Symbol)

    the environment [development|production|stage|test]



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

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

.production?Boolean

Determines if we are in the production environment

Returns:

  • (Boolean)

    true if current environemnt is production, false otherwise



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

def production?
  @env == :production
end

.stage?Boolean

Determines if we are in the staging environment

Returns:

  • (Boolean)

    true if current environemnt is staging, false otherwise



41
42
43
# File 'lib/raad/env.rb', line 41

def stage?
  @env == :stage
end

.test?Boolean

Determines if we are in the test environment

Returns:

  • (Boolean)

    true if current environemnt is test, false otherwise



48
49
50
# File 'lib/raad/env.rb', line 48

def test?
  @env == :test
end