Sha256: 7487e6679d9a5ac81e2993a92432a1ce248b59924b974c1cf0e18dbd3ce0ee99

Contents?: true

Size: 580 Bytes

Versions: 10

Compression:

Stored size: 580 Bytes

Contents

module SecretsCli
  class Configuration
    attr_reader :environment, :verbose

    def initialize(options)
      @environment = options.environment || ENV['RAILS_ENV'] || ENV['NODE_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_storage_key
      config[:secrets_storage_key]
    end

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
secrets_cli-1.10.0 lib/secrets_cli/configuration.rb
secrets_cli-1.9.0 lib/secrets_cli/configuration.rb
secrets_cli-1.8.0 lib/secrets_cli/configuration.rb
secrets_cli-1.7.0 lib/secrets_cli/configuration.rb
secrets_cli-1.6.0 lib/secrets_cli/configuration.rb
secrets_cli-1.5.0 lib/secrets_cli/configuration.rb
secrets_cli-1.4.2 lib/secrets_cli/configuration.rb
secrets_cli-1.4.1 lib/secrets_cli/configuration.rb
secrets_cli-1.4.0 lib/secrets_cli/configuration.rb
secrets_cli-1.3.3 lib/secrets_cli/configuration.rb