semaphore_api 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6d06d96c5bc4f60c2f37bece42852fed7d0e5afc
4
- data.tar.gz: c435230fcbb2162182b52e7926eda33bd4c3bf7b
3
+ metadata.gz: 83e49148997488d3d6767b0196608a34ed75f1b3
4
+ data.tar.gz: a22df7d3163c1ede429b885d05d36894aad9cd4e
5
5
  SHA512:
6
- metadata.gz: 207c246bb5eb3b6138f025057b4ae90f5f85f66b406698cd74284394a9cf07d2237a17bc5952a6064b848391740fa9416320ac5198398aea2b69a03667ecc951
7
- data.tar.gz: 5bc3f9d13e59168b854e9e799d5eb24b48f608bf3e37b635e223838f2835f585218401083cf28ac1b15318cf0bacd771529ee43aa850baa5c0f642d19b97157e
6
+ metadata.gz: 6b812ef0163ceaa3583ae4b8e7802a4160f9701685d8783a0c61116413aedfc8e6fd49b19d4f0a0bec5c882d616ffb748567cba8a05b2c308297c865b007d7e1
7
+ data.tar.gz: c46f4d1a2d5e40878ad4f9a82b8eb799f27abbce313c8ab29412da92042d0474e5e5e709343a5b0d1a8bcf9f0301d7077710c22d3149a2c53884efbcabc41a74
data/README.md CHANGED
@@ -4,6 +4,8 @@ Unofficial Ruby wrapper around Semaphore's API
4
4
 
5
5
  ![SemaphoreCI](http://fc04.deviantart.net/fs71/f/2013/081/4/d/futurama__zoidberg__banner_by_daspoony-d5yvo0t.jpg)
6
6
 
7
+ [![Build Status](https://semaphoreci.com/api/v1/projects/bf784948-b2c9-4085-8dc8-6c198f6ccb64/468031/badge.svg)](https://semaphoreci.com/shiroyasha/semaphore_api)
8
+
7
9
  ## Usage
8
10
 
9
11
  Start by contructing a client
@@ -2,10 +2,14 @@ module SemaphoreApi
2
2
  class Client
3
3
  module WebHooks
4
4
 
5
- def webhooks(project_hash_id)
5
+ def webhooks(project_hash_id, options = {})
6
6
  get "/projects/#{project_hash_id}/hooks"
7
7
  end
8
8
 
9
+ def create_webhook(project_hash_id, options = {})
10
+ post "/projects/#{project_hash_id}/hooks", options
11
+ end
12
+
9
13
  end
10
14
  end
11
15
  end
@@ -22,7 +22,13 @@ module SemaphoreApi
22
22
  end
23
23
 
24
24
  def get(path, options = {})
25
- response = agent.get("/api/v1/#{path}", {:auth_token => @auth_token})
25
+ response = agent.get("/api/v1/#{path}", options.merge(:auth_token => @auth_token))
26
+
27
+ response.body
28
+ end
29
+
30
+ def post(path, options = {})
31
+ response = agent.post("/api/v1/#{path}", options.merge(:auth_token => @auth_token))
26
32
 
27
33
  response.body
28
34
  end
@@ -1,3 +1,3 @@
1
1
  module SemaphoreApi
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "zoid", "~> 0.1"
21
+ spec.add_dependency "zoid", "~> 0.2"
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.9"
24
24
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semaphore_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Sarcevic
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-06-26 00:00:00.000000000 Z
11
+ date: 2015-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zoid
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.1'
19
+ version: '0.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.1'
26
+ version: '0.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement