Sha256: 1218398d70a501b29e343dcad3e403eaae0bdef106e80d56fa84444103ffa203

Contents?: true

Size: 460 Bytes

Versions: 16

Compression:

Stored size: 460 Bytes

Contents

module AlephExecutables
  class EnvWriter
    attr_reader :env_file

    def initialize(rails_env)
      @rails_env = rails_env
      @env_file = Utils.get_env_file(rails_env)
      reset!
    end

    def reset!
      @envs = {}
    end

    def merge(properties)
      @envs.merge!(properties)
    end

    def write!
      File.open(@env_file, 'w') do |f|
        f.write(@envs.map { |k, v| "#{k.to_s.upcase}=#{v}" }.join("\n"))
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
aleph_analytics-0.4.9.pre.dev bin/executables/lib/env_writer.rb
aleph_analytics-0.4.8 bin/executables/lib/env_writer.rb
aleph_analytics-0.4.7 bin/executables/lib/env_writer.rb
aleph_analytics-0.4.4 bin/executables/lib/env_writer.rb
aleph_analytics-0.4.2 bin/executables/lib/env_writer.rb
aleph_analytics-0.4.1 bin/executables/lib/env_writer.rb
aleph_analytics-0.3.0 bin/executables/lib/env_writer.rb
aleph_analytics-0.2.0 bin/executables/lib/env_writer.rb
aleph_analytics-0.1.0 bin/executables/lib/env_writer.rb
aleph_analytics-0.0.6 bin/executables/lib/env_writer.rb
aleph_analytics-0.0.5 bin/executables/lib/env_writer.rb
aleph_analytics-0.0.4 bin/executables/lib/env_writer.rb
aleph_analytics-0.0.3 bin/executables/lib/env_writer.rb
aleph_analytics-0.0.2 bin/executables/lib/env_writer.rb
aleph_analytics-0.0.1.alpha bin/executables/lib/env_writer.rb
aleph_analytics-0.0.0.alpha bin/executables/lib/env_writer.rb