muwu 3.0.0.alpha → 3.0.0
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_loader.rb → loader.rb} +2 -2
- data/lib/muwu.rb +3 -3
- data/lib/muwu/cli/cli.rb +33 -22
- data/lib/muwu/cli/help/compile +4 -4
- data/lib/muwu/cli/help/publish +19 -6
- data/lib/muwu/cli/help/reset +5 -2
- data/lib/muwu/cli/help/summary +4 -4
- data/lib/muwu/cli/help/sync +23 -15
- data/lib/muwu/cli/help/view +3 -0
- data/lib/muwu/controller/controller.rb +65 -30
- data/lib/muwu/controller/controller_interaction.rb +66 -44
- data/lib/muwu/default/default.rb +12 -9
- data/lib/muwu/destination/destination.rb +61 -57
- data/lib/muwu/destination_builder/destination_builder.rb +31 -33
- data/lib/muwu/manifest_task_builder/text_item_builder.rb +1 -8
- data/lib/muwu/project/project.rb +146 -127
- data/lib/muwu/project_builder/assets/config/css/base/html_elements.scss +19 -15
- data/lib/muwu/project_builder/assets/config/css/base/mixin_text_section_heading.scss +12 -11
- data/lib/muwu/project_builder/assets/config/css/base/section_muwu_contents.scss +5 -5
- data/lib/muwu/project_builder/assets/config/css/base/section_muwu_metadata.scss +2 -4
- data/lib/muwu/project_builder/assets/config/css/base/section_muwu_navigator.scss +3 -4
- data/lib/muwu/project_builder/assets/config/css/base/section_muwu_subcontents.scss +5 -5
- data/lib/muwu/project_builder/assets/config/css/base/section_muwu_text.scss +16 -15
- data/lib/muwu/project_builder/assets/config/css/base/section_muwu_title.scss +9 -6
- data/lib/muwu/project_builder/project_reader.rb +1 -0
- data/lib/muwu/project_builder/project_reset_compiled.rb +31 -0
- data/lib/muwu/project_builder/project_reset_css.rb +30 -30
- data/lib/muwu/project_builder/project_starter.rb +7 -7
- data/lib/muwu/project_builder/project_validator.rb +14 -4
- data/lib/muwu/project_builder/project_writer.rb +12 -11
- data/lib/muwu/project_exception/compiled_folder_not_found.rb +23 -0
- data/lib/muwu/project_exception/lynx_not_available.rb +23 -0
- data/lib/muwu/project_exception_handler/fatal.rb +10 -9
- data/lib/muwu/project_options/project_options.rb +9 -8
- data/lib/muwu/project_options_builder/project_option_validator.rb +12 -12
- data/lib/muwu/project_options_builder/project_option_validator_value.rb +78 -82
- data/lib/muwu/publish/publish.rb +42 -34
- data/lib/muwu/render_concat/render_concat.rb +26 -27
- data/lib/muwu/render_html/render_html.rb +27 -24
- data/lib/muwu/render_html_partial/render_document_html.rb +64 -64
- data/lib/muwu/render_html_partial/render_text_item.rb +16 -16
- data/lib/muwu/sync/sync.rb +40 -36
- data/lib/muwu/var/deflistdiv.rb +0 -0
- data/lib/muwu/viewer/viewer.rb +25 -0
- data/test/what_no_tests.md +1 -3
- metadata +16 -11
@@ -4,13 +4,13 @@ module Muwu
|
|
4
4
|
|
5
5
|
|
6
6
|
include Muwu
|
7
|
-
|
8
|
-
|
7
|
+
|
8
|
+
|
9
9
|
require 'commonmarker'
|
10
|
-
|
10
|
+
|
11
11
|
|
12
12
|
attr_accessor(
|
13
|
-
:destination,
|
13
|
+
:destination,
|
14
14
|
:distinct,
|
15
15
|
:does_have_source_text,
|
16
16
|
:end_links,
|
@@ -45,7 +45,7 @@ module Muwu
|
|
45
45
|
elsif (@is_parent_heading == true) && (@subsections_are_distinct == false)
|
46
46
|
render_sections
|
47
47
|
render_end_links
|
48
|
-
elsif (@is_parent_heading == false)
|
48
|
+
elsif (@is_parent_heading == false)
|
49
49
|
render_end_links
|
50
50
|
end
|
51
51
|
write_tag_section_close
|
@@ -81,14 +81,14 @@ module Muwu
|
|
81
81
|
write_tag_span_section_number
|
82
82
|
end
|
83
83
|
end
|
84
|
-
|
85
|
-
|
84
|
+
|
85
|
+
|
86
86
|
def render_sections
|
87
87
|
@destination.padding_vertical(1) do
|
88
88
|
@sections.each do |section|
|
89
89
|
section.render
|
90
90
|
end
|
91
|
-
end
|
91
|
+
end
|
92
92
|
end
|
93
93
|
|
94
94
|
|
@@ -132,7 +132,7 @@ module Muwu
|
|
132
132
|
def write_tag_span_section_number
|
133
133
|
@destination.write_line tag_span_section_number
|
134
134
|
end
|
135
|
-
|
135
|
+
|
136
136
|
|
137
137
|
def write_text_file_missing
|
138
138
|
@destination.write_line tag_div_file_missing
|
@@ -142,17 +142,17 @@ module Muwu
|
|
142
142
|
def write_text_source_to_html
|
143
143
|
@destination.write_inline source_to_html
|
144
144
|
end
|
145
|
-
|
146
145
|
|
147
|
-
|
146
|
+
|
147
|
+
|
148
148
|
private
|
149
149
|
|
150
150
|
|
151
151
|
def heading_origin_is_basename_or_outline
|
152
152
|
[:basename, :outline].include?(@heading_origin)
|
153
153
|
end
|
154
|
-
|
155
|
-
|
154
|
+
|
155
|
+
|
156
156
|
def source_file_exists
|
157
157
|
if @source_filename_absolute
|
158
158
|
File.exists?(@source_filename_absolute)
|
@@ -174,11 +174,11 @@ module Muwu
|
|
174
174
|
"</nav>"
|
175
175
|
end
|
176
176
|
|
177
|
-
|
177
|
+
|
178
178
|
def tag_nav_open
|
179
179
|
"<nav>"
|
180
180
|
end
|
181
|
-
|
181
|
+
|
182
182
|
|
183
183
|
def tag_nav_end_links_open
|
184
184
|
"<nav class='document_links'>"
|
@@ -221,7 +221,7 @@ module Muwu
|
|
221
221
|
|
222
222
|
|
223
223
|
def tag_span_section_number
|
224
|
-
"<
|
224
|
+
"<h1 class='section_number'>#{@section_number_as_text}</h1>"
|
225
225
|
end
|
226
226
|
|
227
227
|
|
data/lib/muwu/sync/sync.rb
CHANGED
@@ -3,67 +3,71 @@ module Muwu
|
|
3
3
|
|
4
4
|
|
5
5
|
include Muwu
|
6
|
-
|
7
|
-
|
6
|
+
|
7
|
+
|
8
8
|
def initialize(project, args: [])
|
9
|
-
@
|
9
|
+
@path_local = project.working_directory + File::SEPARATOR
|
10
|
+
@path_remote = project.options.remote_sync
|
10
11
|
@project = project
|
11
|
-
@
|
12
|
-
|
13
|
-
switches = ['i','r','v']
|
14
|
-
@args = args.map { |a| a.to_s.downcase }
|
15
|
-
if @args.include?('dry-run')
|
16
|
-
@dry_run = true
|
17
|
-
switches << 'n'
|
18
|
-
end
|
19
|
-
@switches = switches.sort.join
|
12
|
+
@switches = args.push(project.options.rsync_options).flatten.sort.join(' ')
|
20
13
|
end
|
21
|
-
|
22
|
-
|
14
|
+
|
15
|
+
|
23
16
|
public
|
24
|
-
|
25
|
-
|
26
|
-
def
|
17
|
+
|
18
|
+
|
19
|
+
def pull
|
27
20
|
if @project.exceptions_include?(ProjectException::OptionRemoteSyncValueNil)
|
28
21
|
raise ProjectExceptionHandler::Fatal.new(ProjectException::OptionRemoteSyncValueNil.new)
|
29
22
|
else
|
30
|
-
source
|
31
|
-
target = @local
|
32
|
-
exec_sync(source: @remote, target: @local)
|
23
|
+
sync(source: @path_remote, target: @path_local)
|
33
24
|
end
|
34
25
|
end
|
35
|
-
|
36
|
-
|
37
|
-
def
|
26
|
+
|
27
|
+
|
28
|
+
def push
|
38
29
|
if @project.exceptions_include?(ProjectException::OptionRemoteSyncValueNil)
|
39
30
|
raise ProjectExceptionHandler::Fatal.new(ProjectException::OptionRemoteSyncValueNil.new)
|
40
31
|
else
|
41
|
-
source
|
42
|
-
target = @remote
|
43
|
-
exec_sync(source: @local, target: @remote)
|
32
|
+
sync(source: @path_local, target: @path_remote)
|
44
33
|
end
|
45
34
|
end
|
46
35
|
|
47
36
|
|
37
|
+
def sync(source: nil, target: nil)
|
38
|
+
if source && target
|
39
|
+
exec_rsync(source: source, target: target)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
48
43
|
|
49
44
|
private
|
50
|
-
|
51
|
-
|
52
|
-
def
|
45
|
+
|
46
|
+
|
47
|
+
def exec_rsync(source: nil, target: nil)
|
53
48
|
if source && target
|
54
49
|
puts "source: #{source.inspect}"
|
55
50
|
puts "target: #{target.inspect}"
|
56
|
-
puts "
|
57
|
-
puts "switches: -#{@switches}"
|
51
|
+
puts "switches: #{@switches}"
|
58
52
|
begin
|
59
|
-
system "rsync
|
53
|
+
system "rsync #{@switches} #{source} #{target}", exception: true
|
60
54
|
rescue Errno::ENOENT
|
61
55
|
raise ProjectExceptionHandler::Fatal.new(ProjectException::RsyncNotAvailable.new)
|
62
56
|
end
|
63
57
|
end
|
64
58
|
end
|
65
|
-
|
66
|
-
|
67
|
-
|
59
|
+
|
60
|
+
|
61
|
+
def exec_rsync_demo(source: nil, target: nil)
|
62
|
+
if source && target
|
63
|
+
puts "** demo rsync"
|
64
|
+
puts "source: #{source.inspect}"
|
65
|
+
puts "target: #{target.inspect}"
|
66
|
+
puts "switches: #{@switches}"
|
67
|
+
puts "command: rsync #{@switches} #{source} #{target}"
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
|
68
72
|
end
|
69
|
-
end
|
73
|
+
end
|
data/lib/muwu/var/deflistdiv.rb
CHANGED
File without changes
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Muwu
|
2
|
+
class Viewer
|
3
|
+
|
4
|
+
|
5
|
+
include Muwu
|
6
|
+
|
7
|
+
|
8
|
+
def initialize(project)
|
9
|
+
document_home = project.manifest.find_document_html_by_index(0).filename
|
10
|
+
document_home_path = File.join(project.path_compiled, document_home)
|
11
|
+
if File.exists?(document_home_path)
|
12
|
+
begin
|
13
|
+
system "lynx #{document_home_path}", exception: true
|
14
|
+
rescue Errno::ENOENT
|
15
|
+
raise ProjectExceptionHandler::Fatal.new(ProjectException::LynxNotAvailable.new)
|
16
|
+
end
|
17
|
+
else
|
18
|
+
puts "Compiled document not found: #{document_home_path}"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
data/test/what_no_tests.md
CHANGED
@@ -1,5 +1,3 @@
|
|
1
1
|
# What, no tests?!!
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
(The author also tunes out any examples invoking foo bar baz.)
|
3
|
+
Currently there is no test suite. The developer understands the value of automated tests; however, the developer lacks institutional training in software development, and has not yet found any resources that teach test-driven development in a meaningful way.
|
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
|
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-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commonmarker
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.21'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.21'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: haml
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
47
|
+
version: '0.3'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0.
|
54
|
+
version: '0.3'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: motion-markdown-it
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '2.
|
89
|
+
version: '2.4'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '2.
|
96
|
+
version: '2.4'
|
97
97
|
description: Compile markup files (Markdown and YAML) into HTML.
|
98
98
|
email:
|
99
99
|
executables:
|
@@ -102,6 +102,7 @@ extensions: []
|
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
104
|
- bin/muwu
|
105
|
+
- lib/loader.rb
|
105
106
|
- lib/muwu.rb
|
106
107
|
- lib/muwu/cli/cli.rb
|
107
108
|
- lib/muwu/cli/cli_help.rb
|
@@ -114,6 +115,7 @@ files:
|
|
114
115
|
- lib/muwu/cli/help/reset
|
115
116
|
- lib/muwu/cli/help/summary
|
116
117
|
- lib/muwu/cli/help/sync
|
118
|
+
- lib/muwu/cli/help/view
|
117
119
|
- lib/muwu/controller/controller.rb
|
118
120
|
- lib/muwu/controller/controller_interaction.rb
|
119
121
|
- lib/muwu/default/default.rb
|
@@ -163,12 +165,15 @@ files:
|
|
163
165
|
- lib/muwu/project_builder/assets/config/css/index.scss
|
164
166
|
- lib/muwu/project_builder/assets/config/css_debugger/debug_section_text.scss
|
165
167
|
- lib/muwu/project_builder/project_reader.rb
|
168
|
+
- lib/muwu/project_builder/project_reset_compiled.rb
|
166
169
|
- lib/muwu/project_builder/project_reset_css.rb
|
167
170
|
- lib/muwu/project_builder/project_starter.rb
|
168
171
|
- lib/muwu/project_builder/project_validator.rb
|
169
172
|
- lib/muwu/project_builder/project_writer.rb
|
173
|
+
- lib/muwu/project_exception/compiled_folder_not_found.rb
|
170
174
|
- lib/muwu/project_exception/css_manifest_file_not_found.rb
|
171
175
|
- lib/muwu/project_exception/dry_output_recommended_with_multiple_documents.rb
|
176
|
+
- lib/muwu/project_exception/lynx_not_available.rb
|
172
177
|
- lib/muwu/project_exception/metadata_file_not_found.rb
|
173
178
|
- lib/muwu/project_exception/metadata_value_not_given.rb
|
174
179
|
- lib/muwu/project_exception/multiple_documents_outlined_with_stdout.rb
|
@@ -231,7 +236,7 @@ files:
|
|
231
236
|
- lib/muwu/render_inspector/render_inspector.rb
|
232
237
|
- lib/muwu/sync/sync.rb
|
233
238
|
- lib/muwu/var/deflistdiv.rb
|
234
|
-
- lib/
|
239
|
+
- lib/muwu/viewer/viewer.rb
|
235
240
|
- test/what_no_tests.md
|
236
241
|
homepage: https://github.com/ehdocumentdesign/muwu
|
237
242
|
licenses:
|
@@ -248,9 +253,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
248
253
|
version: 2.5.1
|
249
254
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
250
255
|
requirements:
|
251
|
-
- - "
|
256
|
+
- - ">="
|
252
257
|
- !ruby/object:Gem::Version
|
253
|
-
version:
|
258
|
+
version: '0'
|
254
259
|
requirements: []
|
255
260
|
rubygems_version: 3.1.2
|
256
261
|
signing_key:
|