semaphoreapp 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/semaphoreapp.rb +0 -1
- data/lib/semaphoreapp/api.rb +1 -2
- data/lib/semaphoreapp/branch.rb +2 -3
- data/lib/semaphoreapp/json_api.rb +3 -9
- data/lib/semaphoreapp/version.rb +1 -1
- metadata +2 -2
data/lib/semaphoreapp.rb
CHANGED
data/lib/semaphoreapp/api.rb
CHANGED
@@ -17,8 +17,7 @@ module Semaphoreapp
|
|
17
17
|
|
18
18
|
def self.get_branch_history(project_hash_id, id, options={})
|
19
19
|
set_auth_token(options)
|
20
|
-
|
21
|
-
return response.body, response['pagination']
|
20
|
+
send_request(branch_history_url(project_hash_id, id, options)).body
|
22
21
|
end
|
23
22
|
|
24
23
|
def self.get_branch_status(project_hash_id, id, options={})
|
data/lib/semaphoreapp/branch.rb
CHANGED
@@ -5,9 +5,8 @@ module Semaphoreapp
|
|
5
5
|
Semaphoreapp::BranchStatus.build( Semaphoreapp::JsonApi.get_branch_status(project_hash_id, id) )
|
6
6
|
end
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
history = Semaphoreapp::JsonApi.get_branch_history(project_hash_id, id, options)
|
8
|
+
def get_builds
|
9
|
+
history = Semaphoreapp::JsonApi.get_branch_history(project_hash_id, id)
|
11
10
|
Semaphoreapp::Build.build(history['builds'])
|
12
11
|
end
|
13
12
|
|
@@ -9,8 +9,7 @@ module Semaphoreapp
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def self.get_branch_history(project_hash_id, id, options={})
|
12
|
-
|
13
|
-
raise_if_error(parse(*super))
|
12
|
+
raise_if_error(JSON.parse(super))
|
14
13
|
end
|
15
14
|
|
16
15
|
def self.get_branch_status(project_hash_id, id, options={})
|
@@ -20,14 +19,9 @@ module Semaphoreapp
|
|
20
19
|
|
21
20
|
private
|
22
21
|
|
23
|
-
def self.raise_if_error(obj
|
22
|
+
def self.raise_if_error(obj)
|
24
23
|
raise Semaphoreapp::Api::Error, obj['error'] if obj.is_a?(Hash) && obj.has_key?('error')
|
25
|
-
|
26
|
-
end
|
27
|
-
|
28
|
-
def self.parse(body, pagination)
|
29
|
-
require "pry"; binding.pry
|
30
|
-
PaginatedArray.new(JSON.parse(pagination), JSON.parse(body))
|
24
|
+
obj
|
31
25
|
end
|
32
26
|
end
|
33
27
|
end
|
data/lib/semaphoreapp/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semaphoreapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|