wercker_api 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -6
- data/lib/wercker_api/api_collection.rb +22 -0
- data/lib/wercker_api/application/build.rb +1 -1
- data/lib/wercker_api/application/build_collection.rb +1 -11
- data/lib/wercker_api/application/deploy.rb +10 -0
- data/lib/wercker_api/application/deploy_collection.rb +7 -0
- data/lib/wercker_api/client.rb +4 -0
- data/lib/wercker_api/version.rb +1 -1
- data/lib/wercker_api.rb +3 -0
- data/wercker.yml +14 -2
- data/wercker_api.gemspec +1 -0
- metadata +18 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad39fc5aa4e343213c1cccc2fcd2c4137c84fa4b
|
4
|
+
data.tar.gz: ab32ae2a0dba9713e40661cf926ecf17fa3e162a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f1f7529a69f7d1ea6b0b5ed81cea018434c65380a7f43e2926825ca55b16e794ce25a6192b2c4a5080bda3cf877f808d227b68fd9d5f615d65e023fbdf56c39
|
7
|
+
data.tar.gz: cd65332b8d7cecc9e75df229bd13417b413b402c5c0b7c09fffd27580edb71de4102e097841093d2d5dddc532bde17dec15e1a9af7b5e48196b7dd51d137c84e
|
data/README.md
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
|
1
|
+
[![wercker status](https://app.wercker.com/status/15fd697b0b3ff854e408a5c256e6737b/s/master "wercker status")](https://app.wercker.com/project/byKey/15fd697b0b3ff854e408a5c256e6737b)
|
2
|
+
[![Code Climate](https://codeclimate.com/github/StupidCodeFactory/wercker_api/badges/gpa.svg)](https://codeclimate.com/github/codeclimate/codeclimate)
|
3
|
+
[![Test Coverage](https://codeclimate.com/github/StupidCodeFactory/wercker_api/badges/coverage.svg)](https://codeclimate.com/github/codeclimate/codeclimate/coverage)
|
4
|
+
# WerckerAPI
|
2
5
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
|
+
Thin ruby wrapper around [wercker API](http://devcenter.wercker.com/docs/api)
|
6
7
|
|
7
8
|
## Installation
|
8
9
|
|
@@ -20,9 +21,15 @@ Or install it yourself as:
|
|
20
21
|
|
21
22
|
$ gem install wercker_api
|
22
23
|
|
23
|
-
|
24
|
+
# Usage #
|
25
|
+
|
26
|
+
Generate an API token and either pass it as an argument to the `WerckerAPI::Client` or use the environment variable WERCKER\_API\_TOKEN
|
27
|
+
```ruby
|
24
28
|
|
25
|
-
|
29
|
+
client = WerckerAPI::Client.new(token)
|
30
|
+
client.applications('StupidCodeFactory') # => ApplicationCollection
|
31
|
+
|
32
|
+
```
|
26
33
|
|
27
34
|
## Development
|
28
35
|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module WerckerAPI
|
2
|
+
module APICollection
|
3
|
+
|
4
|
+
def self.included(klass)
|
5
|
+
klass.class_eval do
|
6
|
+
include Enumerable
|
7
|
+
|
8
|
+
private
|
9
|
+
attr_accessor :collection
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
def initialize(collection = [])
|
15
|
+
self.collection = collection
|
16
|
+
end
|
17
|
+
|
18
|
+
def each
|
19
|
+
collection.each
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module WerckerAPI
|
2
2
|
class Application
|
3
3
|
class Build
|
4
|
-
INDEX =
|
4
|
+
INDEX = -> (version, user_name, application) { "/api/#{version}/applications/#{user_name}/#{application}/builds" }
|
5
5
|
|
6
6
|
end
|
7
7
|
end
|
@@ -1,17 +1,7 @@
|
|
1
1
|
module WerckerAPI
|
2
2
|
class Application
|
3
3
|
class BuildCollection
|
4
|
-
include
|
5
|
-
def initialize(collection = [])
|
6
|
-
self.collection = collection
|
7
|
-
end
|
8
|
-
|
9
|
-
def each
|
10
|
-
collection.each
|
11
|
-
end
|
12
|
-
|
13
|
-
private
|
14
|
-
attr_accessor :collection
|
4
|
+
include APICollection
|
15
5
|
end
|
16
6
|
end
|
17
7
|
end
|
data/lib/wercker_api/client.rb
CHANGED
@@ -38,6 +38,10 @@ EOM
|
|
38
38
|
request build_get_request(Application::Build::INDEX[api_version, user_name, application]), Application::BuildCollection
|
39
39
|
end
|
40
40
|
|
41
|
+
def application_deploys(user_name , application)
|
42
|
+
request build_get_request(Application::Deploy::INDEX[api_version, user_name, application]), Application::DeployCollection
|
43
|
+
end
|
44
|
+
|
41
45
|
private
|
42
46
|
attr_accessor :api_token, :api_version
|
43
47
|
|
data/lib/wercker_api/version.rb
CHANGED
data/lib/wercker_api.rb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
require "virtus"
|
2
2
|
require "wercker_api/version"
|
3
|
+
require "wercker_api/api_collection"
|
3
4
|
require "wercker_api/application"
|
4
5
|
require "wercker_api/application_collection"
|
5
6
|
require "wercker_api/application/build"
|
6
7
|
require "wercker_api/application/build_collection"
|
8
|
+
require "wercker_api/application/deploy"
|
9
|
+
require "wercker_api/application/deploy_collection"
|
7
10
|
require "wercker_api/client"
|
8
11
|
|
9
12
|
module WerckerAPI; end
|
data/wercker.yml
CHANGED
@@ -2,10 +2,22 @@ box: ruby:2.4.1
|
|
2
2
|
build:
|
3
3
|
steps:
|
4
4
|
- bundle-install
|
5
|
+
- script:
|
6
|
+
name: notify CodeClimate
|
7
|
+
code: |
|
8
|
+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
9
|
+
chmod +x ./cc-test-reporter
|
10
|
+
- script:
|
11
|
+
name: env
|
12
|
+
code: |
|
13
|
+
env
|
5
14
|
- script:
|
6
15
|
name: rspec
|
7
|
-
code:
|
8
|
-
|
16
|
+
code: |
|
17
|
+
./cc-test-reporter before-build
|
18
|
+
bundle exec rspec
|
19
|
+
./cc-test-reporter after-build --exit-code $?
|
20
|
+
deploy:
|
9
21
|
steps:
|
10
22
|
- bundle-install
|
11
23
|
- add-ssh-key:
|
data/wercker_api.gemspec
CHANGED
@@ -40,4 +40,5 @@ Gem::Specification.new do |spec|
|
|
40
40
|
spec.add_development_dependency 'webmock', '~> 3.0.1'
|
41
41
|
spec.add_development_dependency 'byebug', '~> 9.0.6'
|
42
42
|
spec.add_development_dependency 'awesome_print', '~> 1.8.0'
|
43
|
+
spec.add_development_dependency 'simplecov', '~> 0.14.1'
|
43
44
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wercker_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yann marquet
|
@@ -150,6 +150,20 @@ dependencies:
|
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: 1.8.0
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: simplecov
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: 0.14.1
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: 0.14.1
|
153
167
|
description: interact with wercker API, Deeper integration with wercker.
|
154
168
|
email:
|
155
169
|
- ymarquet@gmail.com
|
@@ -167,9 +181,12 @@ files:
|
|
167
181
|
- bin/console
|
168
182
|
- bin/setup
|
169
183
|
- lib/wercker_api.rb
|
184
|
+
- lib/wercker_api/api_collection.rb
|
170
185
|
- lib/wercker_api/application.rb
|
171
186
|
- lib/wercker_api/application/build.rb
|
172
187
|
- lib/wercker_api/application/build_collection.rb
|
188
|
+
- lib/wercker_api/application/deploy.rb
|
189
|
+
- lib/wercker_api/application/deploy_collection.rb
|
173
190
|
- lib/wercker_api/application_collection.rb
|
174
191
|
- lib/wercker_api/client.rb
|
175
192
|
- lib/wercker_api/version.rb
|