muwu 2.5.1 → 3.0.0.rc1
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} +4 -2
- data/lib/muwu.rb +3 -3
- data/lib/muwu/cli/cli.rb +52 -11
- data/lib/muwu/cli/help/compile +4 -4
- data/lib/muwu/cli/help/publish +20 -0
- data/lib/muwu/cli/help/reset +6 -3
- data/lib/muwu/cli/help/summary +4 -2
- data/lib/muwu/cli/help/sync +26 -0
- data/lib/muwu/cli/help/view +3 -0
- data/lib/muwu/controller/controller.rb +71 -18
- data/lib/muwu/controller/controller_interaction.rb +66 -44
- data/lib/muwu/default/default.rb +14 -9
- data/lib/muwu/destination/destination.rb +61 -57
- data/lib/muwu/destination_builder/destination_builder.rb +31 -33
- data/lib/muwu/manifest_task/document_css.rb +5 -0
- data/lib/muwu/manifest_task/document_html.rb +6 -1
- data/lib/muwu/manifest_task/document_js.rb +6 -1
- 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 +3 -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 +24 -0
- 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/option_remote_publish_value_nil.rb +18 -0
- data/lib/muwu/project_exception/option_remote_sync_value_nil.rb +18 -0
- data/lib/muwu/project_exception/rsync_not_available.rb +23 -0
- data/lib/muwu/project_exception/scp_not_available.rb +23 -0
- data/lib/muwu/project_exception_handler/fatal.rb +10 -9
- data/lib/muwu/project_options/project_options.rb +11 -8
- data/lib/muwu/project_options_builder/project_option_validator.rb +12 -12
- data/lib/muwu/project_options_builder/project_option_validator_value.rb +92 -76
- data/lib/muwu/publish/publish.rb +56 -0
- 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_contents.rb +4 -1
- 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 +73 -0
- 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 +18 -5
@@ -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
|
|
@@ -0,0 +1,73 @@
|
|
1
|
+
module Muwu
|
2
|
+
class Sync
|
3
|
+
|
4
|
+
|
5
|
+
include Muwu
|
6
|
+
|
7
|
+
|
8
|
+
def initialize(project, args: [])
|
9
|
+
@path_local = project.working_directory + File::SEPARATOR
|
10
|
+
@path_remote = project.options.remote_sync
|
11
|
+
@project = project
|
12
|
+
@switches = args.push(project.options.rsync_options).flatten.sort.join(' ')
|
13
|
+
end
|
14
|
+
|
15
|
+
|
16
|
+
public
|
17
|
+
|
18
|
+
|
19
|
+
def pull
|
20
|
+
if @project.exceptions_include?(ProjectException::OptionRemoteSyncValueNil)
|
21
|
+
raise ProjectExceptionHandler::Fatal.new(ProjectException::OptionRemoteSyncValueNil.new)
|
22
|
+
else
|
23
|
+
sync(source: @path_remote, target: @path_local)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
|
28
|
+
def push
|
29
|
+
if @project.exceptions_include?(ProjectException::OptionRemoteSyncValueNil)
|
30
|
+
raise ProjectExceptionHandler::Fatal.new(ProjectException::OptionRemoteSyncValueNil.new)
|
31
|
+
else
|
32
|
+
sync(source: @path_local, target: @path_remote)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
def sync(source: nil, target: nil)
|
38
|
+
if source && target
|
39
|
+
exec_rsync(source: source, target: target)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
|
47
|
+
def exec_rsync(source: nil, target: nil)
|
48
|
+
if source && target
|
49
|
+
puts "source: #{source.inspect}"
|
50
|
+
puts "target: #{target.inspect}"
|
51
|
+
puts "switches: #{@switches}"
|
52
|
+
begin
|
53
|
+
system "rsync #{@switches} #{source} #{target}", exception: true
|
54
|
+
rescue Errno::ENOENT
|
55
|
+
raise ProjectExceptionHandler::Fatal.new(ProjectException::RsyncNotAvailable.new)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
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
|
+
|
72
|
+
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:
|
4
|
+
version: 3.0.0.rc1
|
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
|
@@ -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
|
@@ -110,8 +111,11 @@ files:
|
|
110
111
|
- lib/muwu/cli/help/heading
|
111
112
|
- lib/muwu/cli/help/inspect
|
112
113
|
- lib/muwu/cli/help/new
|
114
|
+
- lib/muwu/cli/help/publish
|
113
115
|
- lib/muwu/cli/help/reset
|
114
116
|
- lib/muwu/cli/help/summary
|
117
|
+
- lib/muwu/cli/help/sync
|
118
|
+
- lib/muwu/cli/help/view
|
115
119
|
- lib/muwu/controller/controller.rb
|
116
120
|
- lib/muwu/controller/controller_interaction.rb
|
117
121
|
- lib/muwu/default/default.rb
|
@@ -161,12 +165,15 @@ files:
|
|
161
165
|
- lib/muwu/project_builder/assets/config/css/index.scss
|
162
166
|
- lib/muwu/project_builder/assets/config/css_debugger/debug_section_text.scss
|
163
167
|
- lib/muwu/project_builder/project_reader.rb
|
168
|
+
- lib/muwu/project_builder/project_reset_compiled.rb
|
164
169
|
- lib/muwu/project_builder/project_reset_css.rb
|
165
170
|
- lib/muwu/project_builder/project_starter.rb
|
166
171
|
- lib/muwu/project_builder/project_validator.rb
|
167
172
|
- lib/muwu/project_builder/project_writer.rb
|
173
|
+
- lib/muwu/project_exception/compiled_folder_not_found.rb
|
168
174
|
- lib/muwu/project_exception/css_manifest_file_not_found.rb
|
169
175
|
- lib/muwu/project_exception/dry_output_recommended_with_multiple_documents.rb
|
176
|
+
- lib/muwu/project_exception/lynx_not_available.rb
|
170
177
|
- lib/muwu/project_exception/metadata_file_not_found.rb
|
171
178
|
- lib/muwu/project_exception/metadata_value_not_given.rb
|
172
179
|
- lib/muwu/project_exception/multiple_documents_outlined_with_stdout.rb
|
@@ -175,12 +182,16 @@ files:
|
|
175
182
|
- lib/muwu/project_exception/navigators_will_be_generated_automatically.rb
|
176
183
|
- lib/muwu/project_exception/option_key_not_understood.rb
|
177
184
|
- lib/muwu/project_exception/option_not_validatable.rb
|
185
|
+
- lib/muwu/project_exception/option_remote_publish_value_nil.rb
|
186
|
+
- lib/muwu/project_exception/option_remote_sync_value_nil.rb
|
178
187
|
- lib/muwu/project_exception/option_value_not_understood.rb
|
179
188
|
- lib/muwu/project_exception/options_file_not_found.rb
|
180
189
|
- lib/muwu/project_exception/outline_file_not_found.rb
|
181
190
|
- lib/muwu/project_exception/outline_step_not_understood.rb
|
182
191
|
- lib/muwu/project_exception/output_already_open.rb
|
183
192
|
- lib/muwu/project_exception/output_not_open.rb
|
193
|
+
- lib/muwu/project_exception/rsync_not_available.rb
|
194
|
+
- lib/muwu/project_exception/scp_not_available.rb
|
184
195
|
- lib/muwu/project_exception/subcontents_will_be_generated_automatically copy.rb
|
185
196
|
- lib/muwu/project_exception/target_project_folder_already_exists.rb
|
186
197
|
- lib/muwu/project_exception/text_source_file_not_found.rb
|
@@ -190,6 +201,7 @@ files:
|
|
190
201
|
- lib/muwu/project_options_builder/project_option_validator_key.rb
|
191
202
|
- lib/muwu/project_options_builder/project_option_validator_value.rb
|
192
203
|
- lib/muwu/project_options_builder/project_options_reader.rb
|
204
|
+
- lib/muwu/publish/publish.rb
|
193
205
|
- lib/muwu/render_concat/render_concat.rb
|
194
206
|
- lib/muwu/render_html/render_html.rb
|
195
207
|
- lib/muwu/render_html/render_markup_to_html.rb
|
@@ -222,8 +234,9 @@ files:
|
|
222
234
|
- lib/muwu/render_html_partial_builder/render_text_item_builder.rb
|
223
235
|
- lib/muwu/render_html_partial_builder/render_title_builder.rb
|
224
236
|
- lib/muwu/render_inspector/render_inspector.rb
|
237
|
+
- lib/muwu/sync/sync.rb
|
225
238
|
- lib/muwu/var/deflistdiv.rb
|
226
|
-
- lib/
|
239
|
+
- lib/muwu/viewer/viewer.rb
|
227
240
|
- test/what_no_tests.md
|
228
241
|
homepage: https://github.com/ehdocumentdesign/muwu
|
229
242
|
licenses:
|
@@ -240,9 +253,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
240
253
|
version: 2.5.1
|
241
254
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
242
255
|
requirements:
|
243
|
-
- - "
|
256
|
+
- - ">"
|
244
257
|
- !ruby/object:Gem::Version
|
245
|
-
version:
|
258
|
+
version: 1.3.1
|
246
259
|
requirements: []
|
247
260
|
rubygems_version: 3.1.2
|
248
261
|
signing_key:
|