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
-
.development? ⇒ Boolean
are we in the development environment.
-
.env ⇒ Symbol
retrieves the current environment.
-
.env=(env) ⇒ Object
sets the current environment.
-
.jruby? ⇒ Boolean
are we running inside jruby.
-
.production? ⇒ Boolean
Determines if we are in the production environment.
-
.ruby_path ⇒ String
absolute path of current interpreter.
-
.stage? ⇒ Boolean
are we in the staging environment.
-
.test? ⇒ Boolean
are we in the test environment.
Class Method Details
.development? ⇒ Boolean
are we in the development environment
36 37 38 |
# File 'lib/raad/env.rb', line 36 def development? @env == :development end |
.env ⇒ Symbol
retrieves the current environment
10 11 12 |
# File 'lib/raad/env.rb', line 10 def env @env end |
.env=(env) ⇒ Object
sets the current environment
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
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
29 30 31 |
# File 'lib/raad/env.rb', line 29 def production? @env == :production end |
.ruby_path ⇒ 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
43 44 45 |
# File 'lib/raad/env.rb', line 43 def stage? @env == :stage end |
.test? ⇒ Boolean
are we in the test environment
50 51 52 |
# File 'lib/raad/env.rb', line 50 def test? @env == :test end |