jenkins_api_client 1.0.0.beta.6 → 1.0.0.beta.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 72219c64c51d4188c90829ff549bccc8fcd97f9d
4
+ data.tar.gz: b96ba795c3fc93492cc14329110773148c1956e7
5
+ SHA512:
6
+ metadata.gz: a5cbb2c72b42adf32de0454817a7b8a56957e398e2f0331e1652e7c00e1631bb352d5524192f27423b6ad8795e4c526aaefc5f300c947d6bd555cd918c44aa05
7
+ data.tar.gz: b19cf69fd20e15a58049570f4c51aa32d3a13b95bb21152582a6939b5e9d9257fba1f303ad384e2225b8bc44e007762739733fb3538af7cce2f079cfcb7f65d9
@@ -2,14 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
+ # stub: jenkins_api_client 1.0.0.beta.7 ruby lib
5
6
 
6
7
  Gem::Specification.new do |s|
7
8
  s.name = "jenkins_api_client"
8
- s.version = "1.0.0.beta.6"
9
+ s.version = "1.0.0.beta.7"
9
10
 
10
11
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
11
13
  s.authors = ["Kannan Manickam"]
12
- s.date = "2014-04-19"
14
+ s.date = "2014-06-20"
13
15
  s.description = "\nThis is a simple and easy-to-use Jenkins Api client with features focused on\nautomating Job configuration programaticaly and so forth"
14
16
  s.email = ["arangamani.kannan@gmail.com"]
15
17
  s.executables = ["jenkinscli"]
@@ -80,13 +82,12 @@ Gem::Specification.new do |s|
80
82
  "travis/user_config.xml"
81
83
  ]
82
84
  s.homepage = "https://github.com/arangamani/jenkins_api_client"
83
- s.require_paths = ["lib"]
84
85
  s.required_ruby_version = Gem::Requirement.new(">= 1.9.2")
85
- s.rubygems_version = "1.8.23"
86
+ s.rubygems_version = "2.2.2"
86
87
  s.summary = "Jenkins JSON API Client"
87
88
 
88
89
  if s.respond_to? :specification_version then
89
- s.specification_version = 3
90
+ s.specification_version = 4
90
91
 
91
92
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
92
93
  s.add_runtime_dependency(%q<nokogiri>, ["~> 1.6.0"])
@@ -21,6 +21,7 @@
21
21
  #
22
22
 
23
23
  require 'fileutils'
24
+ require 'yaml'
24
25
 
25
26
  module JenkinsApi
26
27
  module CLI
@@ -106,7 +106,7 @@ module JenkinsApi
106
106
 
107
107
  # Creates a new node with the specified parameters
108
108
  #
109
- # @param [Hash] params parameters for creating a dump slave
109
+ # @param [Hash] params parameters for creating a dumb slave
110
110
  # * +:name+ name of the slave
111
111
  # * +:description+ description of the new slave
112
112
  # * +:executors+ number of executors
@@ -118,8 +118,8 @@ module JenkinsApi
118
118
  # * +:private_key_file+ Private key file of master
119
119
  # * +:credentials_id+ Id for credential in Jenkins
120
120
  #
121
- # @example Create a Dump Slave
122
- # create_dump_slave(
121
+ # @example Create a Dumb Slave
122
+ # create_dumb_slave(
123
123
  # :name => "slave1",
124
124
  # :slave_host => "10.10.10.10",
125
125
  # :private_key_file => "/root/.ssh/id_rsa",
@@ -127,14 +127,14 @@ module JenkinsApi
127
127
  # :labels => "slave, ruby"
128
128
  # )
129
129
  #
130
- def create_dump_slave(params)
130
+ def create_dumb_slave(params)
131
131
  unless params[:name] && params[:slave_host] && params[:private_key_file]
132
132
  raise ArgumentError, "Name, slave host, and private key file are" +
133
133
  " required for creating a slave."
134
134
  end
135
135
 
