muwu 3.0.0.beta2 → 3.0.0.beta4

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: 004b5b4bcff5064b7e92494afb02f04b34947f44d139c92bb9ad329d4ca5abfb
4
- data.tar.gz: 2f1e3a3d6c973488921ed9904b1afdd698a251b21ec88639a514960e32f5955b
3
+ metadata.gz: 0a763a6ef4bc3f58893ea96ce27730e5bfc906b4fcc64aa587421413b8cc9e55
4
+ data.tar.gz: be89ad33637f0d913fa990f8b997672be8a5d1d775411225a2db8e7dbbec1651
5
5
  SHA512:
6
- metadata.gz: e2ad7a17cbbf04131c7a2377d032df0e0def82349b7dcb64ec07e79846f500fb792c3452882235acf8a34b7be91f75a7ab617e41e3c0c2fbc681e5c88875a31b
7
- data.tar.gz: e3da5b0145e28f1bf7a944900e11c5f33b6b5f9c40739f72557154ce90221ed457a9474cf230da6ba0b7caa7176009227e044e2509d39ab2401c17001cf42bf3
6
+ metadata.gz: 7583d200eccf408768f7f19c58a20ce453c97f562663daa3afd2336015ee3863c7784a5a8a59bac3d948c35d866a4d790df9c65630288dfbefb8c1c38fce89c8
7
+ data.tar.gz: 2b54db763ffcd73e063a01887b31240bf7db6e60bf9e98d0224fe48f1bce99f91f2b86f76c2c92ccb2f9374a5eacd29951000a8cb47346d00b9f2bbd0edae618
data/lib/muwu.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Muwu
2
2
 
3
3
 
4
- VERSION = '3.0.0.beta2'
4
+ VERSION = '3.0.0.beta4'
5
5
 
6
6
  GEM_HOME_LIB = File.absolute_path(File.join(File.dirname(__FILE__)))
7
7
  GEM_HOME_LIB_MUWU = File.absolute_path(File.join(GEM_HOME_LIB, 'muwu'))
@@ -2,8 +2,19 @@
2
2
  - Publishes compiled documents currently in `compiled/` to a remote location
3
3
  using rsync. Rsync must be installed on the local system.
4
4
 
5
- - [options]
6
- - dry-run: invoke the rsync '-n' switch to show which files will be
7
- transferred, but do not actually transfer any files.
5
+ - [options]
6
+ - Muwu will pass any further command-line arguments to rsync. See the rsync
7
+ man page for more information about valid rsync options.
8
+
9
+ - Other useful options: (verify against the rsync man page before using)
10
+ --delete Delete files from the target host that aren't present on the
11
+ source host.
12
+ --dry-run Show which changes would be made, but don't perform them.
13
+ --update Only update the files on the target host that have older
14
+ timestamps than on the source; do not change files on the
15
+ target host that have newer timestamps.
16
+
17
+ * [options] for rsync can also be specified in 'options.yml' using the
18
+ 'rsync_options' value.
8
19
 
9
20
  * Specify the remote host in 'options.yml' using the 'remote_publish' value.
@@ -12,11 +12,6 @@
12
12
  - Muwu will pass any further command-line arguments to rsync. See the rsync
13
13
  man page for more information about valid rsync options.
14
14
 
15
- - Muwu will automatically include the following options:
16
- --itemize-changes
17
- --recursive
18
- --verbose
19
-
20
15
  - Other useful options: (verify against the rsync man page before using)
21
16
  --delete Delete files from the target host that aren't present on the
22
17
  source host.
@@ -25,4 +20,7 @@
25
20
  timestamps than on the source; do not change files on the
26
21
  target host that have newer timestamps.
27
22
 
23
+ * [options] for rsync can also be specified in 'options.yml' using the
24
+ 'rsync_options' value.
25
+
28
26
  * Specify the remote host in 'options.yml' using the 'remote_sync' value.
@@ -44,6 +44,7 @@ module Muwu
44
44
  render_section_numbers: true,
45
45
  render_sections_distinctly_depth_max: nil,
46
46
  render_title_section_metadata: ['title', 'subtitle', 'author'],
47
+ rsync_options: '--itemize-changes --recursive --verbose',
47
48
  warning_if_parent_heading_lacks_source: true
48
49
  }
49
50
 
@@ -25,6 +25,7 @@ module Muwu
25
25
  :render_section_numbers,
26
26
  :render_sections_distinctly_depth_max,
27
27
  :render_title_section_metadata,
28
+ :rsync_options,
28
29
  :warning_if_parent_heading_lacks_source
