Sha256: e7fe7f67717c46e58be591e45501798fe6cda76a682f47f3cc2c14699330ef21

Contents?: true

Size: 924 Bytes

Versions: 9

Compression:

Stored size: 924 Bytes

Contents

# frozen_string_literal: true

require 'app_configuration'
module CloudParty
  class Config
    def initialize
      cp_config = AppConfiguration.new('config') do
        base_local_path Pathname.new(Dir.home).join('.cloud_party/')
        base_global_path Pathname.new(Etc.sysconfdir).join('cloud_party')
        use_env_variables true
        prefix 'cloud_party'
      end
      cfcli_config = AppConfiguration.new('config') do
        base_local_path Pathname.new(Dir.home).join('.cfcli/')
        base_global_path Pathname.new(Etc.sysconfdir).join('cloudflare_cli')
        use_env_variables true
        prefix 'cf_cli'
      end
      @email = cp_config.email || cfcli_config.email
      @api_key = cp_config.api_key || cfcli_config.api_key
    end

    # @return [String] the email string
    def email
      @email
    end

    # @return [String] the api key string
    def api_key
      @api_key
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
cloud_party-0.1.7 lib/cloud_party/config.rb
cloud_party-0.1.6 lib/cloud_party/config.rb
cloud_party-0.1.5 lib/cloud_party/config.rb
cloud_party-0.1.4 lib/cloud_party/config.rb
cloud_party-0.1.3 lib/cloud_party/config.rb
cloud_party-0.1.2 lib/cloud_party/config.rb
cloud_party-0.1.1 lib/cloud_party/config.rb
cloud_party-0.1.1.pre.alpha.1 lib/cloud_party/config.rb
cloud_party-0.1.0.pre.pre.1 lib/cloud_party/config.rb