lib/name_whisperer.rb in cocoapods-keys-1.3.2 vs lib/name_whisperer.rb in cocoapods-keys-1.4.0

- old
+ new

@@ -5,26 +5,26 @@ def self.get_project_name podfile = Pod::Config.instance.podfile if podfile user_xcodeproj = xcodeproj_from_podfile(podfile) end - user_xcodeproj ||= search_folders_for_xcodeproj - user_xcodeproj.basename('.xcodeproj') + user_xcodeproj || search_folders_for_xcodeproj end private def self.xcodeproj_from_podfile(podfile) unless podfile.target_definition_list.empty? - return podfile.target_definition_list.first.user_project_path + project_path = podfile.target_definition_list.first.user_project_path + File.basename(project_path, '.xcodeproj') if project_path end end def self.search_folders_for_xcodeproj ui = Pod::UserInterface xcodeprojects = Pathname.glob('**/*.xcodeproj') if xcodeprojects.length == 1 - Pathname(xcodeprojects.first).basename + Pathname(xcodeprojects.first).basename('.xcodeproj') else error_message = (xcodeprojects.length > 1) ? 'found too many' : "couldn't find any" ui.puts 'CocoaPods-Keys ' + error_message + ' Xcode projects. Please give a name for this project.' answer = ''