136
- @logger.info "Creating a dump slave '#{params[:name]}'"
137
- @logger.debug "Creating a dump slave with params: #{params.inspect}"
136
+ @logger.info "Creating a dumb slave '#{params[:name]}'"
137
+ @logger.debug "Creating a dumb slave with params: #{params.inspect}"
138
138
  default_params = {
139
139
  :description => "Automatically created through jenkins_api_client",
140
140
  :executors => 2,
@@ -182,6 +182,11 @@ module JenkinsApi
182
182
  @client.api_post_request("/computer/doCreateItem", post_params)
183
183
  end
184
184
 
185
+ def create_dump_slave(params)
186
+ @logger.warn '[DEPRECATED] Please use create_dumb_slave instead.'
187
+ create_dumb_slave(params)
188
+ end
189
+
185
190
  # Deletes the specified node
186
191
  #
187
192
  # @param [String] node_name Name of the node to delete
@@ -123,7 +123,7 @@ module JenkinsApi
123
123
  if filters.keys.all? { |key| plugin[key.to_s] == filters[key] }
124
124
  [plugin["shortName"], plugin["version"]]
125
125
  end
126
- end]
126
+ end.compact]
127
127
  installed
128
128
  end
129
129
 
@@ -29,7 +29,7 @@ module JenkinsApi
29
29
  # Tiny version of the gem used for patches
30
30
  TINY = 0
31
31
  # Used for pre-releases
32
- PRE = 'beta.6'
32
+ PRE = 'beta.7'
33
33
  # Version String of Jenkins API Client.
34
34
  VERSION = [MAJOR, MINOR, TINY, PRE].compact.join('.')
35
35
  end
@@ -21,7 +21,7 @@ describe JenkinsApi::Client::Node do
21
21
  puts e.message
22
22
  end
23
23
 
24
- @client.node.create_dump_slave(
24
+ @client.node.create_dumb_slave(
25
25
  :name => "slave",
26
26
  :slave_host => "10.0.0.1",
27
27
  :private_key_file => "/root/.ssh/id_rsa"
@@ -43,12 +43,12 @@ describe JenkinsApi::Client::Node do
43
43
  end
44
44
  end
45
45
 
46
- describe "#create_dump_slave" do
46
+ describe "#create_dumb_slave" do
47
47
 
48
48
  def test_and_validate(params)
49
49
  name = params[:name]
50
50
  @valid_post_responses.should include(
51
- @client.node.create_dump_slave(params).to_i
51
+ @client.node.create_dumb_slave(params).to_i
52
52
  )
53
53
  @client.node.list(name).include?(name).should be_true
54
54
  @valid_post_responses.should include(
@@ -79,7 +79,7 @@ describe JenkinsApi::Client::Node do
79
79
  :private_key_file => "/root/.ssh/id_rsa"
80
80
  }
81
81
  expect(
82
- lambda{ @client.node.create_dump_slave(params) }
82
+ lambda{ @client.node.create_dumb_slave(params) }
83
83
  ).to raise_error(ArgumentError)
84
84
  end
85
85
  it "fails if slave_host is missing" do
@@ -88,7 +88,7 @@ describe JenkinsApi::Client::Node do
88
88
  :private_key_file => "/root/.ssh/id_rsa"
89
89
  }
90
90
  expect(
91
- lambda{ @client.node.create_dump_slave(params) }
91
+ lambda{ @client.node.create_dumb_slave(params) }
92
92
  ).to raise_error(ArgumentError)
93
93
  end
94
94
  it "fails if private_key_file is missing" do
@@ -97,7 +97,7 @@ describe JenkinsApi::Client::Node do
97
97
  :slave_host => "10.10.10.10"
98
98
  }
99
99
  expect(
100
- lambda{ @client.node.create_dump_slave(params) }
100
+ lambda{ @client.node.create_dumb_slave(params) }
101
101
  ).to raise_error(ArgumentError)
102
102
  end
103
103
  it "fails if the slave already exists in Jenkins" do
@@ -107,10 +107,10 @@ describe JenkinsApi::Client::Node do
107
107
  :private_key_file => "/root/.ssh/id_rsa"
108
108
  }
109
109
  @valid_post_responses.should include(
110
- @client.node.create_dump_slave(params).to_i
110
+ @client.node.create_dumb_slave(params).to_i
111
111
  )
112
112
  expect(
113
- lambda{ @client.node.create_dump_slave(params) }
113
+ lambda{ @client.node.create_dumb_slave(params) }
114
114
  ).to raise_error(JenkinsApi::Exceptions::NodeAlreadyExists)
115
115
  @valid_post_responses.should include(
116
116
  @client.node.delete(params[:name]).to_i
@@ -126,7 +126,7 @@ describe JenkinsApi::Client::Node do
126
126
  :private_key_file => "/root/.ssh/id_rsa"
127
127
  }
