Sha256: 0b4540a1f6e1d29ac71e485f954a22b4bdb4bcc38871275743e7a8e08058f36c

Contents?: true

Size: 1.17 KB

Versions: 19

Compression:

Stored size: 1.17 KB

Contents

require 'keyring_liberator'
require 'name_whisperer'

module Pod
  class Command
    class Keys
      class Get < Keys
        self.summary = 'Print a values of a key.'

        self.description = <<-DESC
            Outputs the value of a key to SDTOUT

            A second optional operator can be done to force a project name.
        DESC

        self.arguments = [CLAide::Argument.new('key', true),
                          CLAide::Argument.new('project_name', false)]

        def initialize(argv)
          @key_name = argv.shift_argument
          @project_name = argv.shift_argument
          super
        end

        def validate!
          super
          verify_podfile_exists!
          help! 'A key name is required for lookup.' unless @key_name
        end

        def run
          keyring = get_current_keyring
          unless keyring
            raise Informative, 'Could not find a project for this folder'
          end

          if keyring.keys.include? @key_name
            data = keyring.keychain_value(@key_name)
            UI.puts data
          else
            raise Informative, 'Could not find value'
          end
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
cocoapods-keys-2.3.1 lib/pod/command/keys/get.rb
cocoapods-keys-2.3.0 lib/pod/command/keys/get.rb
cocoapods-keys-2.2.1 lib/pod/command/keys/get.rb
cocoapods-keys-2.2.0 lib/pod/command/keys/get.rb
cocoapods-keys-2.1.0 lib/pod/command/keys/get.rb
cocoapods-keys-2.0.7 lib/pod/command/keys/get.rb
cocoapods-keys-2.0.6 lib/pod/command/keys/get.rb
cocoapods-keys-2.0.5 lib/pod/command/keys/get.rb
cocoapods-keys-2.0.4 lib/pod/command/keys/get.rb
cocoapods-keys-2.0.3 lib/pod/command/keys/get.rb
cocoapods-keys-2.0.2 lib/pod/command/keys/get.rb
cocoapods-keys-2.0.1 lib/pod/command/keys/get.rb
cocoapods-keys-2.0.0 lib/pod/command/keys/get.rb
cocoapods-keys-1.7.0 lib/pod/command/keys/get.rb
cocoapods-keys-1.6.1 lib/pod/command/keys/get.rb
cocoapods-keys-1.6.0 lib/pod/command/keys/get.rb
cocoapods-keys-1.5.2 lib/pod/command/keys/get.rb
cocoapods-keys-1.5.1 lib/pod/command/keys/get.rb
cocoapods-keys-1.5.0 lib/pod/command/keys/get.rb