wercker_api 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cfe11e2aabe45e05cd802e0652af2ed1ee03359b
4
- data.tar.gz: e326a9a36c82cac40eb411b0cb74451fd180a0c1
3
+ metadata.gz: ad39fc5aa4e343213c1cccc2fcd2c4137c84fa4b
4
+ data.tar.gz: ab32ae2a0dba9713e40661cf926ecf17fa3e162a
5
5
  SHA512:
6
- metadata.gz: 5d185883136cdbb7d9477f6de7798158840134620be9b6f844d8661d92a3e88a19dcfb096e6333fc357760edf79aded3c9aa4f74881ebaa32b8c8a27bd5b5392
7
- data.tar.gz: 531c24f1fa0ff927d52a5a644b28123d0dc7f0e57ce3aff795f815aa86847507486c17ae1c1ae5546e40736211bcc4a9e63eac915dfaa5c74c8b4feb87f37219
6
+ metadata.gz: 3f1f7529a69f7d1ea6b0b5ed81cea018434c65380a7f43e2926825ca55b16e794ce25a6192b2c4a5080bda3cf877f808d227b68fd9d5f615d65e023fbdf56c39
7
+ data.tar.gz: cd65332b8d7cecc9e75df229bd13417b413b402c5c0b7c09fffd27580edb71de4102e097841093d2d5dddc532bde17dec15e1a9af7b5e48196b7dd51d137c84e
data/README.md CHANGED
@@ -1,8 +1,9 @@
1
- # WerckerApi
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
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/wercker_api`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- ## Usage
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
- TODO: Write usage instructions here
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 = -> (version, user_name, application) { "/api/#{version}/applications/#{user_name}/#{application}/builds" }
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 Enumerable
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
@@ -0,0 +1,10 @@
1
+ module WerckerAPI
2
+ class Application
3
+
4
+ class Deploy
5
+ INDEX = -> (version, user_name, application) { "/api/#{version}/applications/#{user_name}/#{application}/deploys" }
6
+ end
7
+
8
+ end
9
+
10
+ end
@@ -0,0 +1,7 @@
1
+ module WerckerAPI
2
+ class Application
3
+ class DeployCollection
4
+ include APICollection
5
+ end
6
+ end
7
+ end
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module WerckerAPI
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
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: bundle exec rspec
8
- deploy-pre-release:
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.6
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