Class: PopulateEnv::Heroku::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/populate_env/heroku/options.rb

Constant Summary collapse

DEFAULTS =
{
  manifest_environment: 'production',
  manifest: 'app.json',
  destination: '.env',
  generate_secrets: true,
  secret_generator: SecureRandom.method(:hex),
  use_heroku_config: true,
  heroku_app: nil,
  heroku_remote: nil,
  skip_local_env: false,
  prompt_missing: true,
  output: $stdout,
  input: $stdin,
  local_env: ENV
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(**attrs) ⇒ Options

Returns a new instance of Options.



24
25
26
27
# File 'lib/populate_env/heroku/options.rb', line 24

def initialize(**attrs)
  attrs = DEFAULTS.merge(attrs)
  attrs.each { |attr, value| public_send("#{attr}=", value) }
end

Instance Method Details

#destination=(value) ⇒ Object



33
34
35
# File 'lib/populate_env/heroku/options.rb', line 33

def destination=(value)
  @destination = Pathname(value)
end

#manifest=(value) ⇒ Object



29
30
31
# File 'lib/populate_env/heroku/options.rb', line 29

def manifest=(value)
  @manifest = Pathname(value)
end

#manifest_environment=(value) ⇒ Object



37
38
39
# File 'lib/populate_env/heroku/options.rb', line 37

def manifest_environment=(value)
  @manifest_environment = value.to_sym
end