jendle 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89fd8cf54396d4d720edd88a0b9396490e2ba2b0
4
- data.tar.gz: b033402fb104f7ceb75f23ac02e270c69de6ae62
3
+ metadata.gz: 70997ad42584de85e79a966ac979af0362572615
4
+ data.tar.gz: 73b59410f85ef1eee27239a34bac441e5d7e7985
5
5
  SHA512:
6
- metadata.gz: b157289db77f951f7970a72503bd474ae696995820a83c315c958e4f091e56b75e6a30357cdb37d04b6fb2ff69699907899bb439dc1017a6cc234cb7e2028e10
7
- data.tar.gz: 07130a3a284d3312a0a2b3bb3e5180f07800de662733837cb42e1d33ded97b8585e75e1d9d0cb424ae9ec0af8c229d042f89240615108fcc480e78e685bc6943
6
+ metadata.gz: 3399e622bfab4ee419a04abee64a73d4b1bdc665ad62179d0610230c87aaa17b724d6b5b97af4aff24f8daae907b18d38b8723ee43b6f43bd9062883b20999d9
7
+ data.tar.gz: e8200e685d92f0042837390f550c3c1ae848d0b68fc1f21fa94ee346ee34bc205fed41c5c83324faa1f4c3d7247bdf2a17110d08a8c3427508fec851a7eb95b9
data/lib/jendle.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'jendle/version'
2
2
  require 'jendle/constants'
3
3
  require 'jendle/core'
4
+ require 'jendle/base'
4
5
  require 'jendle/job'
5
6
  require 'jendle/view'
6
7
  require 'jendle/plugin'
@@ -0,0 +1,11 @@
1
+ module Jendle
2
+ class Base
3
+
4
+ def initialize(core)
5
+ @core = core
6
+ @client = core.client
7
+ @logger = core.logger
8
+ end
9
+
10
+ end
11
+ end
data/lib/jendle/cli.rb CHANGED
@@ -12,10 +12,10 @@ module Jendle
12
12
  super(args, options, config)
13
13
  @global_options = config[:shell].base.options
14
14
  config = get_config(@global_options[:profile])
15
- core = Core.new(config)
16
- @job = Job.new(core)
17
- @view = View.new(core)
18
- @plugin = Plugin.new(core)
15
+ @core = Core.new(config)
16
+ @job = Job.new(@core)
17
+ @view = View.new(@core)
18
+ @plugin = Plugin.new(@core)
19
19
  end
20
20
 
21
21
  desc 'export', 'export'
@@ -102,6 +102,11 @@ module Jendle
102
102
  @view.restore(options, get_config(options[:source_profile]))
103
103
  end
104
104
 
105
+ desc 'restart', 'restart'
106
+ def restart
107
+ @core.restart
108
+ end
109
+
105
110
  desc 'version', 'show version'
106
111
  def version
107
112
  puts VERSION
data/lib/jendle/core.rb CHANGED
@@ -21,5 +21,9 @@ module Jendle
21
21
  params[:password] = password if password
22
22
  @client = JenkinsApi::Client.new(params)
23
23
  end
24
+
25
+ def restart
26
+ @client.system.restart(true)
27
+ end
24
28
  end
25
29
  end
data/lib/jendle/job.rb CHANGED
@@ -1,11 +1,5 @@
1
1
  module Jendle
2
- class Job
3
-
4
- def initialize(core)
5
- @core = core
6
- @client = core.client
7
- @logger = core.logger
8
- end
2
+ class Job < Base
9
3
 
10
4
  def restore(options, source_config)
11
5
  source_client = @core.get_client(
data/lib/jendle/plugin.rb CHANGED
@@ -1,11 +1,5 @@
1
1
  module Jendle
2
- class Plugin
3
-
4
- def initialize(core)
5
- @core = core
6
- @client = core.client
7
- @logger = core.logger
8
- end
2
+ class Plugin < Base
9
3
 
10
4
  def restore(options, source_config)
11
5
  source_client = @core.get_client(
@@ -1,4 +1,4 @@
1
1
  module Jendle
2
2
  # jendle version
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
data/lib/jendle/view.rb CHANGED
@@ -1,11 +1,5 @@
1
1
  module Jendle
2
- class View
3
-
4
- def initialize(core)
5
- @core = core
6
- @client = core.client
7
- @logger = core.logger
8
- end
2
+ class View < Base
9
3
 
10
4
  def restore(options, source_config)
11
5
  source_client = @core.get_client(
@@ -13,7 +7,7 @@ module Jendle
13
7
  source_config['username'],
14
8
  source_config['password']
15
9
  )
16
- get_config_pairs(source_client).each do |job_name, xml|
10
+ get_config_pairs(source_client).each do |view_name, xml|
17
11
  apply_proc(job_name, xml, options[:'dry-run'])
18
12
  end
19
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jendle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - toyama0919
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-22 00:00:00.000000000 Z
11
+ date: 2017-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -170,6 +170,7 @@ files:
170
170
  - bin/jendle
171
171
  - jendle.gemspec
172
172
  - lib/jendle.rb
173
+ - lib/jendle/base.rb
173
174
  - lib/jendle/cli.rb
174
175
  - lib/jendle/constants.rb
175
176
  - lib/jendle/core.rb