wercker_api 1.0.1 → 1.0.2

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: 05d290350d98af8642a3f5df98e546395a9232bc
4
- data.tar.gz: 9dae9e554cdd322e0c77420142354ba987ab88fa
3
+ metadata.gz: 76909b126a7c23e3bc82209360663216f46d7429
4
+ data.tar.gz: 983d700abb08c43b0f5aa3bad2fd1a02536c151d
5
5
  SHA512:
6
- metadata.gz: 702c15b0c485f962c4822d12d3856d24aa5adeebe5e9d29cf20d3c764e3763025b883a899ae1972e19f92e41468e9c8185ed672d30a6fd597a85b10c41a42ec4
7
- data.tar.gz: 323da7a204a612a3624a14f954d5eebec9c6981e42f478a62fa69e319328ceaba0fbbb28b6b759f096cf754136c51efae55ab0bb4ebe2c8f4778fba0170e59d3
6
+ metadata.gz: 20a408095adf4afe8ad7d3e10e097a12bf529579e2da75738f1dc3ca32abad29a7409f8c3e126c40720fb1b16fc38d496117cb73236b1f7993368dfbed6e6b11
7
+ data.tar.gz: c54b44928e06024de502cc9c4a74c7f10d294b37920da4ce1b330e76526aa32e01301420eb191223e67fd5ecab3cec401e2d2f7499cc6206b5f2afcec9f1c923
data/lib/wercker_api.rb CHANGED
@@ -6,6 +6,8 @@ require 'wercker_api/owner'
6
6
  require 'wercker_api/pipeline'
7
7
  require 'wercker_api/run_collection'
8
8
  require 'wercker_api/run'
9
+ require "wercker_api/run/step"
10
+ require "wercker_api/run/step_collection"
9
11
  require 'wercker_api/application'
10
12
  require 'wercker_api/application_collection'
11
13
  require 'wercker_api/application/build'
@@ -178,6 +178,18 @@ EOM
178
178
  request build_get_request(Run::SHOW[api_version, run_id]), Run
179
179
  end
180
180
 
181
+ # Get steps for run
182
+ #
183
+ # Get the steps for a run.
184
+ #
185
+ # Returns an array of step objects.
186
+ #
187
+ # @param run_id [String] An id as returned by an API call
188
+ # @return WerckerAPI::Run::Steps object An Enumerable yielding a WerckerAPI::Run::Step
189
+ def run_steps(run_id)
190
+ request build_get_request(Run::STEPS[api_version, run_id]), Run::StepCollection
191
+ end
192
+
181
193
  # Trigger a new run
182
194
  #
183
195
  # Trigger a new run for an application.
@@ -9,10 +9,11 @@ module WerckerAPI
9
9
  end
10
10
 
11
11
  class Run
12
- INDEX = ->(version) { "/api/#{version}/runs" }
13
- SHOW = ->(version, run_id) { "/api/#{version}/runs/#{run_id}" }
14
- TRIGGER = ->(version) { "/api/#{version}/runs" }
15
- ABORT = ->(version, run_id) { "/api/#{version}/runs/#{run_id}/abort" }
12
+ INDEX = -> (version) { "/api/#{version}/runs" }
13
+ SHOW = -> (version, run_id) { "/api/#{version}/runs/#{run_id}" }
14
+ TRIGGER = -> (version) { "/api/#{version}/runs" }
15
+ ABORT = -> (version, run_id) { "/api/#{version}/runs/#{run_id}/abort" }
16
+ STEPS = -> (version, run_id) { "/api/#{version}/runs/#{run_id}/steps" }
16
17
 
17
18
  include Virtus.model
18
19
 
@@ -0,0 +1,40 @@
1
+ module WerckerAPI
2
+ class Run
3
+ class Step
4
+
5
+ include Virtus.model
6
+
7
+ attribute :id, String
8
+ attribute :url, String
9
+ attribute :artifactsUrl, String
10
+ attribute :logUrl, String
11
+ attribute :order, Integer
12
+ attribute :createdAt, Time
13
+ attribute :finishedAt, Time
14
+ attribute :startedAt, Time
15
+ attribute :status, String
16
+ attribute :result, String
17
+ attribute :step, String
18
+
19
+ def artifacts_url
20
+ artifactsUrl
21
+ end
22
+
23
+ def log_url
24
+ logUrl
25
+ end
26
+
27
+ def created_at
28
+ createdAt
29
+ end
30
+
31
+ def started_at
32
+ startedAt
33
+ end
34
+
35
+ def finished_at
36
+ finishedAt
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,7 @@
1
+ module WerckerAPI
2
+ class Run
3
+ class StepCollection
4
+ include APICollection
5
+ end
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module WerckerAPI
2
- VERSION = '1.0.1'.freeze
2
+ VERSION = '1.0.2'.freeze
3
3
  end
data/wercker.yml CHANGED
@@ -24,7 +24,7 @@ deploy:
24
24
  code: |
25
25
  git config --global user.email "ymarquet@gmail.com"
26
26
  git config --global user.name "StupidCodefactory"
27
- git config --global push.default simple
27
+ git config --global push.default matching
28
28
  git push --set-upstream origin master
29
29
  - script:
30
30
  name: configure gem
@@ -38,4 +38,5 @@ deploy:
38
38
  - script:
39
39
  name: configure release
40
40
  code: |
41
+ bundle exec rake release
41
42
  bundle exec gem release
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: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - yann marquet
@@ -188,7 +188,6 @@ files:
188
188
  - ".codeclimate.yml"
189
189
  - ".gitignore"
190
190
  - ".rspec"
191
- - ".travis.yml"
192
191
  - Gemfile
193
192
  - LICENSE.txt
194
193
  - README.md
@@ -210,6 +209,8 @@ files:
210
209
  - lib/wercker_api/pipeline.rb
211
210
  - lib/wercker_api/pipeline_runner.rb
212
211
  - lib/wercker_api/run.rb
212
+ - lib/wercker_api/run/step.rb
213
+ - lib/wercker_api/run/step_collection.rb
213
214
  - lib/wercker_api/run_collection.rb
214
215
  - lib/wercker_api/scm.rb
215
216
  - lib/wercker_api/version.rb
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.4.1
5
- before_install: gem install bundler -v 1.15.1