Sha256: 1828c47f8bcdd084c9d7bafb4faf66f4e65bb5d2f20af6c59543b22bc94e2448

Contents?: true

Size: 471 Bytes

Versions: 15

Compression:

Stored size: 471 Bytes

Contents

# frozen_string_literal: true

module Dsu
  class << self
    def env
      @env ||= Struct.new(:env) do
        def test?
          env.fetch('DSU_ENV', nil) == 'test'
        end

        def development?
          env.fetch('DSU_ENV', nil) == 'development'
        end

        def local?
          test? || development?
        end

        def production?
          env.fetch('DSU_ENV', 'production') == 'production'
        end
      end.new(ENV)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
dsu-2.4.2 lib/dsu/env.rb
dsu-2.4.1 lib/dsu/env.rb
dsu-2.4.0 lib/dsu/env.rb
dsu-2.3.2 lib/dsu/env.rb
dsu-2.3.1 lib/dsu/env.rb
dsu-2.3.0 lib/dsu/env.rb
dsu-2.2.2 lib/dsu/env.rb
dsu-2.2.1 lib/dsu/env.rb
dsu-2.2.0 lib/dsu/env.rb
dsu-2.2.0.rc.2 lib/dsu/env.rb
dsu-2.2.0.rc.1 lib/dsu/env.rb
dsu-2.1.4 lib/dsu/env.rb
dsu-2.1.3 lib/dsu/env.rb
dsu-2.1.2 lib/dsu/env.rb
dsu-2.1.1 lib/dsu/env.rb