29
30
  )
30
31
 
@@ -308,6 +308,11 @@ module Muwu
308
308
  end
309
309
 
310
310
 
311
+ def validate_option_rsync_options
312
+ return value_provided_as_array
313
+ end
314
+
315
+
311
316
  def validate_option_warning_if_parent_heading_lacks_source
312
317
  return validate_option_boolean
313
318
  end
@@ -6,38 +6,13 @@ module Muwu
6
6
 
7
7
 
8
8
  def initialize(project, args: [])
9
- # @documents_css = project.manifest.documents_css
10
- # @documents_html = project.manifest.documents_html
11
- # @documents_js = project.manifest.documents_js
12
- # @path_local = project.path_compiled
13
- # @path_remote = project.options.remote_publish
14
9
  @path_local = project.path_compiled + File::SEPARATOR
15
10
  @path_remote = project.options.remote_publish
16
11
  @project = project
17
-
18
- switches = ['i','r','v']
19
- @args = args.map { |a| a.to_s.downcase }
20
- if @args.include?('dry-run')
21
- @dry_run = true
22
- switches << 'n'
23
- end
24
- @switches = switches.sort.join
12
+ @switches = args.push(project.options.rsync_options).sort.join(' ')
25
13
  end
26
14
 
27
15
 
28
- # def up
29
- # if @project.exceptions_include?(ProjectException::OptionRemotePublishValueNil)
30
- # raise ProjectExceptionHandler::Fatal.new(ProjectException::OptionRemotePublishValueNil.new)
31
- # else
32
- # filenames = []
33
- # filenames << @documents_css.map { |d| d.destination.filename }
34
- # filenames << @documents_html.map { |d| d.destination.filename }
35
- # filenames << @documents_js.map { |d| d.destination.filename }
36
- # filenames.flatten.each { |f| scp f }
37
- # end
38
- # end
39
-
40
-
41
16
  def up
42
17
  if @project.exceptions_include?(ProjectException::OptionRemotePublishValueNil)
43
18
  raise ProjectExceptionHandler::Fatal.new(ProjectException::OptionRemotePublishValueNil.new)
@@ -56,9 +31,9 @@ module Muwu
56
31
  puts "source: #{source.inspect}"
57
32
  puts "target: #{target.inspect}"
58
33
  puts "args: #{@args}"
59
- puts "switches: -#{@switches}"
34
+ puts "switches: #{@switches}"
60
35
  begin
61
- system "rsync -#{@switches} #{source} #{target}", exception: true
36
+ system "rsync #{@switches} #{source} #{target}", exception: true
62
37
  rescue Errno::ENOENT
63
38
  raise ProjectExceptionHandler::Fatal.new(ProjectException::RsyncNotAvailable.new)
64
39
  end
@@ -66,6 +41,16 @@ module Muwu
66
41
  end
67
42
 
68
43
 
44
+ def exec_rsync_demo(source: nil, target: nil)
45
+ if source && target
46
+ puts "** demo rsync"
47
+ puts "source: #{source.inspect}"
48
+ puts "target: #{target.inspect}"
49
+ puts "switches: #{@switches}"
50
+ puts "command: rsync #{@switches} #{source} #{target}"
51
+ end
52
+ end
53
+
69
54
 
70
55
  # def scp(filename)
71
56
  # filename_local = File.join(@path_local, filename)
@@ -78,6 +63,5 @@ module Muwu
78
63
  # end
79
64
 
80
65
 
81
-
82
66
  end
83
67
  end
@@ -9,7 +9,7 @@ module Muwu
9
9
  @path_local = project.working_directory + File::SEPARATOR
10
10
  @path_remote = project.options.remote_sync
11
11
  @project = project
12
- @switches = args.push('--itemize-changes', '--recursive', '--verbose').sort.join(' ')
12
+ @switches = args.push(project.options.rsync_options).sort.join(' ')
13
13
  end
14
14
 
15
15
 
@@ -60,9 +60,10 @@ module Muwu
60
60
 
61
61
  def exec_rsync_demo(source: nil, target: nil)
62
62
  if source && target
63
+ puts "** demo rsync"
63
64
  puts "source: #{source.inspect}"
64
65
  puts "target: #{target.inspect}"
65
- puts "switches: -#{@switches}"
66
+ puts "switches: #{@switches}"
66
67
  puts "command: rsync #{@switches} #{source} #{target}"
67
68
  end
68
69
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muwu
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.beta2
4
+ version: 3.0.0.beta4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eli Harrison
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-03 00:00:00.000000000 Z
11
+ date: 2020-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commonmarker