muwu 3.0.0.beta2 → 3.0.0.beta4
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 +4 -4
- data/lib/muwu.rb +1 -1
- data/lib/muwu/cli/help/publish +14 -3
- data/lib/muwu/cli/help/sync +3 -5
- data/lib/muwu/default/default.rb +1 -0
- data/lib/muwu/project_options/project_options.rb +1 -0
- data/lib/muwu/project_options_builder/project_option_validator_value.rb +5 -0
- data/lib/muwu/publish/publish.rb +13 -29
- data/lib/muwu/sync/sync.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a763a6ef4bc3f58893ea96ce27730e5bfc906b4fcc64aa587421413b8cc9e55
|
4
|
+
data.tar.gz: be89ad33637f0d913fa990f8b997672be8a5d1d775411225a2db8e7dbbec1651
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7583d200eccf408768f7f19c58a20ce453c97f562663daa3afd2336015ee3863c7784a5a8a59bac3d948c35d866a4d790df9c65630288dfbefb8c1c38fce89c8
|
7
|
+
data.tar.gz: 2b54db763ffcd73e063a01887b31240bf7db6e60bf9e98d0224fe48f1bce99f91f2b86f76c2c92ccb2f9374a5eacd29951000a8cb47346d00b9f2bbd0edae618
|
data/lib/muwu.rb
CHANGED
data/lib/muwu/cli/help/publish
CHANGED
@@ -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
|
-
|
6
|
-
|
7
|
-
|
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.
|
data/lib/muwu/cli/help/sync
CHANGED
@@ -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.
|
data/lib/muwu/default/default.rb
CHANGED
@@ -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
|
|
data/lib/muwu/publish/publish.rb
CHANGED
@@ -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:
|
34
|
+
puts "switches: #{@switches}"
|
60
35
|
begin
|
61
|
-
system "rsync
|
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
|
data/lib/muwu/sync/sync.rb
CHANGED
@@ -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(
|
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:
|
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.
|
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-
|
11
|
+
date: 2020-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commonmarker
|