Sha256: b88c47ef03713fd858d3c68f5d3489cd211911bcb4a20729b662732a81c37f9c

Contents?: true

Size: 601 Bytes

Versions: 3

Compression:

Stored size: 601 Bytes

Contents

module SecretsCli
  class Configuration
    attr_reader :environment, :verbose

    def initialize(options)
      @environment = options.environment || ENV['RAILS_ENV'] || 'development'
      @verbose = options.verbose
    end

    def config
      @config ||= YAML.load_file(SECRETS_CONFIG_FILE)
    end

    def secrets_file
      config[:secrets_file]
    end

    def secrets_repo
      config[:secrets_repo]
    end

    def secrets_field
      config[:secrets_field]
    end

    def self.write(config)
      File.open(SECRETS_CONFIG_FILE, 'w') { |f| f.write(config.to_yaml) }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
secrets_cli-0.2.0 lib/secrets_cli/configuration.rb
secrets_cli-0.1.1 lib/secrets_cli/configuration.rb
secrets_cli-0.1.0 lib/secrets_cli/configuration.rb