lib/iosdeveloper/provisioning_portal.rb in iosdeveloper-0.3.2 vs lib/iosdeveloper/provisioning_portal.rb in iosdeveloper-0.3.3
- old
+ new
@@ -99,19 +99,22 @@
def profile_id(display_url)
/provDisplayId=(\w+)/.match(display_url)[1]
end
- def download_profile(profile_name, location=".")
+ def download_profile(profile_name, location=".", options)
profiles = list_profiles
profiles.each do |profile|
if profile_name.nil? || (profile.name == profile_name)
temporal_file_location = "#{profile.name}.mobileprovision"
puts "Downloading #{profile.name} ..."
@agent.get(profile.download_url).save(temporal_file_location)
- uuid = get_uuid(temporal_file_location)
- file_location = "#{location}/#{uuid}.mobileprovision"
+ if (options[:uuid])
+ file_location = "#{location}/#{get_uuid(temporal_file_location)}.mobileprovision"
+ else
+ file_location = "#{location}/#{profile.name}.mobileprovision"
+ end
FileUtils.move(temporal_file_location, file_location)
puts "Saved #{profile.name} profile in #{file_location}"
end
end
end
@@ -124,11 +127,11 @@
p7.verify([cert], store)
hash = Plist::parse_xml(p7.data)
hash["UUID"]
end
- def install_profile profile_name=nil
- download_profile(profile_name, PROVISIONING_PROFILES_LOCATION)
+ def install_profile profile_name=nil, options
+ download_profile(profile_name, PROVISIONING_PROFILES_LOCATION, options)
end
end
end
\ No newline at end of file