jenkins2-api 0.0.3 → 0.0.4
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 +4 -4
- data/bin/jenkins2api +0 -4
- data/lib/thor_command.rb +17 -0
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7eb76b2bdbafd2f5da9449216617fd0062b6746
|
4
|
+
data.tar.gz: 50e53aea68612f51de778aae45ad74a8b5e1cfd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb59e1fa20bfbab019d565f2315e7d3e7a76e3510aa60f91b2c48073184c2bb2602b1510a8f02ce88e29763134ef692a26320847de26c63a31a9535364ccb421
|
7
|
+
data.tar.gz: 955db60ea8460395f12b39bded5137e8c4674162fa05237d27e0baeaf3e737d353731e35fbaf7d70b79ee20e129eac59777d4fb11cb73ab031b3e4d97befe88f
|
data/bin/jenkins2api
CHANGED
@@ -6,10 +6,6 @@ require 'jenkins2-api'
|
|
6
6
|
module Jenkins2API
|
7
7
|
module CLI
|
8
8
|
class Jenkins2 < Thor
|
9
|
-
class_option :password, :desc => "Password", :aliases => "-p", :required => true
|
10
|
-
class_option :username, :desc => "Username", :aliases => "-u", :required => true
|
11
|
-
class_option :server, :desc => "Server path", :aliases => "-s", :required => true
|
12
|
-
|
13
9
|
map %w[--version -v] => :__print_version
|
14
10
|
|
15
11
|
desc "--version, -v", "print the version"
|
data/lib/thor_command.rb
CHANGED
@@ -2,14 +2,31 @@ require 'thor'
|
|
2
2
|
|
3
3
|
module Jenkins2API
|
4
4
|
class ThorCommand < Thor
|
5
|
+
class_option :password, :desc => "Password", :aliases => "-p", :required => false
|
6
|
+
class_option :username, :desc => "Username", :aliases => "-u", :required => false
|
7
|
+
class_option :server, :desc => "Server path", :aliases => "-s", :required => false
|
5
8
|
|
6
9
|
private
|
7
10
|
def client
|
11
|
+
check_option(:server, 'JENKINS_SERVER')
|
12
|
+
check_option(:username, 'JENKINS_USERNAME')
|
13
|
+
check_option(:password, 'JENKINS_PASSWORD')
|
14
|
+
|
8
15
|
@client ||= Jenkins2API::Client.new(
|
9
16
|
:server => options[:server],
|
10
17
|
:username => options[:username],
|
11
18
|
:password => options[:password]
|
12
19
|
)
|
13
20
|
end
|
21
|
+
|
22
|
+
def check_option(name, env_name)
|
23
|
+
options[name] ||= ENV.fetch(env_name, '')
|
24
|
+
|
25
|
+
unless options.has_key?(name.to_s) && options[name] != ''
|
26
|
+
fail Thor::Error, "#{name} is not defined. " \
|
27
|
+
"You can specify with --#{name} option " \
|
28
|
+
"or '#{env_name}' environment variable."
|
29
|
+
end
|
30
|
+
end
|
14
31
|
end
|
15
32
|
end
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jenkins2-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Balazs Nadasdi
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.19'
|
27
|
-
description: API client for Jenkins 2
|
27
|
+
description: API client for Jenkins 2 with executable
|
28
28
|
email: balazs.nadasdi@cheppers.com
|
29
29
|
executables:
|
30
30
|
- jenkins2api
|