Sha256: 4f754ba903c07be7dfa585a0fded4b4ca6043996dc1229f3ad15d12940e08987

Contents?: true

Size: 860 Bytes

Versions: 15

Compression:

Stored size: 860 Bytes

Contents

# encoding: utf-8

# http://wiki.github.com/botanicus/rango/environments-support

require "rubyexts/attribute"

module Rango
  class << self
    # @since 0.0.1
    # @return [String] Returns current environment name.
    attribute :environment, "development"

    # clever environments support
    attribute :development_environments, ["development"]
    attribute :testing_environments,     ["test", "spec", "cucumber"]
    attribute :production_environments,  ["stage", "production"]

    questionable(:testing)     { self.testing_environments.include?(Rango.environment) }
    questionable(:development) { self.development_environments.include?(Rango.environment) }
    questionable(:production)  { self.production_environments.include?(Rango.environment) }

    def environment?(environment)
      self.environment.eql?(environment.to_s)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rango-0.1.1.3 lib/rango/environments.rb
rango-0.1.1.2.11 lib/rango/environments.rb
rango-0.1.1.2.10 lib/rango/environments.rb
rango-0.1.1.2.9 lib/rango/environments.rb
rango-0.1.1.2.8 lib/rango/environments.rb
rango-0.1.1.2.7 lib/rango/environments.rb
rango-0.1.1.2.6 lib/rango/environments.rb
rango-0.1.1.2.5 lib/rango/environments.rb
rango-0.1.1.2.4 lib/rango/environments.rb
rango-0.1.1.2.3 lib/rango/environments.rb
rango-0.1.1.2.2 lib/rango/environments.rb
rango-0.1.1.2.1 lib/rango/environments.rb
rango-0.1.1.2 lib/rango/environments.rb
rango-0.1.1.1 lib/rango/environments.rb
rango-0.1.1 lib/rango/environments.rb