motion-deploygate 0.1 → 0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +20 -4
  3. data/lib/motion-deploygate.rb +32 -3
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ad8833287e543a39fc67fa62e128a3fb29994186
4
- data.tar.gz: 52e06ac86c160f26a4a5a4af07e022fd60b667a8
3
+ metadata.gz: 488b78ab90ce3975eeb43aa12c8c489c71084d95
4
+ data.tar.gz: ce79232eb0a6ca344ee4f6b20f22db6e682bb947
5
5
  SHA512:
6
- metadata.gz: 305077f08a5da009542d32f146bad4eed8476d79d22fbaed0f245c2cb77a1779123de008578ae5843168c7d40aa99780bba9c7c84696e9302103eafb84991f67
7
- data.tar.gz: 2131e17d2be34593db93eb47284ca2ab398bb97012c16d6c55dca710cb679fe40536e843fb489dad0e650b6112aacb4da211ef06faca4e1e8779aef2eb5bcf23
6
+ metadata.gz: 7cd4a11a1c7a5df62193d4a336ddcf128e6f838280e84370f2da33c161776de49ab18a000a1e287366a9794bc8841b0759d3dd0efd9392d412c6a154cbbf8939
7
+ data.tar.gz: 02cd0d1e645277525a9663fc9a17f5a737a234ae1248ac13600ef264d4dc9aa1af94db4dafa6dbed18cc9c05013eb7d5552baaa988f46060bb3d2b9d26ea67b7
data/README.md CHANGED
@@ -16,11 +16,13 @@ Or install it yourself as:
16
16
 
17
17
  $ gem install motion-deploygate
18
18
 
19
- ## Usage
19
+ ## Setup
20
+
21
+ 1. Install the DeployGate command with `curl https://deploygate.com/install.sh | /bin/sh` on Terminal.app.
20
22
 
21
- 1. Download the DeployGate SDK for iOS from https://deploygate.com/docs/ios_sdk and unpack it. Then, copy `DeployGateSDK.framework` into `vendor` directory of your RubyMotion project. Create the `vendor` directory if it does not exist.
23
+ 2. Download the DeployGate SDK for iOS from https://deploygate.com/docs/ios_sdk and unpack it. Then, copy `DeployGateSDK.framework` into `vendor` directory of your RubyMotion project. Create the `vendor` directory if it does not exist.
22
24
 
23
- 2. Configure the DeployGate SDK in your `Rakefile`. Set up `user_id`, `api_key`, `user_infomation` and `sdk` variables as following.
25
+ 3. Configure the DeployGate SDK in your `Rakefile`. Set up `user_id`, `api_key`, `user_infomation` and `sdk` variables as following.
24
26
 
25
27
  ```ruby
26
28
  Motion::Project::App.setup do |app|
@@ -33,7 +35,21 @@ Motion::Project::App.setup do |app|
33
35
  end
34
36
  ```
35
37
 
36
- Finally, run `rake archive` when deploy your app. Then, upload `./build/iPhoneOS-XXXX/your_app.ipa` to DeployGate.
38
+ ## Usage
39
+
40
+ ### Submit your app to DeployGate
41
+
42
+ ```
43
+ % rake deploygate:submit
44
+ ```
45
+
46
+ ### Symbolicate a crashlog
47
+
48
+ Download a crashlog from DeployGate then run the following command to symbolicate a crashlog.
49
+
50
+ ```
51
+ % rake deploygate:symbolicate file=file_path_to_crashlog
52
+ ```
37
53
 
38
54
  ## Contributing
39
55
 
@@ -5,6 +5,8 @@ unless defined?(Motion::Project::Config)
5
5
  end
6
6
 
7
7
  class DeployGateConfig
8
+ attr_reader :user_id
9
+
8
10
  def initialize(config)
9
11
  @config = config
10
12
  @user_infomation = false
@@ -43,9 +45,11 @@ class DeployGateConfig
43
45
  launcher_code = <<EOF
44
46
  # This file is automatically generated. Do not edit.
45
47
 
46
- NSNotificationCenter.defaultCenter.addObserverForName(UIApplicationDidFinishLaunchingNotification, object:nil, queue:nil, usingBlock:lambda do |notification|
47
- DeployGateSDK.sharedInstance.launchApplicationWithAuthor('#{@user_id}', key:'#{@api_key}', userInfomationEnabled:#{@user_infomation})
48
- end)
48
+ if Object.const_defined?('DeployGateSDK') and !UIDevice.currentDevice.model.include?('Simulator')
49
+ NSNotificationCenter.defaultCenter.addObserverForName(UIApplicationDidFinishLaunchingNotification, object:nil, queue:nil, usingBlock:lambda do |notification|
50
+ DeployGateSDK.sharedInstance.launchApplicationWithAuthor('#{@user_id}', key:'#{@api_key}', userInfomationEnabled:#{@user_infomation})
51
+ end)
52
+ end
49
53
  EOF
50
54
  launcher_file = './app/deploygate_launcher.rb'
51
55
  if !File.exist?(launcher_file) or File.read(launcher_file) != launcher_code
@@ -87,3 +91,28 @@ module Motion; module Project; class Config
87
91
  end
88
92
 
89
93
  end; end; end
94
+
95
+ namespace :deploygate do
96
+ desc "Submit an archive to DeployGate"
97
+ task :submit do
98
+ config = App.config
99
+
100
+ Rake::Task["archive"].invoke
101
+ App.info "DeployGate", "Submit #{config.name}.ipa to DeployGate"
102
+ app_path = "build/iPhoneOS-#{config.deployment_target}-Development/#{config.name}.ipa"
103
+ sh "/usr/local/bin/dgate push #{config.deploygate.user_id} \"#{app_path}\""
104
+ end
105
+
106
+ desc "Symbolicate a crash log"
107
+ task :symbolicate do
108
+ config = App.config
109
+ crashlog_path = File.expand_path(ENV['file'] || "")
110
+ if ENV['file'].to_s == "" || !File.exist?(crashlog_path)
111
+ App.fail "Usage: \"rake deploygate:symbolicate file=file_path_to_crashlog\""
112
+ end
113
+
114
+ symbolicatecrash = "#{config.xcode_dir}/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKitBase.framework/Versions/A/Resources/symbolicatecrash"
115
+ dsym_path = "build/iPhoneOS-#{config.deployment_target}-Development/#{config.name}.dSYM"
116
+ sh "DEVELOPER_DIR=#{config.xcode_dir} #{symbolicatecrash} \"#{crashlog_path}\" \"#{dsym_path}\""
117
+ end
118
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-deploygate
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '0.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Watson