128
128
  @valid_post_responses.should include(
129
- @client.node.create_dump_slave(params).to_i
129
+ @client.node.create_dumb_slave(params).to_i
130
130
  )
131
131
  @valid_post_responses.should include(
132
132
  @client.node.delete(params[:name]).to_i
@@ -30,10 +30,10 @@ describe JenkinsApi::Client::Node do
30
30
  end
31
31
  end
32
32
 
33
- describe "#create_dump_slave" do
34
- it "creates a dump slave by accepting required params" do
33
+ describe "#create_dumb_slave" do
34
+ it "creates a dumb slave by accepting required params" do
35
35
  @client.should_receive(:api_post_request).and_return("302")
36
- @node.create_dump_slave(
36
+ @node.create_dumb_slave(
37
37
  :name => "test_slave",
38
38
  :slave_host => "10.10.10.10",
39
39
  :private_key_file => "/root/.ssh/id_rsa"
@@ -42,7 +42,7 @@ describe JenkinsApi::Client::Node do
42
42
  it "fails if name is not given" do
43
43
  expect(
44
44
  lambda{
45
- @node.create_dump_slave(
45
+ @node.create_dumb_slave(
46
46
  :slave_host => "10.10.10.10",
47
47
  :private_key_file => "/root/.ssh/id_rsa"
48
48
  )
@@ -52,7 +52,7 @@ describe JenkinsApi::Client::Node do
52
52
  it "fails if slave_host is not given" do
53
53
  expect(
54
54
  lambda{
55
- @node.create_dump_slave(
55
+ @node.create_dumb_slave(
56
56
  :name => "test_slave",
57
57
  :private_key_file => "/root/.ssh/id_rsa"
58
58
  )
@@ -62,7 +62,7 @@ describe JenkinsApi::Client::Node do
62
62
  it "fails if private_key_file is not given" do
63
63
  expect(
64
64
  lambda{
65
- @node.create_dump_slave(
65
+ @node.create_dumb_slave(
66
66
  :name => "test_slave",
67
67
  :slave_host => "10.10.10.10"
68
68
  )
@@ -71,6 +71,18 @@ describe JenkinsApi::Client::Node do
71
71
  end
72
72
  end
73
73
 
74
+ describe "#create_dump_slave" do
75
+
76
+ it "just delegates to #create_dumb_slave" do
77
+ @node.should_receive(:create_dumb_slave)
78
+ @node.create_dump_slave(
79
+ :name => "test_slave",
80
+ :slave_host => "10.10.10.10",
81
+ :private_key_file => "/root/.ssh/id_rsa"
82
+ )
83
+ end
84
+
85
+ end
74
86
  describe "#delete" do
75
87
  it "gets the node name and deletes if exists" do
76
88
  slave_name = "slave"
metadata CHANGED
@@ -1,213 +1,187 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jenkins_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta.6
5
- prerelease: 6
4
+ version: 1.0.0.beta.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - Kannan Manickam
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-04-19 00:00:00.000000000 Z
11
+ date: 2014-06-20 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: nokogiri
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: 1.6.0
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
26
  version: 1.6.0
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: thor
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: 0.16.0
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: 0.16.0
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: json
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: terminal-table
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - ">="
68
60
  - !ruby/object:Gem::Version
69
61
  version: 1.4.0
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - ">="
76
67
  - !ruby/object:Gem::Version
77
68
  version: 1.4.0
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: mixlib-shellout
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - ">="
84
74
  - !ruby/object:Gem::Version
85
75
  version: 1.1.0
86
76
  type: :runtime
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - ">="
92
81
  - !ruby/object:Gem::Version
93
82
  version: 1.1.0
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: bundler
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - ">="
100
88
  - !ruby/object:Gem::Version
101
89
  version: '1.0'
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - ">="
108
95
  - !ruby/object:Gem::Version
109
96
  version: '1.0'
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: jeweler
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ! '>='
101
+ - - ">="
116
102
  - !ruby/object:Gem::Version
117
103
  version: 1.6.4
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ! '>='
108
+ - - ">="
124
109
  - !ruby/object:Gem::Version
125
110
  version: 1.6.4
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: rspec
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
- - - ~>
115
+ - - "~>"
132
116
  - !ruby/object:Gem::Version
133
117
  version: 2.14.1
134
118
  type: :development
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
- - - ~>
122
+ - - "~>"
140
123
  - !ruby/object:Gem::Version
141
124
  version: 2.14.1
142
125
  - !ruby/object:Gem::Dependency
143
126
  name: simplecov
144
127
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
128
  requirements:
147
- - - ! '>='
129
+ - - ">="
148
130
  - !ruby/object:Gem::Version
149
131
  version: '0'
150
132
  type: :development
151
133
  prerelease: false
152
134
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
135
  requirements:
155
- - - ! '>='
136
+ - - ">="
156
137
  - !ruby/object:Gem::Version
157
138
  version: '0'
158
139
  - !ruby/object:Gem::Dependency
159
140
  name: yard-thor
160
141
  requirement: !ruby/object:Gem::Requirement
161
- none: false
162
142
  requirements:
163
- - - ! '>='
143
+ - - ">="
164
144
  - !ruby/object:Gem::Version
165
145
  version: '0'
166
146
  type: :development
167
147
  prerelease: false
168
148
  version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
149
  requirements:
171
- - - ! '>='
150
+ - - ">="
172
151
  - !ruby/object:Gem::Version
173
152
  version: '0'
174
153
  - !ruby/object:Gem::Dependency
175
154
  name: yard
176
155
  requirement: !ruby/object:Gem::Requirement
177
- none: false
178
156
  requirements:
179
- - - ! '>='
157
+ - - ">="
180
158
  - !ruby/object:Gem::Version
181
159
  version: '0'
182
160
  type: :development
183
161
  prerelease: false
184
162
  version_requirements: !ruby/object:Gem::Requirement
185
- none: false
186
163
  requirements:
187
- - - ! '>='
164
+ - - ">="
188
165
  - !ruby/object:Gem::Version
189
166
  version: '0'
190
167
  - !ruby/object:Gem::Dependency
191
168
  name: pry
192
169
  requirement: !ruby/object:Gem::Requirement
193
- none: false
194
170
  requirements:
195
- - - ! '>='
171
+ - - ">="
196
172
  - !ruby/object:Gem::Version
197
173
  version: '0'
198
174
  type: :development
199
175
  prerelease: false
200
176
  version_requirements: !ruby/object:Gem::Requirement
201
- none: false
202
177
  requirements:
203
- - - ! '>='
178
+ - - ">="
204
179
  - !ruby/object:Gem::Version
205
180
  version: '0'
206
- description: ! '
181
+ description: |2-
207
182
 
208
183
  This is a simple and easy-to-use Jenkins Api client with features focused on
209
-
210
- automating Job configuration programaticaly and so forth'
184
+ automating Job configuration programaticaly and so forth
211
185
  email:
212
186
  - arangamani.kannan@gmail.com
213
187
  executables:
@@ -215,9 +189,9 @@ executables:
215
189
  extensions: []
216
190
  extra_rdoc_files: []
217
191
  files:
218
- - .gitignore
219
- - .jenkins.yml
220
- - .travis.yml
192
+ - ".gitignore"
193
+ - ".jenkins.yml"
194
+ - ".travis.yml"
221
195
  - CHANGELOG.md
222
196
  - CONTRIBUTORS.md
223
197
  - Gemfile
@@ -281,26 +255,25 @@ files:
281
255
  - travis/user_config.xml
282
256
  homepage: https://github.com/arangamani/jenkins_api_client
283
257
  licenses: []
258
+ metadata: {}
284
259
  post_install_message:
285
260
  rdoc_options: []
286
261
  require_paths:
287
262
  - lib
288
263
  required_ruby_version: !ruby/object:Gem::Requirement
289
- none: false
290
264
  requirements:
291
- - - ! '>='
265
+ - - ">="
292
266
  - !ruby/object:Gem::Version
293
267
  version: 1.9.2
294
268
  required_rubygems_version: !ruby/object:Gem::Requirement
295
- none: false
296
269
  requirements:
297
- - - ! '>'
270
+ - - ">"
298
271
  - !ruby/object:Gem::Version
299
272
  version: 1.3.1
300
273
  requirements: []
301
274
  rubyforge_project:
302
- rubygems_version: 1.8.23
275
+ rubygems_version: 2.2.2
303
276
  signing_key:
304
- specification_version: 3
277
+ specification_version: 4
305
278
  summary: Jenkins JSON API Client
306
279
  test_files: []