Sha256: 2aeb5df469bc7b2c960b673324b778b0f737b463ddab1e1cb563b0a73faa91a4

Contents?: true

Size: 368 Bytes

Versions: 20

Compression:

Stored size: 368 Bytes

Contents

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

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

    private

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

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

Version data entries

20 entries across 20 versions & 5 rubygems

Version Path
kt-paperclip-5.4.0 lib/paperclip/rails_environment.rb
kt-paperclip-4.4.0 lib/paperclip/rails_environment.rb
paperclip-6.1.0 lib/paperclip/rails_environment.rb
paperclip-6.0.0 lib/paperclip/rails_environment.rb
paperclip-5.3.0 lib/paperclip/rails_environment.rb
paperclip-5.2.1 lib/paperclip/rails_environment.rb
paperclip-5.2.0 lib/paperclip/rails_environment.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/paperclip-5.1.0/lib/paperclip/rails_environment.rb
paperclip-5.1.0 lib/paperclip/rails_environment.rb
paperclip-5.0.0 lib/paperclip/rails_environment.rb
paperclip-4.3.7 lib/paperclip/rails_environment.rb
paperclip_jk-5.0.0.beta2 lib/paperclip/rails_environment.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/paperclip-4.3.6/lib/paperclip/rails_environment.rb
paperclip-5.0.0.beta2 lib/paperclip/rails_environment.rb
paperclip-5.0.0.beta1 lib/paperclip/rails_environment.rb
paperclip-4.3.6 lib/paperclip/rails_environment.rb
paperclip-4.3.5 lib/paperclip/rails_environment.rb
paperclip-4.3.4 lib/paperclip/rails_environment.rb
paperclip-4.3.3 lib/paperclip/rails_environment.rb
paperclip-4.3.2 lib/paperclip/rails_environment.rb