Skip to content

Commit

Permalink
Minor syntax, typo, comment cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewhavens committed Feb 4, 2020
1 parent 7f7f54c commit d257df0
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
12 changes: 6 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ task :production_test do
require "fileutils"

MotionProvisioning.client

num = rand(9999)
ios_app_id = "com.hipbyte.iostest#{num}"
ios_app = MotionProvisioning::Application.find_or_create(bundle_id: ios_app_id, name: "My iOS Test App")
Expand All @@ -53,10 +53,10 @@ task :production_test do
type = :development if type == :development_free
cert_type = type == :development ? :development : :distribution
MotionProvisioning.certificate(type: cert_type, platform: :ios, free: free)
MotionProvisioning.profile(bundle_identifier: ios_app_id,
MotionProvisioning.profile(bundle_identifier: ios_app_id,
platform: platform,
app_name: "My iOS Test App",
type: type,
app_name: "My iOS Test App",
type: type,
free: free)
FileUtils.rm(Dir.glob('provisioning/*.cer'))
end
Expand All @@ -69,9 +69,9 @@ task :production_test do
platform = :mac
[:distribution, :development].each do |type|
MotionProvisioning.certificate(type: type, platform: :mac)
MotionProvisioning.profile(bundle_identifier: mac_app_id,
MotionProvisioning.profile(bundle_identifier: mac_app_id,
platform: platform,
app_name: "My macOS Test App",
app_name: "My macOS Test App",
type: type)
FileUtils.rm(Dir.glob('provisioning/*.cer'))
end
Expand Down
1 change: 1 addition & 0 deletions bin/console
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env ruby

require "bundler/setup"
require "motion-provisioning"

require "irb"
IRB.start
2 changes: 1 addition & 1 deletion lib/motion-provisioning/certificate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def certificate_name(type, platform)
Utils.log("Error", "Something went wrong when trying to create a new certificate.")
abort
end
# There are certificates in the server, but none is installed locally. Revoke all and create a new one.
# There are certificates in the server, but none are installed locally. Revoke all and create a new one.
elsif installed_certificate.nil?
Utils.log("Error", "None of the available certificates (#{certificates.count}) is installed on the local machine. Revoking...")

Expand Down
4 changes: 2 additions & 2 deletions lib/motion-provisioning/provisioning_profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ def provisioning_profile(bundle_id, app_name, platform, type)
end
end

# ensure a client is created and logged in
client
client # ensure a client is created and logged in

app = Application.find_or_create(bundle_id: bundle_id, name: app_name, mac: platform == :mac)

Expand Down Expand Up @@ -78,6 +77,7 @@ def provisioning_profile(bundle_id, app_name, platform, type)
certificate_platform = platform == :mac ? :mac : :ios
certificate_sha1 = OpenSSL::Digest::SHA1.new(File.read(File.join(output_path, "#{certificate_platform}_distribution_certificate.cer")))
cert = client.distribution_certificates(mac: platform == :mac).detect do |c|
# Compare downloaded cert content against local cert content to make sure they match
OpenSSL::Digest::SHA1.new(c['certContent'].read) == certificate_sha1
end

Expand Down
2 changes: 1 addition & 1 deletion lib/motion-provisioning/spaceship/free_portal_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class FreePortalClient < Spaceship::PortalClient
def teams
return @teams if @teams
req = request(:post, "https://developerservices2.apple.com/services/#{PROTOCOL_VERSION}/listTeams.action", nil, {
'X-Xcode-Version' => XCODE_VERSION # necessary in order to work with Xcode free team
'X-Xcode-Version' => XCODE_VERSION # necessary in order to list Xcode free team
})
@teams = parse_response(req, 'teams').sort_by do |team|
[
Expand Down
1 change: 1 addition & 0 deletions lib/motion-provisioning/tasks.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'rake'

namespace 'motion-provisioning' do
desc 'Add a device to the provisioning portal: rake "motion-provisioning:add-device[device_name,device_id]"'
task 'add-device', [:name, :id] do |t, args|
Expand Down
4 changes: 2 additions & 2 deletions motion-provisioning.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ require 'motion-provisioning/version'
Gem::Specification.new do |spec|
spec.name = "motion-provisioning"
spec.version = MotionProvisioning::VERSION
spec.authors = ["Mark Villacampa"]
spec.email = ["[email protected]"]
spec.authors = ["Mark Villacampa", 'Andrew Havens']
spec.email = ["[email protected]", '[email protected]']

spec.summary = %q{Simplified provisioning for RubyMotion iOS, tvOS and macOS apps.}
spec.description = %q{A small library that manages certificates and profiles automatically, from the command line, with minimal configuration.}
Expand Down

0 comments on commit d257df0

Please sign in to comment.