Sha256: dfb92f03fa4c2a2116be9a0af2f92f05a97d25a30b376b5e034a624bb65af7c2

Contents?: true

Size: 327 Bytes

Versions: 14

Compression:

Stored size: 327 Bytes

Contents

module Paperclip
  class RailsEnvironment
    def self.get
      new.get
    end

    def get
      Rails.env if rails_exists? && rails_environment_exists?
    end

    private

    def rails_exists?
      Object.const_defined?(:Rails)
    end

    def rails_environment_exists?
      Rails.respond_to?(:env)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
kt-paperclip-7.2.2 lib/paperclip/rails_environment.rb
kt-paperclip-7.2.1 lib/paperclip/rails_environment.rb
kt-paperclip-7.2.0 lib/paperclip/rails_environment.rb
kt-paperclip-6.4.2 lib/paperclip/rails_environment.rb
kt-paperclip-7.1.1 lib/paperclip/rails_environment.rb
kt-paperclip-7.1.0 lib/paperclip/rails_environment.rb
kt-paperclip-7.0.1 lib/paperclip/rails_environment.rb
kt-paperclip-7.0.0 lib/paperclip/rails_environment.rb
kt-paperclip-6.4.1 lib/paperclip/rails_environment.rb
kt-paperclip-6.4.0 lib/paperclip/rails_environment.rb
kt-paperclip-6.3.0 lib/paperclip/rails_environment.rb
kt-paperclip-6.2.2 lib/paperclip/rails_environment.rb
kt-paperclip-6.2.1 lib/paperclip/rails_environment.rb
kt-paperclip-6.2.0 lib/paperclip/rails_environment.rb