codeship 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/codeship.rb +1 -0
- data/lib/codeship/builds.rb +32 -0
- data/lib/codeship/request.rb +1 -1
- data/lib/codeship/version.rb +1 -1
- data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_branchnotfound.yml +1 -1
- data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_error.yml +1 -1
- data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_ignored.yml +1 -1
- data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_projectnotfound.yml +1 -1
- data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_success.yml +1 -1
- data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_testing.yml +1 -1
- data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_waiting.yml +1 -1
- data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_branchnotfound.yml +1 -1
- data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_error.yml +1 -1
- data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_ignored.yml +1 -1
- data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_projectnotfound.yml +1 -1
- data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_success.yml +1 -1
- data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_testing.yml +1 -1
- data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_waiting.yml +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcef7bc29d8fb79231f4281d71218fb87eecc3dc
|
4
|
+
data.tar.gz: 1e6a919cec8cd8b263dce813a1567574d2c2046c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c9b7cbd603f275ffe172f7999d44e070a350a579abd6485c27e62c6a07959639fc5a2d652bb46c9d0b99458972ca45da522e915cb90e7f77002ae45710c726d
|
7
|
+
data.tar.gz: be86da7c6036853745f444dca0fce4be78e32dc932fbd7bc9d05642897e07882df0405fa623e93892d376de96992f89938c180ec6fc963b8cab28a31eafce615
|
data/lib/codeship.rb
CHANGED
@@ -0,0 +1,32 @@
|
|
1
|
+
require "codeship/request"
|
2
|
+
require "codeship/response"
|
3
|
+
|
4
|
+
module Codeship
|
5
|
+
class Builds
|
6
|
+
|
7
|
+
include Request
|
8
|
+
include Response
|
9
|
+
|
10
|
+
def initialize api_key = nil
|
11
|
+
@api_key = api_key
|
12
|
+
end
|
13
|
+
|
14
|
+
def restart id
|
15
|
+
raise ArgumentError, 'You need to set API key' if !@api_key
|
16
|
+
@build_id = id
|
17
|
+
@action = 'restart'
|
18
|
+
resp = http_request.request_post builds_url, ''
|
19
|
+
handle(resp)
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def builds_url
|
25
|
+
url = "/api/v1/builds.json"
|
26
|
+
url = "/api/v1/builds/#{@build_id}.json" if @build_id
|
27
|
+
url = "/api/v1/builds/#{@build_id}/#{@action}.json" if @build_id && @action
|
28
|
+
url << "?api_key=#{@api_key}"
|
29
|
+
url
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/codeship/request.rb
CHANGED
data/lib/codeship/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codeship
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- beanieboi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -108,6 +108,7 @@ files:
|
|
108
108
|
- Rakefile
|
109
109
|
- codeship.gemspec
|
110
110
|
- lib/codeship.rb
|
111
|
+
- lib/codeship/builds.rb
|
111
112
|
- lib/codeship/projects.rb
|
112
113
|
- lib/codeship/request.rb
|
113
114
|
- lib/codeship/response.rb
|