Sha256: 5d608b9d0f361a9bb814e899d5995eadea7ff3024554e85866711c3bc62d3dd3

Contents?: true

Size: 384 Bytes

Versions: 19

Compression:

Stored size: 384 Bytes

Contents

module Idonethis::Adapters
  module Settings
    class << self
      def credential
        from_disk || from_env
      end

      private

      def from_disk
        require 'yaml'
        YAML.load_file Idonethis::SettingsFile.path if Idonethis::SettingsFile.exists?
      end
      
      def from_env
        { token: ENV["TOKEN"], team: ENV["TEAM"] }
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
idonethis-cli-0.20.0 lib/adapters/settings.rb
idonethis-cli-0.19.1 lib/adapters/settings.rb
idonethis-cli-0.19.0 lib/adapters/settings.rb
idonethis-cli-0.15.0 lib/adapters/settings.rb
idonethis-cli-0.14.2 lib/adapters/settings.rb
idonethis-cli-0.14.1 lib/adapters/settings.rb
idonethis-cli-0.14.0 lib/adapters/settings.rb
idonethis-cli-0.13.3 lib/adapters/settings.rb
idonethis-cli-0.13.2 lib/adapters/settings.rb
idonethis-cli-0.13.1 lib/adapters/settings.rb
idonethis-cli-0.13.0 lib/adapters/settings.rb
idonethis-cli-0.6.0 lib/adapters/settings.rb
idonethis-cli-0.5.0 lib/adapters/settings.rb
idonethis-cli-0.4.1 lib/adapters/settings.rb
idonethis-cli-0.4.0 lib/adapters/settings.rb
idonethis-cli-0.3.0 lib/adapters/settings.rb
idonethis-cli-0.2.2 lib/adapters/settings.rb
idonethis-cli-0.2.1 lib/adapters/settings.rb
idonethis-cli-0.2.0 lib/adapters/settings.rb