lib/produce/config.rb in produce-0.3.4 vs lib/produce/config.rb in produce-0.3.5

- old
+ new

@@ -33,11 +33,13 @@ unless @config[:bundle_identifier].end_with?("*") @config[key] = '' # set empty string, if no wildcard bundle_indentifiier end end - unless @config.has_key? key + return nil if key == :company_name + + unless @config.has_key?key @config[key] = ask(ASK_MESSAGES[key]) do |q| case key when :primary_language q.validate = lambda { |val| is_valid_language?(val) } q.responses[:not_valid] = "Please enter one of available languages: #{AvailableDefaultLanguages.all_languages}" @@ -89,15 +91,15 @@ hash.delete_if { |key, value| value.nil? } hash end - def is_valid_language? language + def is_valid_language?(language) AvailableDefaultLanguages.all_languages.include? language end - def valid_language language + def valid_language(language) AvailableDefaultLanguages.all_languages.each do |l| if l.casecmp(language) == 0 return l end @@ -106,10 +108,10 @@ return nil end # TODO: this could be moved inside fastlane_core - def is_truthy? value + def is_truthy?(value) %w( true t 1 yes y ).include? value.to_s.downcase end end end