master_delivery 1.0.1 → 1.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd9ff051619b6dac6107d7668710401371bdf30c1de87d8e9ab276a5068f60ad
4
- data.tar.gz: d8fd9a7aeea81fc837894991f8f174d1fb9bfd178fab84a0a7dd4fe4a5ba3093
3
+ metadata.gz: 5aba61c0ea3104a071ce2c5987a4b7b0319cc87b1a64b3352c8e2b07551bc063
4
+ data.tar.gz: daa1a7f63bae834f2539d2ba1ff5bf0b9987449b758fedd18c6e6aab6aa3a738
5
5
  SHA512:
6
- metadata.gz: 870094f61f466eb9537b7981409c473214d79a952b8fee335ca4f29eeecee458bbeba261396ce082c4604c2aeb660e53f3f3fa2670e39b9cab7e5520aea029f2
7
- data.tar.gz: 7f9db3fbd3e9df232868fc1c9c65bf2436a98a0fcda152071e03f7eefb69c72e3795b590109ed9f94e26fe476bfa2428349830b920f39d7334cc2d476eb2093e
6
+ metadata.gz: ace2378bde5c4f0d6e3fd70e1c301580d46892464fade2337959b326c82d7aa84cc931c0bc82f23eda231a8f7dcc621b18791d5a83ab345f2ac8bfb189c74daf
7
+ data.tar.gz: 509200607c8e606886795d02e7327b913cea049efcb8d698c2d5eed1eac3f30f06a24fc714e9d901e1a6f876a200b2ded7d3465fb068c15eb00a80cc0dc3a398
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [v1.0.2](https://github.com/shinyaohtani/master_delivery/tree/v1.0.2) (2020-04-27)
4
+
5
+ [Full Changelog](https://github.com/shinyaohtani/master_delivery/compare/v1.0.1...v1.0.2)
6
+
7
+ - Confirmation skipping option '--yes' was implemented
8
+
9
+ **Implemented enhancements:**
10
+
11
+ - Option to skip confirmation [\#3](https://github.com/shinyaohtani/master_delivery/issues/3)
12
+
13
+ **Merged pull requests:**
14
+
15
+ - v1.0.2 release [\#8](https://github.com/shinyaohtani/master_delivery/pull/8) ([shinyaohtani](https://github.com/shinyaohtani))
16
+ - implemented skip-confirmation option [\#6](https://github.com/shinyaohtani/master_delivery/pull/6) ([shinyaohtani](https://github.com/shinyaohtani))
17
+
3
18
  ## [v1.0.1](https://github.com/shinyaohtani/master_delivery/tree/v1.0.1) (2020-04-25)
4
19
 
5
20
  [Full Changelog](https://github.com/shinyaohtani/master_delivery/compare/4b0351ffd3cc1c8ddfeb76d39e2bddd0b8baa5a8...v1.0.1)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- master_delivery (1.0.1)
4
+ master_delivery (1.0.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -39,6 +39,17 @@ module MasterDelivery
39
39
  We strongly recommend "--dryrun" before running.
40
40
  (default: --no-dryrun)
41
41
  DRYRUN
42
+ DESC_SKIP_CONF = <<~SKIP_CONF
43
+ Skip confirmation. It is recommended to execute
44
+ the command carefully without skipping confirmation.
45
+ With the "--yes" option, if you want to change the
46
+ command line argument even a little, remove the
47
+ "--yes" option once, execute it several times,
48
+ and experience confirmation several times.
49
+ Also, it's a good idea to add the "--yes" option
50
+ only after you start to feel confirmation annoying.
51
+ (default: --no-yes)
52
+ SKIP_CONF
42
53
  DESC_EXAMPLE = <<~EXAMPLE
43
54
  Example:
44
55
  If you specify MASTER_DIR and DELIVERY_ROOT as follows:
@@ -70,16 +81,13 @@ module MasterDelivery
70
81
  end
71
82
 
72
83
  def run
73
- unless check_param_consistency
74
- puts 'See more with --help option'
75
- return
76
- end
84
+ return unless check_param_consistency
85
+
77
86
  master_dir = File.expand_path(@params[:master])
78
- master_id = File.basename(master_dir)
79
87
  md = MasterDelivery.new(File.dirname(master_dir), @params[:backup])
80
- arg_set = [master_id, @params[:delivery]]
88
+ arg_set = [File.basename(master_dir), @params[:delivery]]
81
89
  arg_hash = { type: @params[:type], dryrun: @params[:dryrun] }
82
- return unless md.confirm(*arg_set, **arg_hash)
90
+ return unless md.confirm(*arg_set, skip_conf: @params[:yes], **arg_hash)
83
91
 
84
92
  md.deliver(*arg_set, **arg_hash)
85
93
  puts 'done!'
@@ -97,6 +105,7 @@ module MasterDelivery
97
105
  opts.on('-t [DELIVERY_TYPE]', '--type [DELIVERY_TYPE]', *DESC_DELIVERY_TYPE.split(/\R/), &:to_sym)
98
106
  opts.on('-b [BACKUP_ROOT]', '--backup [BACKUP_ROOT]', *DESC_BACKUP_ROOT.split(/\R/)) { |v| v }
99
107
  opts.on('-D', '--[no-]dryrun', *DESC_DRYRUN.split(/\R/)) { |v| v }
108
+ opts.on('-y', '--[no-]yes', *DESC_SKIP_CONF.split(/\R/)) { |v| v }
100
109
  opts.separator ''
101
110
  opts.separator ' Common options:'
102
111
  # opts.on('-v', '--verbose', 'Verbose mode. default: no') { |v| v }
@@ -119,11 +128,14 @@ module MasterDelivery
119
128
  end
120
129
 
121
130
  def check_param_consistency
122
- check_param_master &&
123
- check_param_delivery &&
124
- check_param_backup &&
125
- check_param_type &&
126
- check_param_argv
131
+ return true if check_param_master &&
132
+ check_param_delivery &&
133
+ check_param_backup &&
134
+ check_param_type &&
135
+ check_param_argv
136
+
137
+ puts 'See more with --help option'
138
+ false
127
139
  end
128
140
 
129
141
  def check_param_master
@@ -69,13 +69,13 @@ module MasterDelivery
69
69
  backup_dir
70
70
  end
71
71
 
72
- def confirm(master_id, target_prefix, type: :symbolic_link, dryrun: false)
73
- puts MSG_CONFIRMATION_INTRO
72
+ def confirm(master_id, target_prefix, type: :symbolic_link, dryrun: false, skip_conf: false)
73
+ puts MSG_CONFIRMATION_INTRO unless skip_conf
74
74
 
75
75
  print_params(master_id, target_prefix, type: type, dryrun: dryrun)
76
76
  print_sample(master_id, target_prefix)
77
- print MSG_CONFIRMATION.chomp # use print instead of puts for '\n'
78
- return true if gets.chomp == 'y'
77
+ print MSG_CONFIRMATION.chomp unless skip_conf # use print instead of puts for '\n'
78
+ return true if skip_conf || gets.chomp == 'y'
79
79
 
80
80
  false
81
81
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MasterDelivery
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.2'
5
5
  DESCRIPTION = <<~DESC
6
6
  Deliver all master files managed in a single master snapshot directory
7
7
  into the specified directory while maintaining the hierarchy of the
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: master_delivery
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shinya Ohtani (shinyaohtani@github)
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-25 00:00:00.000000000 Z
11
+ date: 2020-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler