muwu 3.0.0.beta4 → 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.rb +2 -2
- data/lib/muwu/default/default.rb +0 -2
- data/lib/muwu/manifest_task_builder/text_item_builder.rb +1 -8
- data/lib/muwu/project/project.rb +7 -1
- data/lib/muwu/project_exception_handler/fatal.rb +10 -9
- data/lib/muwu/project_options/project_options.rb +0 -2
- data/lib/muwu/project_options_builder/project_option_validator_value.rb +0 -6
- data/lib/muwu/publish/publish.rb +1 -12
- data/lib/muwu/render_html_partial/render_document_html.rb +64 -64
- data/lib/muwu/sync/sync.rb +1 -1
- data/test/what_no_tests.md +1 -3
- 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: e2c92b3ed920a385c367fdb42b072943e08cbe720e8b0fce3c2ef7b40235b13e
|
4
|
+
data.tar.gz: 6d903e1f206fb36d2d8e37cbdff8137efbd0a7e8478dad7e22f80574f08061da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c39adc090bb2734d3263ca40889b8f398918d0f68d6199a5a485c8da50b521d0dfa0347f7f06f26228d1ea61cdf6155c22c1ee6183d405f24e57191aff8126ab
|
7
|
+
data.tar.gz: 7f11e98b6a1c803314942dbfc8a0777456080a1a09cd0599978e1caf10faacfed9023448c4ca24f8207759c1d77d6505107f3213c030eeb2f34343c6e7db06df
|
data/lib/muwu.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Muwu
|
2
2
|
|
3
3
|
|
4
|
-
VERSION = '3.0.0.
|
4
|
+
VERSION = '3.0.0.rc1'
|
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'))
|
@@ -26,7 +26,7 @@ module Muwu
|
|
26
26
|
|
27
27
|
|
28
28
|
def debug(file, line, info)
|
29
|
-
|
29
|
+
Logger.new(STDERR).debug("#{file} #{line} #{info}")
|
30
30
|
end
|
31
31
|
|
32
32
|
|
data/lib/muwu/default/default.rb
CHANGED
@@ -21,8 +21,6 @@ module Muwu
|
|
21
21
|
|
22
22
|
|
23
23
|
PROJECT_OPTIONS = {
|
24
|
-
# TODO: this was probably an anti-pattern
|
25
|
-
# compile_all_resets_compiled_folder: true,
|
26
24
|
contents_section_numbers_receive_link: true,
|
27
25
|
generate_navigators_automatically: true,
|
28
26
|
generate_subcontents_automatically: false,
|
@@ -153,7 +153,7 @@ module Muwu
|
|
153
153
|
end
|
154
154
|
end
|
155
155
|
|
156
|
-
|
156
|
+
# TODO: This method looks obsolete. Find its references.
|
157
157
|
def determine_source_filename_implicitly
|
158
158
|
# filename = make_filename_implicitly(outline_step)
|
159
159
|
# filepath = make_filepath_implicitly
|
@@ -259,13 +259,6 @@ module Muwu
|
|
259
259
|
end
|
260
260
|
|
261
261
|
|
262
|
-
# def make_filename_implicitly(string)
|
263
|
-
# file_basename = SanitizerHelper.sanitize_text_item_path(string)
|
264
|
-
# filename = file_basename + '.md'
|
265
|
-
# filename
|
266
|
-
# end
|
267
|
-
|
268
|
-
|
269
262
|
def make_filepath_implicitly
|
270
263
|
path_from_project_home = ['text']
|
271
264
|
if @project.text_block_naming_is_simple
|
data/lib/muwu/project/project.rb
CHANGED
@@ -287,7 +287,9 @@ module Muwu
|
|
287
287
|
end
|
288
288
|
|
289
289
|
|
290
|
-
#
|
290
|
+
# TODO: Broken due to introduction of the `/compiled` folder
|
291
|
+
# Keeping it as a comment in case it becomes useful in the future.
|
292
|
+
#
|
291
293
|
# def path_images
|
292
294
|
# File.absolute_path(File.join(@working_directory, 'images'))
|
293
295
|
# end
|
@@ -374,11 +376,15 @@ module Muwu
|
|
374
376
|
end
|
375
377
|
|
376
378
|
|
379
|
+
# TODO: What if there's no css to embed?
|
380
|
+
# Consider redefining this method.
|
377
381
|
def will_embed_css
|
378
382
|
will_create_css_file == false
|
379
383
|
end
|
380
384
|
|
381
385
|
|
386
|
+
# TODO: What if there's no js to embed?
|
387
|
+
# Consider redefining this method.
|
382
388
|
def will_embed_js
|
383
389
|
will_create_javascript_file == false
|
384
390
|
end
|
@@ -6,15 +6,16 @@ module Muwu
|
|
6
6
|
def initialize(exceptions)
|
7
7
|
@exceptions = [exceptions].flatten
|
8
8
|
render_exceptions
|
9
|
+
exit
|
9
10
|
end
|
10
|
-
|
11
|
-
|
11
|
+
|
12
|
+
|
12
13
|
def render_exception(exception)
|
13
14
|
$stderr.puts "- #{exception.class}"
|
14
15
|
$stderr.puts " #{exception.report}"
|
15
16
|
end
|
16
|
-
|
17
|
-
|
17
|
+
|
18
|
+
|
18
19
|
def render_exceptions
|
19
20
|
render_header
|
20
21
|
@exceptions.each do |exception|
|
@@ -22,17 +23,17 @@ module Muwu
|
|
22
23
|
end
|
23
24
|
render_lf
|
24
25
|
end
|
25
|
-
|
26
|
-
|
26
|
+
|
27
|
+
|
27
28
|
def render_header
|
28
29
|
$stderr.puts "#{self.inspect}"
|
29
30
|
end
|
30
|
-
|
31
|
-
|
31
|
+
|
32
|
+
|
32
33
|
def render_lf
|
33
34
|
$stderr.puts "\n"
|
34
35
|
end
|
35
|
-
|
36
|
+
|
36
37
|
|
37
38
|
end
|
38
39
|
end
|
@@ -106,12 +106,6 @@ module Muwu
|
|
106
106
|
end
|
107
107
|
|
108
108
|
|
109
|
-
# TODO: this was probably an anti-pattern
|
110
|
-
# def validate_option_compile_all_resets_compiled_folder
|
111
|
-
# return validate_option_boolean
|
112
|
-
# end
|
113
|
-
|
114
|
-
|
115
109
|
def validate_option_contents_section_numbers_receive_link
|
116
110
|
return validate_option_boolean
|
117
111
|
end
|
data/lib/muwu/publish/publish.rb
CHANGED
@@ -9,7 +9,7 @@ module Muwu
|
|
9
9
|
@path_local = project.path_compiled + File::SEPARATOR
|
10
10
|
@path_remote = project.options.remote_publish
|
11
11
|
@project = project
|
12
|
-
@switches = args.push(project.options.rsync_options).sort.join(' ')
|
12
|
+
@switches = args.push(project.options.rsync_options).flatten.sort.join(' ')
|
13
13
|
end
|
14
14
|
|
15
15
|
|
@@ -52,16 +52,5 @@ module Muwu
|
|
52
52
|
end
|
53
53
|
|
54
54
|
|
55
|
-
# def scp(filename)
|
56
|
-
# filename_local = File.join(@path_local, filename)
|
57
|
-
# filename_remote = File.join(@path_remote, filename)
|
58
|
-
# begin
|
59
|
-
# system "scp #{filename_local} #{filename_remote}", exception: true
|
60
|
-
# rescue Errno::ENOENT
|
61
|
-
# raise ProjectExceptionHandler::Fatal.new(ProjectException::ScpNotAvailable.new)
|
62
|
-
# end
|
63
|
-
# end
|
64
|
-
|
65
|
-
|
66
55
|
end
|
67
56
|
end
|
@@ -4,12 +4,12 @@ module Muwu
|
|
4
4
|
|
5
5
|
|
6
6
|
include Muwu
|
7
|
-
|
8
|
-
|
7
|
+
|
8
|
+
|
9
9
|
require 'sassc'
|
10
|
-
|
11
|
-
|
12
|
-
attr_accessor(
|
10
|
+
|
11
|
+
|
12
|
+
attr_accessor(
|
13
13
|
:destination,
|
14
14
|
:head_css_filename,
|
15
15
|
:head_css_method,
|
@@ -23,15 +23,15 @@ module Muwu
|
|
23
23
|
:project,
|
24
24
|
:tasks
|
25
25
|
)
|
26
|
-
|
27
|
-
|
26
|
+
|
27
|
+
|
28
28
|
def initialize
|
29
29
|
@head_metadata = {}
|
30
30
|
@tasks = []
|
31
31
|
end
|
32
|
-
|
33
|
-
|
34
|
-
|
32
|
+
|
33
|
+
|
34
|
+
|
35
35
|
public
|
36
36
|
|
37
37
|
|
@@ -72,9 +72,9 @@ module Muwu
|
|
72
72
|
|
73
73
|
|
74
74
|
def render_head
|
75
|
-
@destination.padding_vertical(1) do
|
75
|
+
@destination.padding_vertical(1) do
|
76
76
|
write_tag_head_open
|
77
|
-
@destination.margin_indent do
|
77
|
+
@destination.margin_indent do
|
78
78
|
write_tag_title
|
79
79
|
render_head_meta_tags
|
80
80
|
render_head_css
|
@@ -105,7 +105,7 @@ module Muwu
|
|
105
105
|
def render_head_css_link
|
106
106
|
write_tag_link_stylesheet
|
107
107
|
end
|
108
|
-
|
108
|
+
|
109
109
|
|
110
110
|
def render_head_js
|
111
111
|
case @head_js_method
|
@@ -124,14 +124,14 @@ module Muwu
|
|
124
124
|
end
|
125
125
|
write_tag_script_close
|
126
126
|
end
|
127
|
-
|
128
|
-
|
127
|
+
|
128
|
+
|
129
129
|
def render_head_js_lib_navigation
|
130
130
|
if @project.options.html_uses_javascript_navigation
|
131
131
|
write_js_lib_navigation
|
132
132
|
end
|
133
133
|
end
|
134
|
-
|
134
|
+
|
135
135
|
|
136
136
|
def render_head_js_link
|
137
137
|
write_tag_script_src
|
@@ -148,8 +148,8 @@ module Muwu
|
|
148
148
|
write_tag_meta_generator
|
149
149
|
write_tag_meta_viewport
|
150
150
|
end
|
151
|
-
|
152
|
-
|
151
|
+
|
152
|
+
|
153
153
|
def render_tag_html_open
|
154
154
|
write_tag_doctype
|
155
155
|
if @html_lang
|
@@ -158,8 +158,8 @@ module Muwu
|
|
158
158
|
write_tag_html_open
|
159
159
|
end
|
160
160
|
end
|
161
|
-
|
162
|
-
|
161
|
+
|
162
|
+
|
163
163
|
def write_css_if_manifest_exists
|
164
164
|
if @project.exceptions_include?(ProjectException::CssManifestFileNotFound)
|
165
165
|
write_css_missing_comment
|
@@ -167,10 +167,10 @@ module Muwu
|
|
167
167
|
write_css
|
168
168
|
end
|
169
169
|
end
|
170
|
-
|
170
|
+
|
171
171
|
|
172
172
|
def write_css
|
173
|
-
@destination.write_inline
|
173
|
+
@destination.write_inline SassC::Engine.new(File.read(@project.css_manifest_filename), syntax: :scss, load_paths: ['config/css']).render
|
174
174
|
end
|
175
175
|
|
176
176
|
|
@@ -180,14 +180,14 @@ module Muwu
|
|
180
180
|
@destination.write_line " - CSS manifest file could not be found."
|
181
181
|
@destination.write_line " - Expecting `#{project.css_manifest_filename}`"
|
182
182
|
@destination.write_line "*/"
|
183
|
-
end
|
184
|
-
|
185
|
-
|
183
|
+
end
|
184
|
+
|
185
|
+
|
186
186
|
def write_js_library(library)
|
187
187
|
@destination.write_inline RenderHtmlPartial::JsLibrary.new.find(library)
|
188
188
|
end
|
189
|
-
|
190
|
-
|
189
|
+
|
190
|
+
|
191
191
|
def write_tag_body_close
|
192
192
|
@destination.write_line tag_body_close
|
193
193
|
end
|
@@ -196,8 +196,8 @@ module Muwu
|
|
196
196
|
def write_tag_body_open
|
197
197
|
@destination.write_line tag_body_open
|
198
198
|
end
|
199
|
-
|
200
|
-
|
199
|
+
|
200
|
+
|
201
201
|
def write_tag_doctype
|
202
202
|
@destination.write_line tag_doctype
|
203
203
|
end
|
@@ -236,18 +236,18 @@ module Muwu
|
|
236
236
|
def write_tag_meta(key, value)
|
237
237
|
@destination.write_line tag_meta(key, value)
|
238
238
|
end
|
239
|
-
|
240
|
-
|
239
|
+
|
240
|
+
|
241
241
|
def write_tag_meta_charset_utf8
|
242
242
|
@destination.write_line tag_meta_charset_utf8
|
243
243
|
end
|
244
|
-
|
245
|
-
|
244
|
+
|
245
|
+
|
246
246
|
def write_tag_meta_generator
|
247
247
|
@destination.write_line tag_meta_generator
|
248
248
|
end
|
249
|
-
|
250
|
-
|
249
|
+
|
250
|
+
|
251
251
|
def write_tag_meta_viewport
|
252
252
|
@destination.write_line tag_meta_viewport
|
253
253
|
end
|
@@ -261,13 +261,13 @@ module Muwu
|
|
261
261
|
def write_tag_script_close
|
262
262
|
@destination.write_line tag_script_close
|
263
263
|
end
|
264
|
-
|
265
|
-
|
264
|
+
|
265
|
+
|
266
266
|
def write_tag_script_open
|
267
267
|
@destination.write_line tag_script_open
|
268
268
|
end
|
269
|
-
|
270
|
-
|
269
|
+
|
270
|
+
|
271
271
|
def write_tag_script_src
|
272
272
|
@destination.write_line tag_script_src
|
273
273
|
end
|
@@ -276,13 +276,13 @@ module Muwu
|
|
276
276
|
def write_tag_style_close
|
277
277
|
@destination.write_line tag_style_close
|
278
278
|
end
|
279
|
-
|
280
|
-
|
279
|
+
|
280
|
+
|
281
281
|
def write_tag_style_open
|
282
282
|
@destination.write_line tag_style_open
|
283
283
|
end
|
284
|
-
|
285
|
-
|
284
|
+
|
285
|
+
|
286
286
|
def write_tag_title
|
287
287
|
@destination.write_line tag_title
|
288
288
|
end
|
@@ -290,8 +290,8 @@ module Muwu
|
|
290
290
|
|
291
291
|
|
292
292
|
private
|
293
|
-
|
294
|
-
|
293
|
+
|
294
|
+
|
295
295
|
def tag_body_close
|
296
296
|
"</body>"
|
297
297
|
end
|
@@ -305,8 +305,8 @@ module Muwu
|
|
305
305
|
def tag_doctype
|
306
306
|
"<!DOCTYPE html>"
|
307
307
|
end
|
308
|
-
|
309
|
-
|
308
|
+
|
309
|
+
|
310
310
|
def tag_head_close
|
311
311
|
"</head>"
|
312
312
|
end
|
@@ -340,23 +340,23 @@ module Muwu
|
|
340
340
|
def tag_meta(key, value)
|
341
341
|
"<meta name='#{key}' value='#{value}'>"
|
342
342
|
end
|
343
|
-
|
344
|
-
|
343
|
+
|
344
|
+
|
345
345
|
def tag_meta_charset_utf8
|
346
346
|
"<meta charset='UTF-8'>"
|
347
347
|
end
|
348
|
-
|
349
|
-
|
348
|
+
|
349
|
+
|
350
350
|
def tag_meta_generator
|
351
351
|
"<meta name='generator' content='Muwu #{Muwu::VERSION}'>"
|
352
352
|
end
|
353
|
-
|
354
|
-
|
353
|
+
|
354
|
+
|
355
355
|
def tag_meta_instance_date
|
356
356
|
"<meta name='date_of_this_edition' value='#{@project.instance_date}'>\n"
|
357
357
|
end
|
358
358
|
|
359
|
-
|
359
|
+
|
360
360
|
def tag_meta_viewport
|
361
361
|
"<meta name='viewport' content='width=device-width, initial-scale=1, user-scalable=yes'>"
|
362
362
|
end
|
@@ -365,32 +365,32 @@ module Muwu
|
|
365
365
|
def tag_script_close
|
366
366
|
"</script>"
|
367
367
|
end
|
368
|
-
|
369
|
-
|
368
|
+
|
369
|
+
|
370
370
|
def tag_script_open
|
371
371
|
"<script>"
|
372
372
|
end
|
373
|
-
|
374
|
-
|
373
|
+
|
374
|
+
|
375
375
|
def tag_script_src
|
376
376
|
"<script src='#{@head_js_filename}'></script>"
|
377
377
|
end
|
378
378
|
|
379
|
-
|
379
|
+
|
380
380
|
def tag_style_close
|
381
381
|
"</style>"
|
382
382
|
end
|
383
|
-
|
384
|
-
|
383
|
+
|
384
|
+
|
385
385
|
def tag_style_open
|
386
386
|
"<style>"
|
387
387
|
end
|
388
|
-
|
389
|
-
|
388
|
+
|
389
|
+
|
390
390
|
def tag_title
|
391
391
|
"<title>#{@html_title}</title>"
|
392
392
|
end
|
393
|
-
|
393
|
+
|
394
394
|
|
395
395
|
end
|
396
396
|
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(project.options.rsync_options).sort.join(' ')
|
12
|
+
@switches = args.push(project.options.rsync_options).flatten.sort.join(' ')
|
13
13
|
end
|
14
14
|
|
15
15
|
|
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.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
|