hockeyapp 0.0.15
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.
- checksums.yaml +15 -0
- data/.gitignore +6 -0
- data/Gemfile +4 -0
- data/README.md +45 -0
- data/Rakefile +1 -0
- data/hockeyapp.gemspec +33 -0
- data/lib/hockeyapp.rb +25 -0
- data/lib/hockeyapp/config.rb +18 -0
- data/lib/hockeyapp/models/active_model_compliance.rb +10 -0
- data/lib/hockeyapp/models/app.rb +118 -0
- data/lib/hockeyapp/models/crash.rb +44 -0
- data/lib/hockeyapp/models/crash_group.rb +36 -0
- data/lib/hockeyapp/models/version.rb +91 -0
- data/lib/hockeyapp/services/android_urls.rb +30 -0
- data/lib/hockeyapp/services/ios_urls.rb +35 -0
- data/lib/hockeyapp/ws/client.rb +72 -0
- data/lib/hockeyapp/ws/ws.rb +96 -0
- data/spec/config_spec.rb +35 -0
- data/spec/hockey_app_spec.rb +13 -0
- data/spec/models/app_spec.rb +143 -0
- data/spec/models/crash_group_spec.rb +53 -0
- data/spec/models/crash_spec.rb +77 -0
- data/spec/models/version_spec.rb +85 -0
- data/spec/support/active_model_lint.rb +19 -0
- data/spec/support/fake_ws.rb +54 -0
- data/spec/support/responses/app.json +83 -0
- data/spec/support/responses/app_versions.json +34 -0
- data/spec/support/responses/apps.json +22 -0
- data/spec/support/responses/crash_groups.json +43 -0
- data/spec/support/responses/crashes.json +45 -0
- data/spec/support/responses/new_app.json +12 -0
- data/spec/support/responses/new_version.json +13 -0
- data/spec/support/rspec_helper.rb +18 -0
- data/spec/ws/client_spec.rb +153 -0
- data/spec/ws/ws_spec.rb +32 -0
- metadata +197 -0
@@ -0,0 +1,12 @@
|
|
1
|
+
{
|
2
|
+
"title": "HockeyTest",
|
3
|
+
"bundle_identifier": "de.codenauts.hockeytest",
|
4
|
+
"public_identifier": "1234567890abcdef1234567890abcdef",
|
5
|
+
"device_family": "iPhone/iPod",
|
6
|
+
"minimum_os_version": "4.0",
|
7
|
+
"release_type": 0,
|
8
|
+
"platform": "iOS",
|
9
|
+
"status": 2,
|
10
|
+
"config_url": "http://localhost:3000/manage/apps/123",
|
11
|
+
"public_url": "http://localhost:3000/apps/1234567890abcdef1234567890abcdef"
|
12
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"title": "HockeyTest",
|
3
|
+
"appsize": 1598428,
|
4
|
+
"timestamp": 1308930206,
|
5
|
+
"device_family": "iPhone/iPod",
|
6
|
+
"minimum_os_version": "4.0",
|
7
|
+
"notes": "<p>Some new features and fixed bugs.</p>",
|
8
|
+
"version": "8",
|
9
|
+
"shortversion": "1.0",
|
10
|
+
"status": 2,
|
11
|
+
"config_url": "https://rink.hockeyapp.net/manage/apps/123/app_versions/8",
|
12
|
+
"public_url": "https://rink.hockeyapp.net/apps/1234567890abcdef1234567890abcdef"
|
13
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
SimpleCov.start do
|
3
|
+
root File.expand_path('../..', File.dirname(__FILE__))
|
4
|
+
add_filter '/spec/'
|
5
|
+
|
6
|
+
add_group 'Models', '/models/'
|
7
|
+
add_group 'Webservice', '/ws/'
|
8
|
+
end
|
9
|
+
|
10
|
+
|
11
|
+
require 'hockeyapp'
|
12
|
+
require_relative 'fake_ws'
|
13
|
+
require_relative 'active_model_lint'
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
@@ -0,0 +1,153 @@
|
|
1
|
+
require_relative '../../spec/support/rspec_helper'
|
2
|
+
require 'tempfile'
|
3
|
+
|
4
|
+
|
5
|
+
describe HockeyApp::Client do
|
6
|
+
context "when there are valid responses" do
|
7
|
+
|
8
|
+
let(:ws) {HockeyApp::FakeWS.new}
|
9
|
+
let(:client) {HockeyApp::Client.new(ws)}
|
10
|
+
let(:app) {HockeyApp::App.from_hash({"public_identifier" => "1234567890abcdef1234567890abcdef"}, client)}
|
11
|
+
let(:crash){HockeyApp::Crash.from_hash({"id" => "123456789", "has_description" => true, "has_log" => true}, app, client)}
|
12
|
+
|
13
|
+
|
14
|
+
describe "#get_apps" do
|
15
|
+
it "returns an Enumerable " do
|
16
|
+
client.get_apps.should be_kind_of Enumerable
|
17
|
+
end
|
18
|
+
|
19
|
+
it "has a single element " do
|
20
|
+
client.get_apps.should have(2).item
|
21
|
+
end
|
22
|
+
|
23
|
+
it "returns App objects" do
|
24
|
+
client.get_apps[0].should be_kind_of HockeyApp::App
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
describe "#get_crashes" do
|
30
|
+
it "returns an Enumerable " do
|
31
|
+
client.get_crashes(app).should be_kind_of Enumerable
|
32
|
+
end
|
33
|
+
|
34
|
+
it "has a 10 elements " do
|
35
|
+
client.get_crashes(app).should have(2).items
|
36
|
+
end
|
37
|
+
|
38
|
+
it "returns Crash objects" do
|
39
|
+
client.get_crashes(app)[0].should be_kind_of HockeyApp::Crash
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
describe "#get_crash_groups" do
|
45
|
+
it "returns an Enumerable " do
|
46
|
+
client.get_crash_groups(app).should be_kind_of Enumerable
|
47
|
+
end
|
48
|
+
|
49
|
+
it "has a 7 elements " do
|
50
|
+
client.get_crash_groups(app).should have(2).items
|
51
|
+
end
|
52
|
+
|
53
|
+
it "returns CrashGroup objects" do
|
54
|
+
client.get_crash_groups(app)[0].should be_kind_of HockeyApp::CrashGroup
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
describe "#get_versions" do
|
60
|
+
it "returns an Enumerable " do
|
61
|
+
client.get_versions(app).should be_kind_of Enumerable
|
62
|
+
end
|
63
|
+
|
64
|
+
it "has a 9 elements " do
|
65
|
+
client.get_versions(app).should have(2).items
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
it "returns Version objects" do
|
70
|
+
client.get_versions(app)[0].should be_kind_of HockeyApp::Version
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
|
+
|
75
|
+
describe "#get_crash_description" do
|
76
|
+
|
77
|
+
it "returns expected string " do
|
78
|
+
client.get_crash_description(crash).should == "crash_description"
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
|
83
|
+
describe "#get_crash_log" do
|
84
|
+
it "returns expected string " do
|
85
|
+
client.get_crash_log(crash).should == "crash_log"
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
|
90
|
+
describe "post_new_version" do
|
91
|
+
|
92
|
+
it "raise an error when no payload is attached to the version object" do
|
93
|
+
new_version = ::HockeyApp::Version.new(app, client)
|
94
|
+
lambda { client.post_new_version new_version}.should raise_error
|
95
|
+
|
96
|
+
end
|
97
|
+
|
98
|
+
it "forms a valid post request with minimal payload" do
|
99
|
+
new_version = ::HockeyApp::Version.new(app, client)
|
100
|
+
fake_runtime = Tempfile.new('fake_runtime')
|
101
|
+
new_version.ipa= fake_runtime
|
102
|
+
|
103
|
+
ws.should_receive(:post_new_version).with(app.public_identifier, fake_runtime, nil, 'New version', 0, 0, 2).and_return({})
|
104
|
+
client.post_new_version new_version
|
105
|
+
fake_runtime.unlink
|
106
|
+
end
|
107
|
+
|
108
|
+
it "forms a valid request with full payload" do
|
109
|
+
new_version = ::HockeyApp::Version.new(app, client)
|
110
|
+
fake_runtime = Tempfile.new('fake_runtime')
|
111
|
+
new_version.ipa= fake_runtime
|
112
|
+
fake_symbols = Tempfile.new('fake_symbols')
|
113
|
+
new_version.dsym = fake_symbols
|
114
|
+
new_version.notes = "Fake notes"
|
115
|
+
new_version.notes_type = ::HockeyApp::Version::NOTES_TYPES_TO_SYM.invert[:textile]
|
116
|
+
new_version.notify = ::HockeyApp::Version::NOTIFY_TO_BOOL.invert[true]
|
117
|
+
new_version.status = ::HockeyApp::Version::STATUS_TO_SYM.invert[:allow]
|
118
|
+
|
119
|
+
|
120
|
+
ws.should_receive(:post_new_version).with(app.public_identifier, fake_runtime, fake_symbols, "Fake notes", 0, 1, 2).and_return({})
|
121
|
+
client.post_new_version new_version
|
122
|
+
fake_runtime.unlink
|
123
|
+
fake_symbols.unlink
|
124
|
+
|
125
|
+
end
|
126
|
+
|
127
|
+
it "returns a Version object" do
|
128
|
+
new_version = ::HockeyApp::Version.new(app, client)
|
129
|
+
fake_runtime = Tempfile.new('fake_runtime')
|
130
|
+
new_version.ipa= fake_runtime
|
131
|
+
|
132
|
+
result = client.post_new_version new_version
|
133
|
+
result.should be_kind_of ::HockeyApp::Version
|
134
|
+
fake_runtime.unlink
|
135
|
+
end
|
136
|
+
|
137
|
+
end
|
138
|
+
|
139
|
+
describe "remove_app" do
|
140
|
+
it "returns expected code" do
|
141
|
+
client.remove_app(app).should be_true
|
142
|
+
end
|
143
|
+
|
144
|
+
end
|
145
|
+
|
146
|
+
describe "create_app" do
|
147
|
+
it "returns an App object" do
|
148
|
+
binary_file = double('file')
|
149
|
+
client.create_app(binary_file).should be_kind_of ::HockeyApp::App
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
data/spec/ws/ws_spec.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require_relative '../../spec/support/rspec_helper'
|
2
|
+
|
3
|
+
|
4
|
+
describe HockeyApp::WS do
|
5
|
+
context "when there is no token given" do
|
6
|
+
|
7
|
+
before :each do
|
8
|
+
HockeyApp::Config.configure do |config|
|
9
|
+
config.token = nil
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should raise an exception when creating a new client" do
|
14
|
+
lambda {HockeyApp::WS.new()}.should raise_error
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
context "when base_uri is defined" do
|
19
|
+
before :each do
|
20
|
+
HockeyApp::Config.configure do |config|
|
21
|
+
config.token = "ABCDEF"
|
22
|
+
config.base_uri = "http://example.com/api"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
it "should use the config uri as endpoint" do
|
28
|
+
subject.class.base_uri.should == "http://example.com/api"
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,197 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: hockeyapp
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.15
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Philippe Van Eerdenbrugghe
|
8
|
+
- Paul Renson
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-04-30 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rspec
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ! '>='
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ! '>='
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: simplecov
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ! '>='
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ! '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: awesome_print
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ! '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rake
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: multi_json
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :runtime
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ! '>='
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: httmultiparty
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ! '>='
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
type: :runtime
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ! '>='
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: activemodel
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ! '>='
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
type: :runtime
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ! '>='
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
description: This simple wrapper enables you to acces the hockeyapp REST API through
|
113
|
+
simple ruby calls. You are rquired to configure a valid token before doing anyhting
|
114
|
+
else
|
115
|
+
email:
|
116
|
+
- philippe.vaneerdenbrugghe@tapptic.com
|
117
|
+
- paul.renson.ext@tapptic.com
|
118
|
+
executables: []
|
119
|
+
extensions: []
|
120
|
+
extra_rdoc_files: []
|
121
|
+
files:
|
122
|
+
- .gitignore
|
123
|
+
- Gemfile
|
124
|
+
- README.md
|
125
|
+
- Rakefile
|
126
|
+
- hockeyapp.gemspec
|
127
|
+
- lib/hockeyapp.rb
|
128
|
+
- lib/hockeyapp/config.rb
|
129
|
+
- lib/hockeyapp/models/active_model_compliance.rb
|
130
|
+
- lib/hockeyapp/models/app.rb
|
131
|
+
- lib/hockeyapp/models/crash.rb
|
132
|
+
- lib/hockeyapp/models/crash_group.rb
|
133
|
+
- lib/hockeyapp/models/version.rb
|
134
|
+
- lib/hockeyapp/services/android_urls.rb
|
135
|
+
- lib/hockeyapp/services/ios_urls.rb
|
136
|
+
- lib/hockeyapp/ws/client.rb
|
137
|
+
- lib/hockeyapp/ws/ws.rb
|
138
|
+
- spec/config_spec.rb
|
139
|
+
- spec/hockey_app_spec.rb
|
140
|
+
- spec/models/app_spec.rb
|
141
|
+
- spec/models/crash_group_spec.rb
|
142
|
+
- spec/models/crash_spec.rb
|
143
|
+
- spec/models/version_spec.rb
|
144
|
+
- spec/support/active_model_lint.rb
|
145
|
+
- spec/support/fake_ws.rb
|
146
|
+
- spec/support/responses/app.json
|
147
|
+
- spec/support/responses/app_versions.json
|
148
|
+
- spec/support/responses/apps.json
|
149
|
+
- spec/support/responses/crash_groups.json
|
150
|
+
- spec/support/responses/crashes.json
|
151
|
+
- spec/support/responses/new_app.json
|
152
|
+
- spec/support/responses/new_version.json
|
153
|
+
- spec/support/rspec_helper.rb
|
154
|
+
- spec/ws/client_spec.rb
|
155
|
+
- spec/ws/ws_spec.rb
|
156
|
+
homepage: ''
|
157
|
+
licenses: []
|
158
|
+
metadata: {}
|
159
|
+
post_install_message:
|
160
|
+
rdoc_options: []
|
161
|
+
require_paths:
|
162
|
+
- lib
|
163
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
164
|
+
requirements:
|
165
|
+
- - ! '>='
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: '0'
|
168
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
169
|
+
requirements:
|
170
|
+
- - ! '>='
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: '0'
|
173
|
+
requirements: []
|
174
|
+
rubyforge_project: hockeyapp
|
175
|
+
rubygems_version: 2.0.3
|
176
|
+
signing_key:
|
177
|
+
specification_version: 4
|
178
|
+
summary: Wrapper for the hockeyapp REST API
|
179
|
+
test_files:
|
180
|
+
- spec/config_spec.rb
|
181
|
+
- spec/hockey_app_spec.rb
|
182
|
+
- spec/models/app_spec.rb
|
183
|
+
- spec/models/crash_group_spec.rb
|
184
|
+
- spec/models/crash_spec.rb
|
185
|
+
- spec/models/version_spec.rb
|
186
|
+
- spec/support/active_model_lint.rb
|
187
|
+
- spec/support/fake_ws.rb
|
188
|
+
- spec/support/responses/app.json
|
189
|
+
- spec/support/responses/app_versions.json
|
190
|
+
- spec/support/responses/apps.json
|
191
|
+
- spec/support/responses/crash_groups.json
|
192
|
+
- spec/support/responses/crashes.json
|
193
|
+
- spec/support/responses/new_app.json
|
194
|
+
- spec/support/responses/new_version.json
|
195
|
+
- spec/support/rspec_helper.rb
|
196
|
+
- spec/ws/client_spec.rb
|
197
|
+
- spec/ws/ws_spec.rb
|