master_delivery 1.0.3 → 1.0.4

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
  SHA256:
3
- metadata.gz: 4fd9a6ebb7e41f0328c46e274a36d8a0baf7e4b1549e0f88865bfcdae47462ec
4
- data.tar.gz: 23dff41dd71f145e7bf5f3b835e049080d6ce210784b859a301f7c40aed1af2e
3
+ metadata.gz: c96b7a6e293146f06482ae8ee3f286b970ba9c0410697ed5634d2bacb4efc907
4
+ data.tar.gz: ab74ed9c5b3498778d26bae2fc9a8eaab8c4075bd9b124293bd9213a439db9bc
5
5
  SHA512:
6
- metadata.gz: 2b486c93913a8b1c7a572eb5fae14fb394a9ea94f4da36ffccf3fe0acdaeee70adef7addafbfa856b35e7eb22d5030308c6413e34a1caf88ecf584944151866c
7
- data.tar.gz: 8155f6027b8af3e52ed1728f71dfc7a91d46f1e1e48f1fe8f47cef92a484db116b038dbf1cdf81d57de161019a260155580134f73f4168d7aad62c64e0d0abad
6
+ metadata.gz: 714ee4ae4fc50a90e93ba853262b9aa3a197134c6b649fdc3815854c70db39b84e14faef62982c29c7767787de95927697613fadd45afbb1e35385039b8db1dc
7
+ data.tar.gz: c5b463336afde3099108678a7235d4f6242b6cc5374b4c365716a724424b4deb967a5c5c5e492e64d1f9828729a376d0e3c6a5582ab9f5c187bc2e41ac5a571a
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [v1.0.4](https://github.com/shinyaohtani/master_delivery/tree/v1.0.4) (2020-04-28)
4
+
5
+ [Full Changelog](https://github.com/shinyaohtani/master_delivery/compare/v1.0.3...v1.0.4)
6
+
7
+ - fixed: skip confirmation option didn't work
8
+
9
+ **Fixed bugs:**
10
+
11
+ - skip\_confirmation does not work on v1.0.3 [\#15](https://github.com/shinyaohtani/master_delivery/issues/15)
12
+
13
+ **Merged pull requests:**
14
+
15
+ - fixed skip confirmation option [\#16](https://github.com/shinyaohtani/master_delivery/pull/16) ([shinyaohtani](https://github.com/shinyaohtani))
16
+
3
17
  ## [v1.0.3](https://github.com/shinyaohtani/master_delivery/tree/v1.0.3) (2020-04-28)
4
18
 
5
19
  [Full Changelog](https://github.com/shinyaohtani/master_delivery/compare/v1.0.2...v1.0.3)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- master_delivery (1.0.3)
4
+ master_delivery (1.0.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -90,9 +90,9 @@ module MasterDelivery
90
90
  master_dir = File.expand_path(@params[:master])
91
91
  md = MasterDelivery.new(File.dirname(master_dir), @params[:backup])
92
92
  arg_set = [File.basename(master_dir), @params[:delivery]]
93
- return unless md.confirm(*arg_set, **(@params.slice(:type, :quiet, :dryrun, :skip_conf)))
93
+ return unless md.confirm(*arg_set, @params.slice(:type, :quiet, :dryrun, :yes))
94
94
 
95
- md.deliver(*arg_set, **(@params.slice(:type, :dryrun)))
95
+ md.deliver(*arg_set, **@params.slice(:type, :dryrun))
96
96
  puts 'done!' unless @params[:quiet]
97
97
  end
98
98
 
@@ -69,16 +69,15 @@ module MasterDelivery
69
69
  backup_dir
70
70
  end
71
71
 
72
- def confirm(master_id, target_prefix,
73
- type: :symbolic_link, dryrun: false, skip_conf: false, quiet: false)
74
-
75
- unless quiet
76
- puts MSG_CONFIRMATION_INTRO unless skip_conf
77
- print_params(master_id, target_prefix, type: type, dryrun: dryrun)
72
+ # @param params [Hash] :type, :dryrun, :yes, :quiet
73
+ def confirm(master_id, target_prefix, params)
74
+ unless params[:quiet]
75
+ puts MSG_CONFIRMATION_INTRO unless params[:yes]
76
+ print_params(master_id, target_prefix, params.slice(:type, :dryrun))
78
77
  print_sample(master_id, target_prefix)
79
78
  end
80
- print MSG_CONFIRMATION.chomp unless skip_conf # use print instead of puts for '\n'
81
- return true if skip_conf || gets.chomp == 'y'
79
+ print MSG_CONFIRMATION.chomp unless params[:yes] # use print instead of puts for '\n'
80
+ return true if params[:yes] || gets.chomp == 'y'
82
81
 
83
82
  puts 'aborted.'
84
83
  false
@@ -107,13 +106,14 @@ module MasterDelivery
107
106
  end
108
107
  end
109
108
 
110
- def print_params(master_id, target_prefix, type:, dryrun:)
109
+ # @param params [Hash] :type, :dryrun
110
+ def print_params(master_id, target_prefix, params)
111
111
  mfiles = master_files(master_id)
112
112
  msg = "(-m) MASTER_DIR: -m #{@master_root}/#{master_id} (#{mfiles.size} master files)\n"
113
113
  msg += "(-d) DELIVER_ROOT: -d #{File.expand_path(target_prefix)}\n"
114
- msg += "(-t) DELIVER_TYPE: -t #{type}\n"
114
+ msg += "(-t) DELIVER_TYPE: -t #{params[:type]}\n"
115
115
  msg += "(-b) BACKUP_ROOT: -b #{@backup_root}\n"
116
- msg += "(-D) DRYRUN: #{dryrun ? '--dryrun' : '--no-dryrun'}\n"
116
+ msg += "(-D) DRYRUN: #{params[:dryrun] ? '--dryrun' : '--no-dryrun'}\n"
117
117
  puts msg
118
118
  end
119
119
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MasterDelivery
4
- VERSION = '1.0.3'
4
+ VERSION = '1.0.4'
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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: master_delivery
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shinya Ohtani (shinyaohtani@github)