lib/pod/command/keys/set.rb in cocoapods-keys-1.2.1 vs lib/pod/command/keys/set.rb in cocoapods-keys-1.3.0

- old
+ new

@@ -1,16 +1,15 @@ -require "keyring_liberator" -require "name_whisperer" +require 'keyring_liberator' +require 'name_whisperer' module Pod class Command class Keys - class Set < Keys include Config::Mixin - self.summary = "A set values for keys." + self.summary = 'A set values for keys.' self.description = <<-DESC Save a environment key to be added to your project on the next pod install. If a third argument is given then that will be used as the project name if @@ -29,38 +28,37 @@ end 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 + help! 'A key name is required to save.' unless @key_name + help! 'A value is required for the key.' unless @key_value end def run # set a key to a folder id in ~/.cocoapods/keys # info "Saving into the keychain." keyring = current_keyring - keyring.keys << @key_name.gsub("-", "_") + keyring.keys << @key_name.tr('-', '_') CocoaPodsKeys::KeyringLiberator.save_keyring keyring keyring.save @key_name, @key_value - puts "Saved #{@key_name} to #{keyring.name}." unless config.silent? + UI.puts "Saved #{@key_name} to #{keyring.name}." unless config.silent? end def current_keyring - current_dir = Dir.getwd + current_dir = Pathname.pwd keyring = CocoaPodsKeys::KeyringLiberator.get_keyring current_dir unless keyring name = @project_name || CocoaPodsKeys::NameWhisperer.get_project_name keyring = CocoaPodsKeys::Keyring.new(name, current_dir, []) end keyring end - end end end end