Module: MelissaData
- Includes:
- Constants
- Defined in:
- lib/melissadata/errors.rb,
lib/melissadata/cli.rb,
lib/melissadata/env.rb,
lib/melissadata/client.rb,
lib/melissadata/server.rb,
lib/melissadata/command.rb,
lib/melissadata/version.rb,
lib/melissadata/constants.rb,
lib/melissadata/constants.rb,
lib/melissadata/melissadata.rb,
lib/melissadata/command/base.rb,
lib/melissadata/native_object.rb,
lib/melissadata/vagrant_plugin.rb,
lib/melissadata/command/compile.rb,
lib/melissadata/command/helpers.rb,
lib/melissadata/command/package.rb
Overview
This file contains all of the internal errors in MelissaData’s core commands, actions, etc.
Defined Under Namespace
Modules: Client, Command, Constants, Errors, NativeObject, Server, VagrantPlugin Classes: CLI, Env
Constant Summary collapse
- VERSION =
'0.1.5'
- ENVIRONMENTS =
[:development, :production, :test, :staging]
Constants included from Constants
Constants::DEFAULT_SOCKET_FILE, Constants::DEFAULT_TCP_ADDRESS, Constants::DEFAULT_TCP_PORT, Constants::DEFAULT_VAGRANT_TCP_PORT
Class Method Summary collapse
- .client ⇒ Object
-
.dev? ⇒ Boolean
Determines if we are in the development environment.
-
.env ⇒ String
Retrieves the current melissadata environment.
-
.env=(e) ⇒ Object
Sets the current melissadata environment.
- .gem_root ⇒ Object
-
.prod? ⇒ Boolean
Determines if we are in the production environment.
-
.staging? ⇒ Boolean
Determines if we are in the staging environment.
-
.test? ⇒ Boolean
Determines if we are in the test environment.
Class Method Details
.client ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/melissadata/melissadata.rb', line 31 def client if MelissaData::Client::Unix.available? MelissaData::Client::Unix.new elsif MelissaData::Client::TCP.available? MelissaData::Client::TCP.new elsif MelissaData::Client::Vagrant.available? MelissaData::Client::Vagrant.new else raise 'No client connection available' end end |
.dev? ⇒ Boolean
Determines if we are in the development environment
82 83 84 |
# File 'lib/melissadata/melissadata.rb', line 82 def dev? env == :development end |
.env ⇒ String
Retrieves the current melissadata environment
51 52 53 |
# File 'lib/melissadata/melissadata.rb', line 51 def env @env or fail "environment has not been set" end |
.env=(e) ⇒ Object
Sets the current melissadata environment
58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/melissadata/melissadata.rb', line 58 def env=(e) es = case(e.to_sym) when :dev then :development when :prod then :production else e.to_sym end if ENVIRONMENTS.include?(es) @env = es else fail "did not recognize environment: #{e}, expected one of: #{ENVIRONMENTS.join(', ')}" end end |
.gem_root ⇒ Object
100 101 102 |
# File 'lib/melissadata/melissadata.rb', line 100 def gem_root @gem_root ||= Pathname.new(File.('../../../', __FILE__)) end |
.prod? ⇒ Boolean
Determines if we are in the production environment
75 76 77 |
# File 'lib/melissadata/melissadata.rb', line 75 def prod? env == :production end |
.staging? ⇒ Boolean
Determines if we are in the staging environment
96 97 98 |
# File 'lib/melissadata/melissadata.rb', line 96 def staging? env == :staging end |
.test? ⇒ Boolean
Determines if we are in the test environment
89 90 91 |
# File 'lib/melissadata/melissadata.rb', line 89 def test? env == :test end |