Class: Pod::Command::Keys::Set
- Inherits:
-
Pod::Command::Keys
- Object
- Pod::Command
- Pod::Command::Keys
- Pod::Command::Keys::Set
- Includes:
- Config::Mixin
- Defined in:
- lib/pod/command/keys/set.rb
Instance Method Summary collapse
-
#initialize(argv) ⇒ Set
constructor
A new instance of Set.
- #run ⇒ Object
- #validate! ⇒ Object
Methods inherited from Pod::Command::Keys
#create_keyring, #get_current_keyring
Constructor Details
#initialize(argv) ⇒ Set
Returns a new instance of Set.
23 24 25 26 27 28 |
# File 'lib/pod/command/keys/set.rb', line 23 def initialize(argv) @key_name = argv.shift_argument @key_value = argv.shift_argument @project_name = argv.shift_argument super end |
Instance Method Details
#run ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/pod/command/keys/set.rb', line 37 def run # set a key to a folder id in ~/.cocoapods/keys # info "Saving into the keychain." keyring = get_current_keyring || create_keyring keyring.keys << @key_name.tr('-', '_') CocoaPodsKeys::KeyringLiberator.save_keyring keyring keyring.save @key_name, @key_value UI.puts "Saved #{@key_name} to #{keyring.name}." unless config.silent? end |
#validate! ⇒ Object
30 31 32 33 34 35 |
# File 'lib/pod/command/keys/set.rb', line 30 def validate! super verify_podfile_exists! help! 'A key name is required to save.' unless @key_name help! 'A value is required for the key.' unless @key_value end |