Sha256: 31ee8900515d6ba0eb24e78f8bf8b5f171ac2e0bc612694bfd423f6243b9dcbd

Contents?: true

Size: 349 Bytes

Versions: 1

Compression:

Stored size: 349 Bytes

Contents

require 'rails-env/version'

module RailsEnv
  class Railtie < Rails::Railtie
    initializer 'rails-env' do
      Rails.env.extend(Extension)
    end
  end

  module Extension
    def on(*envs, &block)
      env_matched = envs.include?(:any) || envs.include?(Rails.env.to_sym)
      block.call(Rails.configuration) if env_matched
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails-env-0.3.0 lib/rails-env.rb