jendle 0.1.1 → 0.1.2

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: 70997ad42584de85e79a966ac979af0362572615
4
- data.tar.gz: 73b59410f85ef1eee27239a34bac441e5d7e7985
3
+ metadata.gz: 8558843a07a6ac216a4fa5ef18672857005f7be0
4
+ data.tar.gz: be50360e7a9da12a7ffa8ec98721a8767c6cd2e1
5
5
  SHA512:
6
- metadata.gz: 3399e622bfab4ee419a04abee64a73d4b1bdc665ad62179d0610230c87aaa17b724d6b5b97af4aff24f8daae907b18d38b8723ee43b6f43bd9062883b20999d9
7
- data.tar.gz: e8200e685d92f0042837390f550c3c1ae848d0b68fc1f21fa94ee346ee34bc205fed41c5c83324faa1f4c3d7247bdf2a17110d08a8c3427508fec851a7eb95b9
6
+ metadata.gz: 326744758578b85f3d73ffb41c951706b8d3091621d2f1721be5dfabbdbd9bbca34519b3372e5365fd88621c5569cab82004c0025cdfd9ea1e85204f50eeb38f
7
+ data.tar.gz: 24f8e2f08bc22e673ec227dd65d7ca0d0bfec641ed68b9962cd269a3cc1d74222fb8091b1c446e3e782fc9f2bfb90feade009529fb039690ba798828385a4a81
@@ -78,8 +78,9 @@ module Jendle
78
78
  desc 'restore_jobs', 'restore_jobs'
79
79
  option :source_profile, type: :string, required: true, desc: 'file'
80
80
  option :'dry-run', aliases: '-d', type: :boolean, default: false, desc: 'dry-run'
81
+ option :job_name, aliases: '-j', type: :string, desc: 'job_name'
81
82
  def restore_jobs
82
- @job.restore(options, get_config(options[:source_profile]))
83
+ @job.restore(options, get_config(options[:source_profile]), options[:job_name])
83
84
  end
84
85
 
85
86
  desc 'export_views', 'export_views'
@@ -107,6 +108,11 @@ module Jendle
107
108
  @core.restart
108
109
  end
109
110
 
111
+ desc 'delete_jobs', 'delete_jobs'
112
+ def delete_jobs
113
+ @job.delete_jobs(options)
114
+ end
115
+
110
116
  desc 'version', 'show version'
111
117
  def version
112
118
  puts VERSION
@@ -23,7 +23,9 @@ module Jendle
23
23
  end
24
24
 
25
25
  def restart
26
- @client.system.restart(true)
26
+ if @client.plugin.restart_required?
27
+ @client.system.restart
28
+ end
27
29
  end
28
30
  end
29
31
  end
@@ -1,14 +1,22 @@
1
1
  module Jendle
2
2
  class Job < Base
3
3
 
4
- def restore(options, source_config)
4
+ def delete_jobs(options)
5
+ get_config_pairs.keys.each do |job_name|
6
+ @client.job.delete(job_name)
7
+ end
8
+ end
9
+
10
+ def restore(options, source_config, apply_job_name = nil)
5
11
  source_client = @core.get_client(
6
12
  source_config['server_ip'],
7
13
  source_config['username'],
8
14
  source_config['password']
9
15
  )
10
16
  get_config_pairs(source_client).each do |job_name, xml|
11
- apply_proc(job_name, xml, options[:'dry-run'])
17
+ if (job_name == apply_job_name) || apply_job_name.nil?
18
+ apply_proc(job_name, xml, options[:'dry-run'])
19
+ end
12
20
  end
13
21
  end
14
22
 
@@ -11,7 +11,7 @@ module Jendle
11
11
  plugins.each do |k, v|
12
12
  apply_proc(k)
13
13
  end
14
- restart
14
+ @core.restart
15
15
  end
16
16
 
17
17
  def export(options)
@@ -29,7 +29,7 @@ module Jendle
29
29
  plugin = plugin.strip
30
30
  apply_proc(plugin)
31
31
  end
32
- restart
32
+ @core.restart
33
33
  end
34
34
 
35
35
  def apply_proc(plugin)
@@ -40,12 +40,5 @@ module Jendle
40
40
  @logger.info("already installed #{plugin}")
41
41
  end
42
42
  end
43
-
44
- def restart
45
- if @client.plugin.restart_required?
46
- @logger.info("restarting...")
47
- @client.system.restart(true)
48
- end
49
- end
50
43
  end
51
44
  end
@@ -1,4 +1,4 @@
1
1
  module Jendle
2
2
  # jendle version
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  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.1
4
+ version: 0.1.2
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-24 00:00:00.000000000 Z
11
+ date: 2017-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor