hockeyapp-aszmyd 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +5 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +53 -0
- data/README.md +37 -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 +121 -0
- data/lib/hockeyapp/models/crash.rb +44 -0
- data/lib/hockeyapp/models/crash_group.rb +36 -0
- data/lib/hockeyapp/models/version.rb +92 -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 +98 -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 +198 -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,198 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: hockeyapp-aszmyd
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.15
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Philippe Van Eerdenbrugghe
|
9
|
+
- Paul Renson
|
10
|
+
- Adam Szmyd
|
11
|
+
autorequire:
|
12
|
+
bindir: bin
|
13
|
+
cert_chain: []
|
14
|
+
date: 2014-05-13 00:00:00.000000000 Z
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: rspec
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
21
|
+
- - ! '>='
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: '0'
|
24
|
+
type: :runtime
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
none: false
|
28
|
+
requirements:
|
29
|
+
- - ! '>='
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: '0'
|
32
|
+
- !ruby/object:Gem::Dependency
|
33
|
+
name: simplecov
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
36
|
+
requirements:
|
37
|
+
- - ! '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: awesome_print
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
type: :runtime
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - ! '>='
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
64
|
+
- !ruby/object:Gem::Dependency
|
65
|
+
name: rake
|
66
|
+
requirement: !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
68
|
+
requirements:
|
69
|
+
- - ! '>='
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
72
|
+
type: :runtime
|
73
|
+
prerelease: false
|
74
|
+
version_requirements: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ! '>='
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: multi_json
|
82
|
+
requirement: !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
type: :runtime
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
none: false
|
92
|
+
requirements:
|
93
|
+
- - ! '>='
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
- !ruby/object:Gem::Dependency
|
97
|
+
name: httmultiparty
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
99
|
+
none: false
|
100
|
+
requirements:
|
101
|
+
- - ! '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
none: false
|
108
|
+
requirements:
|
109
|
+
- - ! '>='
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: activemodel
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
none: false
|
116
|
+
requirements:
|
117
|
+
- - ! '>='
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
type: :runtime
|
121
|
+
prerelease: false
|
122
|
+
version_requirements: !ruby/object:Gem::Requirement
|
123
|
+
none: false
|
124
|
+
requirements:
|
125
|
+
- - ! '>='
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '0'
|
128
|
+
description: This simple wrapper enables you to acces the hockeyapp REST API through
|
129
|
+
simple ruby calls. You are rquired to configure a valid token before doing anyhting
|
130
|
+
else
|
131
|
+
email:
|
132
|
+
- philippe.vaneerdenbrugghe@tapptic.com
|
133
|
+
- paul.renson.ext@tapptic.com
|
134
|
+
- szmydadam@gmail.com
|
135
|
+
executables: []
|
136
|
+
extensions: []
|
137
|
+
extra_rdoc_files: []
|
138
|
+
files:
|
139
|
+
- .gitignore
|
140
|
+
- Gemfile
|
141
|
+
- Gemfile.lock
|
142
|
+
- README.md
|
143
|
+
- Rakefile
|
144
|
+
- hockeyapp.gemspec
|
145
|
+
- lib/hockeyapp.rb
|
146
|
+
- lib/hockeyapp/config.rb
|
147
|
+
- lib/hockeyapp/models/active_model_compliance.rb
|
148
|
+
- lib/hockeyapp/models/app.rb
|
149
|
+
- lib/hockeyapp/models/crash.rb
|
150
|
+
- lib/hockeyapp/models/crash_group.rb
|
151
|
+
- lib/hockeyapp/models/version.rb
|
152
|
+
- lib/hockeyapp/services/android_urls.rb
|
153
|
+
- lib/hockeyapp/services/ios_urls.rb
|
154
|
+
- lib/hockeyapp/ws/client.rb
|
155
|
+
- lib/hockeyapp/ws/ws.rb
|
156
|
+
- spec/config_spec.rb
|
157
|
+
- spec/hockey_app_spec.rb
|
158
|
+
- spec/models/app_spec.rb
|
159
|
+
- spec/models/crash_group_spec.rb
|
160
|
+
- spec/models/crash_spec.rb
|
161
|
+
- spec/models/version_spec.rb
|
162
|
+
- spec/support/active_model_lint.rb
|
163
|
+
- spec/support/fake_ws.rb
|
164
|
+
- spec/support/responses/app.json
|
165
|
+
- spec/support/responses/app_versions.json
|
166
|
+
- spec/support/responses/apps.json
|
167
|
+
- spec/support/responses/crash_groups.json
|
168
|
+
- spec/support/responses/crashes.json
|
169
|
+
- spec/support/responses/new_app.json
|
170
|
+
- spec/support/responses/new_version.json
|
171
|
+
- spec/support/rspec_helper.rb
|
172
|
+
- spec/ws/client_spec.rb
|
173
|
+
- spec/ws/ws_spec.rb
|
174
|
+
homepage: ''
|
175
|
+
licenses: []
|
176
|
+
post_install_message:
|
177
|
+
rdoc_options: []
|
178
|
+
require_paths:
|
179
|
+
- lib
|
180
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
181
|
+
none: false
|
182
|
+
requirements:
|
183
|
+
- - ! '>='
|
184
|
+
- !ruby/object:Gem::Version
|
185
|
+
version: '0'
|
186
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
187
|
+
none: false
|
188
|
+
requirements:
|
189
|
+
- - ! '>='
|
190
|
+
- !ruby/object:Gem::Version
|
191
|
+
version: '0'
|
192
|
+
requirements: []
|
193
|
+
rubyforge_project: hockeyapp
|
194
|
+
rubygems_version: 1.8.23
|
195
|
+
signing_key:
|
196
|
+
specification_version: 3
|
197
|
+
summary: Wrapper for the hockeyapp REST API
|
198
|
+
test_files: []
|