Module: Raad
- Defined in:
- lib/raad/env.rb,
lib/raad/logger.rb,
lib/raad/runner.rb,
lib/raad/version.rb,
lib/raad/bootstrap.rb,
lib/raad/configuration.rb
Defined Under Namespace
Modules: Configuration, Logger Classes: Bootstrap, Runner
Constant Summary collapse
- VERSION =
"0.5.0"
Class Method Summary collapse
-
.custom_options ⇒ Hash
returns the custom options hash set in the service options_parser class method.
-
.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.
-
.stopped=(state) ⇒ Object
used internally to set the stopped flag.
-
.stopped? ⇒ Boolean
a request to stop the service has been received (or the #start method has returned and, if defined, the service #stop method has been called by Raad..
-
.test? ⇒ Boolean
are we in the test environment.
Class Method Details
.custom_options ⇒ Hash
returns the custom options hash set in the service options_parser class method
90 91 92 |
# File 'lib/raad/env.rb', line 90 def @custom_options end |
.development? ⇒ Boolean
are we in the development environment
41 42 43 |
# File 'lib/raad/env.rb', line 41 def development? @env == :development end |
.env ⇒ Symbol
retrieves the current environment
14 15 16 |
# File 'lib/raad/env.rb', line 14 def env @env end |
.env=(env) ⇒ Object
sets the current environment
21 22 23 24 25 26 27 28 29 |
# File 'lib/raad/env.rb', line 21 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 else @env = env.to_sym end end |
.jruby? ⇒ Boolean
are we running inside jruby
62 63 64 |
# File 'lib/raad/env.rb', line 62 def jruby? !!(defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby') end |
.production? ⇒ Boolean
Determines if we are in the production environment
34 35 36 |
# File 'lib/raad/env.rb', line 34 def production? @env == :production end |
.ruby_path ⇒ String
absolute path of current interpreter
69 70 71 |
# File 'lib/raad/env.rb', line 69 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
48 49 50 |
# File 'lib/raad/env.rb', line 48 def stage? @env == :stage end |
.stopped=(state) ⇒ Object
used internally to set the stopped flag
83 84 85 |
# File 'lib/raad/env.rb', line 83 def stopped=(state) @stop_lock.synchronize{@stopped = !!state} end |
.stopped? ⇒ Boolean
a request to stop the service has been received (or the #start method has returned and, if defined, the service #stop method has been called by Raad.
76 77 78 |
# File 'lib/raad/env.rb', line 76 def stopped? @stop_lock.synchronize{@stopped} end |
.test? ⇒ Boolean
are we in the test environment
55 56 57 |
# File 'lib/raad/env.rb', line 55 def test? @env == :test end |