semaphoreapp 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,7 +12,6 @@ require "semaphoreapp/branch_status"
12
12
  require "semaphoreapp/build"
13
13
  require "semaphoreapp/commit"
14
14
  require "semaphoreapp/json_api"
15
- require "semaphoreapp/paginated_array"
16
15
  require "semaphoreapp/project"
17
16
  require "semaphoreapp/version"
18
17
 
@@ -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
- response = send_request(branch_history_url(project_hash_id, id, options))
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={})
@@ -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
- # The only supported option is ':page => <number>', with <number> defaulting to 1 if not present“
9
- def get_builds(options={})
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
- # require "pry"; binding.pry
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, pagination=nil)
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
- return obj, pagination
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
@@ -1,3 +1,3 @@
1
1
  module Semaphoreapp
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-11 00:00:00.000000000 Z
12
+ date: 2013-02-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json