motion-hockeyrink 0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OWU2NTAyMWMyZjFjNmUxZGM1MTE2MWI0YmY3NDI1ZjA5NmM2NTU0Yw==
5
+ data.tar.gz: !binary |-
6
+ MDVlMWZmMGYxNmEyNjM0YTNmZGFmOGNkOWFkZDI3NzcwZWVjZTM5Yw==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ MTc0ZGEwYjRhZGE5M2JjODE2YTQ3OWU4Yjc1YzgwMGRkYjEwMTU4MWFiMmU1
10
+ N2Y2YTUyMDYzODdhZDY5YjIyNDExYmU5MWExNzU3ZjVmNzNjNWMzMWFlOWM4
11
+ NTUyOGM3ZmQyY2JmMDgxYjYzMjI0ZjVkNjc0OGViNDZmN2ZjZjc=
12
+ data.tar.gz: !binary |-
13
+ NGM4YmNjY2Y3MTU1ODdiNTVlOGJmMGY2M2RlODcwOGU2NTMwZTFkYTEwMDgz
14
+ OTdjOTc0ZDU1YTY1OGZiYzliOWM2YzY2MmUzOWU4ZWEzYTMzMDRlOTE3NTFk
15
+ MmM5ZjQ3MzAyMGU5MmQ3ZTM4NDI0ZTI4NGY5YTdlNTBjYmQ0ZDM=
data/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ Copyright (c) 2013, Turboprop Inc <clay@usepropeller.com>
2
+ Copyright (c) 2012, Laurent Sansonetti <lrz@hipbyte.com>
3
+ All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+ 2. Redistributions in binary form must reproduce the above copyright notice,
11
+ this list of conditions and the following disclaimer in the documentation
12
+ and/or other materials provided with the distribution.
13
+
14
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md ADDED
@@ -0,0 +1,77 @@
1
+ # motion-hockeyrink
2
+
3
+ motion-hockeyrink allows RubyMotion projects to easily embed the [HockeyApp SDK](http://hockeyapp.net/) and be submitted to HockeyApp
4
+
5
+ ## Installation
6
+
7
+ `gem install motion-hockeyrink`
8
+
9
+ ## Setup
10
+
11
+ In your Rakefile:
12
+
13
+ ```ruby
14
+ require 'motion-cocoapods'
15
+
16
+ Motion::Project::App.setup do |app|
17
+ # ...
18
+
19
+ # Mandatory
20
+ app.identifier = "com.usepropeller.hockeyapp.example"
21
+
22
+ # Mandatory
23
+ app.version = "0.0.1"
24
+
25
+ # Mandatory
26
+ app.pods do
27
+ pod 'HockeySDK'
28
+ end
29
+
30
+ app.hockeyapp do
31
+ # Mandatory
32
+ app.hockeyapp.api_token = "your_api_token"
33
+ # Mandatory
34
+ app.hockeyapp.app_id = "your_app_id"
35
+
36
+ # other options for app.hockeyapp; see "Configurations" below
37
+ end
38
+ end
39
+ ```
40
+
41
+ ## Usage
42
+
43
+ ```shell
44
+ $ rake hockeyapp
45
+ # ...
46
+ Create ./build/iPhoneOS-6.1-Development/Example.dSYM
47
+ Upload #<HockeyApp>
48
+ ```
49
+
50
+ ### Configuration
51
+
52
+ The `app.hockeyapp` and `rake hockeyapp` task accept the following options:
53
+
54
+ - `notes` - Release notes for this version
55
+ - `notes_type`, either `"textile"` or `"markdown"` - The format of your release notes (default is `"textile"`)
56
+ - `notify`, either `true` or `false` - Whether or not to notify your testers (default is `false`)
57
+ - `status`, either `"deny"` or `"allow"` - Whether testers can download the new version (default is `"deny"`)
58
+ - `mandatory`, either `true` or `false` - Whether or not this is a mandatory version (default is `false`)
59
+ - `tags` - A comma-separated string of tags for this version
60
+
61
+ So, this:
62
+
63
+ ```ruby
64
+ app.hockeyapp.notes = "New version"
65
+ app.hockeyapp.notify = true
66
+ app.hockeyapp.tags = "hello,world"
67
+ ```
68
+
69
+ is the same as:
70
+
71
+ ```
72
+ rake hockeyapp notes='New version' notify=true tags='hello,world'
73
+ ```
74
+
75
+ ## License
76
+
77
+ See [LICENSE](https://github.com/usepropeller/motion-hockeyrink/blob/master/LICENSE)
@@ -0,0 +1,219 @@
1
+ # Copyright (c) 2013, Turboprop Inc, Clay Allsopp <clay@usepropeller.com>
2
+ # Copyright (c) 2012, Laurent Sansonetti <lrz@hipbyte.com>
3
+ # All rights reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are met:
7
+ #
8
+ # 1. Redistributions of source code must retain the above copyright notice,
9
+ # this list of conditions and the following disclaimer.
10
+ # 2. Redistributions in binary form must reproduce the above copyright notice,
11
+ # this list of conditions and the following disclaimer in the documentation
12
+ # and/or other materials provided with the distribution.
13
+ #
14
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
18
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22
+ # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24
+ # POSSIBILITY OF SUCH DAMAGE.
25
+
26
+ unless defined?(Motion::Project::Config)
27
+ raise "This file must be required within a RubyMotion project Rakefile."
28
+ end
29
+
30
+ class HockeyAppConfig
31
+ PROPERTIES = HockeyApp::Version::ATTRIBUTES + HockeyApp::Version::POST_PAYLOAD + [:app_id, :api_token]
32
+ attr_accessor *PROPERTIES
33
+
34
+ # Coerce these values to be :symbols
35
+ [["NOTES_TYPES", "notes_type"], ["STATUS","status"]].each do |constant, prop|
36
+ # i.e. Hockey::Version::NOTES_TYPE_TO_SYM
37
+ constant = HockeyApp::Version.const_get(constant + "_TO_SYM")
38
+ define_method("#{prop}=") do |new_value|
39
+ if new_value.is_a?(Numeric)
40
+ new_value = constant[new_value]
41
+ end
42
+ instance_variable_set("@#{prop}", new_value.to_sym)
43
+ end
44
+ end
45
+
46
+ def notify=(notify)
47
+ @notify = string_or_num_to_bool(notify)
48
+ end
49
+
50
+ def mandatory=(mandatory)
51
+ @mandatory = string_or_num_to_bool(mandatory)
52
+ end
53
+
54
+ def initialize(config)
55
+ @config = config
56
+ end
57
+
58
+ def client
59
+ if !api_token
60
+ puts "You need to specify an app.hockeyapp.api_token"
61
+ return
62
+ end
63
+ @client ||= HockeyApp.build_client
64
+ end
65
+
66
+ def app
67
+ return if !client
68
+
69
+ @app ||= HockeyApp::App.from_hash({"public_identifier" => app_id}, client)
70
+ end
71
+
72
+ def api_token=(api_token)
73
+ @api_token = api_token
74
+ config_client
75
+ @api_token
76
+ end
77
+
78
+ def inspect
79
+ h = {}
80
+ PROPERTIES.each do |prop|
81
+ h[prop] = self.send(prop)
82
+ end
83
+ h
84
+ end
85
+
86
+ # Public: Creates a HockeyApp::Version object from this configuraiton
87
+ #
88
+ # Returns the new HockeyApp::Version object
89
+ def make_version
90
+ version = HockeyApp::Version.new(app, client)
91
+ version.notes = self.notes
92
+ version.notes_type = HockeyApp::Version::NOTES_TYPES_TO_SYM.invert[self.notes_type]
93
+ version.notify = HockeyApp::Version::NOTIFY_TO_BOOL.invert[self.notify]
94
+ version.status = HockeyApp::Version::STATUS_TO_SYM.invert[self.status]
95
+ version.tags = self.tags
96
+ version
97
+ end
98
+
99
+ private
100
+ def config_client
101
+ HockeyApp::Config.configure do |config|
102
+ config.token = api_token
103
+ end
104
+ end
105
+
106
+ def string_or_num_to_bool(object)
107
+ if object.is_a?(Symbol)
108
+ notify = notify.to_s
109
+ end
110
+ if object.is_a?(String)
111
+ object = (object == "true") ? true : false
112
+ end
113
+ if object.is_a?(Numeric)
114
+ object = HockeyApp::Version::NOTIFY_TO_BOOL[object]
115
+ end
116
+ object
117
+ end
118
+ end
119
+
120
+ module Motion; module Project; class Config
121
+
122
+ attr_accessor :hockeyapp_mode
123
+
124
+ variable :hockeyapp
125
+
126
+ def hockeyapp
127
+ @hockeyapp ||= HockeyAppConfig.new(self)
128
+ yield @hockeyapp if block_given? && hockeyapp?
129
+ @hockeyapp
130
+ end
131
+
132
+ def hockeyapp?
133
+ @hockeyapp_mode == true
134
+ end
135
+
136
+ end; end; end
137
+
138
+ namespace 'hockeyapp' do
139
+ desc "Submit an archive to HockeyApp"
140
+ task :submit do
141
+
142
+ # Set the build status
143
+ App.config_without_setup.hockeyapp_mode = true
144
+
145
+ # Validate configuration settings.
146
+ prefs = App.config.hockeyapp
147
+ App.fail "A value for app.hockeyapp.api_token is mandatory" unless prefs.api_token
148
+ App.fail "A value for app.hockeyapp.app_id is mandatory" unless prefs.app_id
149
+
150
+ # Allow CLI overrides for all properties
151
+ env_configs = HockeyAppConfig::PROPERTIES
152
+ env_configs.each do |config|
153
+ value = ENV[config.to_s]
154
+ if value
155
+ prefs.send("#{config}=", value)
156
+ end
157
+ end
158
+
159
+ # Create an archive
160
+ Rake::Task["archive"].invoke
161
+
162
+ # An archived version of the .dSYM bundle is needed.
163
+ app_dsym = App.config.app_bundle('iPhoneOS').sub(/\.app$/, '.dSYM')
164
+ app_dsym_zip = app_dsym + '.zip'
165
+ if !File.exist?(app_dsym_zip) or File.mtime(app_dsym) > File.mtime(app_dsym_zip)
166
+ Dir.chdir(File.dirname(app_dsym)) do
167
+ sh "/usr/bin/zip -q -r \"#{File.basename(app_dsym)}.zip\" \"#{File.basename(app_dsym)}\""
168
+ end
169
+ end
170
+
171
+ # This is an HockeyApp::Version object
172
+ hockey_version = prefs.make_version
173
+ hockey_version.ipa = File.new(App.config.archive, 'r')
174
+ hockey_version.dsym = File.new(app_dsym_zip, 'r')
175
+
176
+ App.info "Upload", "#{hockey_version.inspect}"
177
+ result = prefs.client.post_new_version hockey_version
178
+ hockey_version.ipa.close
179
+ hockey_version.dsym.close
180
+ App.info "Result", "#{result.inspect}"
181
+ end
182
+
183
+
184
+ desc "Records if the device build is created in hockeyapp mode, so some things can be cleaned up between mode switches"
185
+ task :record_mode do
186
+ hockeyapp_mode = App.config_without_setup.hockeyapp_mode ? "True" : "False"
187
+
188
+ platform = 'iPhoneOS'
189
+ bundle_path = App.config.app_bundle(platform)
190
+ build_dir = File.join(App.config.versionized_build_dir(platform))
191
+ FileUtils.mkdir_p(build_dir)
192
+ previous_hockeyapp_mode_file = File.join(build_dir, '.hockeyapp_mode')
193
+
194
+ previous_hockeyapp_mode = "False"
195
+ if File.exist?(previous_hockeyapp_mode_file)
196
+ previous_hockeyapp_mode = File.read(previous_hockeyapp_mode_file).strip
197
+ end
198
+ if previous_hockeyapp_mode != hockeyapp_mode
199
+ App.info "HockeyApp", "Cleaning executable, Info.plist, and PkgInfo for mode change (was: #{previous_hockeyapp_mode}, now: #{hockeyapp_mode})"
200
+ [
201
+ App.config.app_bundle_executable(platform), # main_exec
202
+ File.join(bundle_path, 'Info.plist'), # bundle_info_plist
203
+ File.join(bundle_path, 'PkgInfo') # bundle_pkginfo
204
+ ].each do |path|
205
+ rm_rf(path) if File.exist?(path)
206
+ end
207
+ end
208
+ File.open(previous_hockeyapp_mode_file, 'w') do |f|
209
+ f.write hockeyapp_mode
210
+ end
211
+ end
212
+
213
+ end
214
+
215
+ desc 'Same as hockeyapp:submit'
216
+ task 'hockeyapp' => 'hockeyapp:submit'
217
+
218
+ # record hockeyapp mode before every device build
219
+ task 'build:device' => 'hockeyapp:record_mode'
@@ -0,0 +1,27 @@
1
+ # Copyright (c) 2013, Turboprop Inc <clay@usepropeller.com>
2
+ # Copyright (c) 2012, Laurent Sansonetti <lrz@hipbyte.com>
3
+ # All rights reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are met:
7
+ #
8
+ # 1. Redistributions of source code must retain the above copyright notice,
9
+ # this list of conditions and the following disclaimer.
10
+ # 2. Redistributions in binary form must reproduce the above copyright notice,
11
+ # this list of conditions and the following disclaimer in the documentation
12
+ # and/or other materials provided with the distribution.
13
+ #
14
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
18
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22
+ # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24
+ # POSSIBILITY OF SUCH DAMAGE.
25
+
26
+ require 'hockeyapp'
27
+ require 'motion/project/hockeyapp'
metadata ADDED
@@ -0,0 +1,61 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: motion-hockeyrink
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ platform: ruby
6
+ authors:
7
+ - Clay Allsopp
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-04-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: hockeyapp
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ! '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: motion-hockeyrink allows RubyMotion projects to easily embed the HockeyApp
28
+ SDK and be submitted to HockeyApp.
29
+ email: clay@usepropeller.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - README.md
35
+ - LICENSE
36
+ - lib/motion/project/hockeyapp.rb
37
+ - lib/motion-hockeyrink.rb
38
+ homepage: https://github.com/usepropeller/motion-hockeyrink
39
+ licenses: []
40
+ metadata: {}
41
+ post_install_message:
42
+ rdoc_options: []
43
+ require_paths:
44
+ - lib
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ! '>='
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ requirements: []
56
+ rubyforge_project:
57
+ rubygems_version: 2.0.3
58
+ signing_key:
59
+ specification_version: 4
60
+ summary: HockeyApp integration for RubyMotion projects
61
+ test_files: []