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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/lib/{muwu_loader.rb → loader.rb} +4 -2
  3. data/lib/muwu.rb +3 -3
  4. data/lib/muwu/cli/cli.rb +52 -11
  5. data/lib/muwu/cli/help/compile +4 -4
  6. data/lib/muwu/cli/help/publish +20 -0
  7. data/lib/muwu/cli/help/reset +6 -3
  8. data/lib/muwu/cli/help/summary +4 -2
  9. data/lib/muwu/cli/help/sync +26 -0
  10. data/lib/muwu/cli/help/view +3 -0
  11. data/lib/muwu/controller/controller.rb +71 -18
  12. data/lib/muwu/controller/controller_interaction.rb +66 -44
  13. data/lib/muwu/default/default.rb +14 -9
  14. data/lib/muwu/destination/destination.rb +61 -57
  15. data/lib/muwu/destination_builder/destination_builder.rb +31 -33
  16. data/lib/muwu/manifest_task/document_css.rb +5 -0
  17. data/lib/muwu/manifest_task/document_html.rb +6 -1
  18. data/lib/muwu/manifest_task/document_js.rb +6 -1
  19. data/lib/muwu/manifest_task_builder/text_item_builder.rb +1 -8
  20. data/lib/muwu/project/project.rb +146 -127
  21. data/lib/muwu/project_builder/assets/config/css/base/html_elements.scss +19 -15
  22. data/lib/muwu/project_builder/assets/config/css/base/mixin_text_section_heading.scss +12 -11
  23. data/lib/muwu/project_builder/assets/config/css/base/section_muwu_contents.scss +5 -5
  24. data/lib/muwu/project_builder/assets/config/css/base/section_muwu_metadata.scss +2 -4
  25. data/lib/muwu/project_builder/assets/config/css/base/section_muwu_navigator.scss +3 -4
  26. data/lib/muwu/project_builder/assets/config/css/base/section_muwu_subcontents.scss +5 -5
  27. data/lib/muwu/project_builder/assets/config/css/base/section_muwu_text.scss +16 -15
  28. data/lib/muwu/project_builder/assets/config/css/base/section_muwu_title.scss +9 -6
  29. data/lib/muwu/project_builder/project_reader.rb +3 -0
  30. data/lib/muwu/project_builder/project_reset_compiled.rb +31 -0
  31. data/lib/muwu/project_builder/project_reset_css.rb +30 -30
  32. data/lib/muwu/project_builder/project_starter.rb +7 -7
  33. data/lib/muwu/project_builder/project_validator.rb +24 -0
  34. data/lib/muwu/project_builder/project_writer.rb +12 -11
  35. data/lib/muwu/project_exception/compiled_folder_not_found.rb +23 -0
  36. data/lib/muwu/project_exception/lynx_not_available.rb +23 -0
  37. data/lib/muwu/project_exception/option_remote_publish_value_nil.rb +18 -0
  38. data/lib/muwu/project_exception/option_remote_sync_value_nil.rb +18 -0
  39. data/lib/muwu/project_exception/rsync_not_available.rb +23 -0
  40. data/lib/muwu/project_exception/scp_not_available.rb +23 -0
  41. data/lib/muwu/project_exception_handler/fatal.rb +10 -9
  42. data/lib/muwu/project_options/project_options.rb +11 -8
  43. data/lib/muwu/project_options_builder/project_option_validator.rb +12 -12
  44. data/lib/muwu/project_options_builder/project_option_validator_value.rb +92 -76
  45. data/lib/muwu/publish/publish.rb +56 -0
  46. data/lib/muwu/render_concat/render_concat.rb +26 -27
  47. data/lib/muwu/render_html/render_html.rb +27 -24
  48. data/lib/muwu/render_html_partial/render_contents.rb +4 -1
  49. data/lib/muwu/render_html_partial/render_document_html.rb +64 -64
  50. data/lib/muwu/render_html_partial/render_text_item.rb +16 -16
  51. data/lib/muwu/sync/sync.rb +73 -0
  52. data/lib/muwu/var/deflistdiv.rb +0 -0
  53. data/lib/muwu/viewer/viewer.rb +25 -0
  54. data/test/what_no_tests.md +1 -3
  55. 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
- "<span class='section_number'>#{@section_number_as_text}</span>"
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
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
@@ -1,5 +1,3 @@
1
1
  # What, no tests?!!
2
2
 
3
- Sorry not-sorry for the lack of unit tests. The author understands their value. However, the author lacks institutional training in software development, and has not yet found any relatable resources to learn test-driven development.
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: 2.5.1
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-02-15 00:00:00.000000000 Z
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/muwu_loader.rb
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: '0'
258
+ version: 1.3.1
246
259
  requirements: []
247
260
  rubygems_version: 3.1.2
248
261
  signing_key: