muwu 3.0.0.alpha → 3.0.0.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/{muwu_loader.rb → loader.rb} +2 -2
- data/lib/muwu.rb +2 -2
- data/lib/muwu/cli/cli.rb +29 -18
- data/lib/muwu/cli/help/publish +8 -6
- data/lib/muwu/cli/help/reset +5 -2
- data/lib/muwu/cli/help/summary +4 -2
- data/lib/muwu/cli/help/sync +6 -6
- data/lib/muwu/cli/help/view +4 -0
- data/lib/muwu/controller/controller.rb +63 -28
- data/lib/muwu/default/default.rb +11 -9
- data/lib/muwu/destination/destination.rb +61 -57
- data/lib/muwu/destination_builder/destination_builder.rb +31 -33
- data/lib/muwu/project/project.rb +137 -117
- data/lib/muwu/project_builder/assets/config/css/base/mixin_text_section_heading.scss +36 -11
- data/lib/muwu/project_builder/project_reader.rb +1 -0
- data/lib/muwu/project_builder/project_reset_compiled.rb +24 -0
- data/lib/muwu/project_builder/project_reset_css.rb +30 -30
- data/lib/muwu/project_builder/project_validator.rb +14 -4
- data/lib/muwu/project_builder/project_writer.rb +11 -10
- 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_options/project_options.rb +9 -8
- data/lib/muwu/project_options_builder/project_option_validator_value.rb +73 -82
- data/lib/muwu/publish/publish.rb +70 -34
- data/lib/muwu/render_html/render_html.rb +30 -24
- data/lib/muwu/render_html_partial/render_text_item.rb +16 -16
- data/lib/muwu/sync/sync.rb +19 -23
- data/lib/muwu/var/deflistdiv.rb +0 -0
- data/lib/muwu/viewer/viewer.rb +25 -0
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd84d886de0b03ecaef0c6cb6eafe2f81e0f36e67b42d1d0a315b76968bff743
|
4
|
+
data.tar.gz: 01fec21c061156be890fd9445b3ba1b86f700893e929a1b51630017b6e5e3985
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eea61dd2032e8b8d25dd40236342a1a6753be24a3640d971727fd169e592ab78833d9d8152b36198bc7fb9199ceda36154794db2da2d9fb9a96af6165b5f4985
|
7
|
+
data.tar.gz: 7cd2c9592176fb8d45bac5ed55a20f72e20657577656d48c2e97a0781046521fbdcf97a7fc16712e14129ed2ffc92b655c9ddbb6c6432346b1dfd2984389e401
|
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.beta'
|
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'))
|
@@ -18,7 +18,7 @@ module Muwu
|
|
18
18
|
require 'yaml'
|
19
19
|
|
20
20
|
|
21
|
-
require_relative '
|
21
|
+
require_relative 'loader'
|
22
22
|
|
23
23
|
|
24
24
|
|
data/lib/muwu/cli/cli.rb
CHANGED
@@ -3,7 +3,7 @@ module Muwu
|
|
3
3
|
|
4
4
|
|
5
5
|
include Muwu
|
6
|
-
|
6
|
+
|
7
7
|
|
8
8
|
def initialize(args)
|
9
9
|
@args = args.map do |a|
|
@@ -14,7 +14,7 @@ module Muwu
|
|
14
14
|
a.downcase.strip
|
15
15
|
end
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
@current_working_directory = Dir.pwd
|
19
19
|
end
|
20
20
|
|
@@ -44,6 +44,8 @@ module Muwu
|
|
44
44
|
evaluate_command_reset
|
45
45
|
when 'sync'
|
46
46
|
evaluate_command_sync
|
47
|
+
when 'view'
|
48
|
+
evaluate_command_view
|
47
49
|
when '--version'
|
48
50
|
puts VERSION
|
49
51
|
else
|
@@ -63,7 +65,7 @@ module Muwu
|
|
63
65
|
|
64
66
|
elsif @args[1] == 'css'
|
65
67
|
Controller.new(@current_working_directory).compile_css
|
66
|
-
|
68
|
+
|
67
69
|
elsif @args[1] == 'html'
|
68
70
|
evaluate_command_compile_html
|
69
71
|
|
@@ -74,12 +76,12 @@ module Muwu
|
|
74
76
|
puts CliHelp.new(:compile).message
|
75
77
|
end
|
76
78
|
end
|
77
|
-
|
78
|
-
|
79
|
+
|
80
|
+
|
79
81
|
def evaluate_command_compile_html
|
80
82
|
if @args[2] == nil
|
81
83
|
Controller.new(@current_working_directory).compile_html
|
82
|
-
|
84
|
+
|
83
85
|
elsif @args[2] =~ /\A[0-9]+\z/
|
84
86
|
Controller.new(@current_working_directory).compile_html_by_index(@args[2].to_i)
|
85
87
|
|
@@ -87,12 +89,12 @@ module Muwu
|
|
87
89
|
puts CliHelp.new(:compile).message
|
88
90
|
end
|
89
91
|
end
|
90
|
-
|
91
|
-
|
92
|
+
|
93
|
+
|
92
94
|
def evaluate_command_concat
|
93
95
|
Controller.new(@current_working_directory).concat
|
94
96
|
end
|
95
|
-
|
97
|
+
|
96
98
|
|
97
99
|
|
98
100
|
def evaluate_command_help
|
@@ -115,6 +117,8 @@ module Muwu
|
|
115
117
|
puts CliHelp.new(:reset).message
|
116
118
|
when 'sync'
|
117
119
|
puts CliHelp.new(:sync).message
|
120
|
+
when 'view'
|
121
|
+
puts CliHelp.new(:view).message
|
118
122
|
else
|
119
123
|
puts CliHelp.new(:summary).message
|
120
124
|
end
|
@@ -133,16 +137,18 @@ module Muwu
|
|
133
137
|
|
134
138
|
|
135
139
|
def evaluate_command_publish
|
136
|
-
Controller.new(@current_working_directory).publish
|
140
|
+
Controller.new(@current_working_directory).publish(@args[1..(@args.length-1)])
|
137
141
|
end
|
138
|
-
|
139
|
-
|
142
|
+
|
143
|
+
|
140
144
|
def evaluate_command_reset
|
141
145
|
if @args[1] == nil
|
142
146
|
puts CliHelp.new(:reset).message
|
143
|
-
|
147
|
+
|
144
148
|
else
|
145
149
|
case @args[1]
|
150
|
+
when 'compiled'
|
151
|
+
Controller.new(@current_working_directory).reset_compiled
|
146
152
|
when 'css'
|
147
153
|
Controller.new(@current_working_directory).reset_css
|
148
154
|
else
|
@@ -150,24 +156,29 @@ module Muwu
|
|
150
156
|
end
|
151
157
|
end
|
152
158
|
end
|
153
|
-
|
154
|
-
|
159
|
+
|
160
|
+
|
155
161
|
def evaluate_command_sync
|
156
162
|
if @args[1] == nil
|
157
163
|
puts CliHelp.new(:sync).message
|
158
|
-
|
164
|
+
|
159
165
|
else
|
160
166
|
case @args[1]
|
161
167
|
when 'down'
|
162
168
|
Controller.new(@current_working_directory).sync_down(@args[2..(@args.length-1)])
|
163
169
|
when 'up'
|
164
170
|
Controller.new(@current_working_directory).sync_up(@args[2..(@args.length-1)])
|
165
|
-
else
|
171
|
+
else
|
166
172
|
puts CliHelp.new(:sync).message
|
167
173
|
end
|
168
174
|
end
|
169
175
|
end
|
170
|
-
|
176
|
+
|
177
|
+
|
178
|
+
def evaluate_command_view
|
179
|
+
Controller.new(@current_working_directory).view
|
180
|
+
end
|
181
|
+
|
171
182
|
|
172
183
|
end
|
173
184
|
end
|
data/lib/muwu/cli/help/publish
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
-
- muwu publish
|
2
|
-
- Publishes compiled documents
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
- muwu publish [options]
|
2
|
+
- Publishes compiled documents currently in `compiled/` to a remote location
|
3
|
+
using rsync. Rsync must be installed on the local system.
|
4
|
+
|
5
|
+
- [options]
|
6
|
+
- dry-run: invoke the rsync '-n' switch to show which files will be
|
7
|
+
transferred, but do not actually transfer any files.
|
7
8
|
|
9
|
+
* Specify the remote host in 'options.yml' using the 'remote_publish' value.
|
data/lib/muwu/cli/help/reset
CHANGED
@@ -1,7 +1,10 @@
|
|
1
|
+
- muwu reset compiled
|
2
|
+
- Clear the entire contentes of the `compiled/` folder.
|
3
|
+
|
1
4
|
- muwu reset css
|
2
5
|
- Reset the `config/css` folder. The following files and folders will
|
3
6
|
revert to their original state:
|
4
|
-
|
7
|
+
|
5
8
|
- config/css/base/
|
6
9
|
- config/css/colors/dark.scss
|
7
10
|
- config/css/colors/index.scss
|
@@ -10,5 +13,5 @@
|
|
10
13
|
|
11
14
|
* If `config/css/extensions` does exist, it and its contents will remain
|
12
15
|
unchanged.
|
13
|
-
|
16
|
+
|
14
17
|
* If `config/css/extensions` does not exist, Muwu will create it.
|
data/lib/muwu/cli/help/summary
CHANGED
@@ -6,11 +6,13 @@ Command line:
|
|
6
6
|
muwu help show this message
|
7
7
|
muwu inspect inspect a project
|
8
8
|
muwu new create a new project directory
|
9
|
-
muwu publish publish to a remote server (requires
|
9
|
+
muwu publish publish to a remote server (requires rsync)
|
10
|
+
muwu reset compiled reset the `compiled/` subdirectory
|
10
11
|
muwu reset css reset the default CSS files
|
11
12
|
muwu sync syncronize from/to a remote server (requires rsync)
|
13
|
+
muwu view view a compiled project (requires lynx)
|
12
14
|
|
13
|
-
All
|
15
|
+
All commands operate within the current working directory.
|
14
16
|
|
15
17
|
For more detailed instructions:
|
16
18
|
muwu help [command]
|
data/lib/muwu/cli/help/sync
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
- muwu sync [down | up] [options]
|
2
2
|
- Synchronize project from/to a remote location using rsync. Rsync must be
|
3
3
|
installed on the local system.
|
4
|
-
|
4
|
+
|
5
5
|
- muwu sync down
|
6
6
|
- Use rsync to download the project from a remote host.
|
7
|
-
|
7
|
+
|
8
8
|
- muwu sync up
|
9
9
|
- Use rsync to upload to project to a remote host.
|
10
|
-
|
10
|
+
|
11
11
|
- [options]
|
12
12
|
- dry-run: invoke the rsync '-n' switch to show which files will be
|
13
|
-
transferred, but do not actually transfer files.
|
14
|
-
|
13
|
+
transferred, but do not actually transfer any files.
|
14
|
+
|
15
15
|
* Specify the remote host in 'options.yml' using the 'remote_sync' value.
|
16
|
-
|
16
|
+
|
17
17
|
* Muwu will invoke the rsync switches '-r' to recurse subdirectories, and
|
18
18
|
'-v' to give a verbose description
|
@@ -3,7 +3,7 @@ module Muwu
|
|
3
3
|
|
4
4
|
|
5
5
|
include Muwu
|
6
|
-
|
6
|
+
|
7
7
|
|
8
8
|
def initialize(current_working_directory)
|
9
9
|
@current_working_directory = File.absolute_path(current_working_directory)
|
@@ -20,11 +20,11 @@ module Muwu
|
|
20
20
|
if @project.does_not_have_crucial_files
|
21
21
|
reply_folder_does_not_have_valid_project
|
22
22
|
else
|
23
|
-
RenderHtml.new(@project).
|
23
|
+
RenderHtml.new(@project).render_all
|
24
24
|
end
|
25
25
|
end
|
26
|
-
|
27
|
-
|
26
|
+
|
27
|
+
|
28
28
|
def compile_css
|
29
29
|
@project = read_project_from_current_working_directory
|
30
30
|
if @project.does_not_have_crucial_files
|
@@ -33,8 +33,8 @@ module Muwu
|
|
33
33
|
RenderHtml.new(@project).render_css_only
|
34
34
|
end
|
35
35
|
end
|
36
|
-
|
37
|
-
|
36
|
+
|
37
|
+
|
38
38
|
def compile_html_by_index(index)
|
39
39
|
@project = read_project_from_current_working_directory
|
40
40
|
if @project.does_not_have_crucial_files
|
@@ -43,7 +43,7 @@ module Muwu
|
|
43
43
|
RenderHtml.new(@project).render_html_by_index(index)
|
44
44
|
end
|
45
45
|
end
|
46
|
-
|
46
|
+
|
47
47
|
|
48
48
|
def compile_html
|
49
49
|
@project = read_project_from_current_working_directory
|
@@ -53,8 +53,8 @@ module Muwu
|
|
53
53
|
RenderHtml.new(@project).render_html_only
|
54
54
|
end
|
55
55
|
end
|
56
|
-
|
57
|
-
|
56
|
+
|
57
|
+
|
58
58
|
def compile_js
|
59
59
|
@project = read_project_from_current_working_directory
|
60
60
|
if @project.does_not_have_crucial_files
|
@@ -63,8 +63,8 @@ module Muwu
|
|
63
63
|
RenderHtml.new(@project).render_js_only
|
64
64
|
end
|
65
65
|
end
|
66
|
-
|
67
|
-
|
66
|
+
|
67
|
+
|
68
68
|
def concat
|
69
69
|
@project = read_project_from_current_working_directory
|
70
70
|
if @project.does_not_have_crucial_files
|
@@ -73,8 +73,8 @@ module Muwu
|
|
73
73
|
RenderConcat.new(@project).render
|
74
74
|
end
|
75
75
|
end
|
76
|
-
|
77
|
-
|
76
|
+
|
77
|
+
|
78
78
|
def inspect
|
79
79
|
@project = read_project_from_current_working_directory
|
80
80
|
if @project.does_not_have_crucial_files
|
@@ -90,14 +90,30 @@ module Muwu
|
|
90
90
|
@project = ProjectStarter.new(@current_working_directory, metadata).new_project
|
91
91
|
ProjectWriter.new(@project).write
|
92
92
|
end
|
93
|
-
|
94
|
-
|
95
|
-
def publish
|
93
|
+
|
94
|
+
|
95
|
+
def publish(args)
|
96
|
+
@project = read_project_from_current_working_directory
|
97
|
+
if @project.does_not_have_crucial_files
|
98
|
+
reply_folder_does_not_have_valid_project
|
99
|
+
else
|
100
|
+
Publish.new(@project, args: args).up
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
|
105
|
+
def reset_compiled
|
96
106
|
@project = read_project_from_current_working_directory
|
97
|
-
|
107
|
+
if @project.does_not_have_crucial_files
|
108
|
+
reply_folder_does_not_have_valid_project
|
109
|
+
else
|
110
|
+
if ControllerInteraction.new.confirm_reset_compiled(@project)
|
111
|
+
ProjectResetCompiled.new(@project).reset_compiled
|
112
|
+
end
|
113
|
+
end
|
98
114
|
end
|
99
|
-
|
100
|
-
|
115
|
+
|
116
|
+
|
101
117
|
def reset_css
|
102
118
|
@project = read_project_from_current_working_directory
|
103
119
|
if @project.does_not_have_crucial_files
|
@@ -106,24 +122,42 @@ module Muwu
|
|
106
122
|
ProjectResetCss.new(@project).reset_css
|
107
123
|
end
|
108
124
|
end
|
109
|
-
|
110
|
-
|
125
|
+
|
126
|
+
|
111
127
|
def sync_down(args)
|
112
128
|
@project = read_project_from_current_working_directory
|
113
|
-
|
129
|
+
if @project.does_not_have_crucial_files
|
130
|
+
reply_folder_does_not_have_valid_project
|
131
|
+
else
|
132
|
+
Sync.new(@project, args: args).down
|
133
|
+
end
|
114
134
|
end
|
115
|
-
|
116
|
-
|
135
|
+
|
136
|
+
|
117
137
|
def sync_up(args)
|
118
138
|
@project = read_project_from_current_working_directory
|
119
|
-
|
139
|
+
if @project.does_not_have_crucial_files
|
140
|
+
reply_folder_does_not_have_valid_project
|
141
|
+
else
|
142
|
+
Sync.new(@project, args: args).up
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
|
147
|
+
def view
|
148
|
+
@project = read_project_from_current_working_directory
|
149
|
+
if @project.does_not_have_crucial_files
|
150
|
+
reply_folder_does_not_have_valid_project
|
151
|
+
else
|
152
|
+
Viewer.new(@project)
|
153
|
+
end
|
120
154
|
end
|
121
155
|
|
122
156
|
|
123
157
|
|
124
158
|
private
|
125
|
-
|
126
|
-
|
159
|
+
|
160
|
+
|
127
161
|
def read_project_from_current_working_directory
|
128
162
|
ProjectReader.build { |b| b.load_path(@current_working_directory) }
|
129
163
|
end
|
@@ -131,8 +165,9 @@ module Muwu
|
|
131
165
|
|
132
166
|
def reply_folder_does_not_have_valid_project
|
133
167
|
puts @project.exceptions
|
134
|
-
puts "Is this a Muwu project folder?"
|
168
|
+
puts "Is this a Muwu project home folder?"
|
135
169
|
end
|
136
170
|
|
171
|
+
|
137
172
|
end
|
138
173
|
end
|
data/lib/muwu/default/default.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Muwu
|
2
2
|
module Default
|
3
|
-
|
4
|
-
|
3
|
+
|
4
|
+
|
5
5
|
FILENAMES = {
|
6
6
|
css_manifest: 'index.scss',
|
7
7
|
metadata: 'metadata.yml',
|
@@ -9,8 +9,9 @@ module Muwu
|
|
9
9
|
outline: 'outline.yml'
|
10
10
|
}
|
11
11
|
|
12
|
-
|
12
|
+
|
13
13
|
FILEPATHS = {
|
14
|
+
compiled: './compiled',
|
14
15
|
css: './config/css',
|
15
16
|
metadata: '',
|
16
17
|
options: '',
|
@@ -18,8 +19,9 @@ module Muwu
|
|
18
19
|
text: './text'
|
19
20
|
}
|
20
21
|
|
21
|
-
|
22
|
+
|
22
23
|
PROJECT_OPTIONS = {
|
24
|
+
expunge_when_compiling_all: true,
|
23
25
|
generate_navigators_automatically: true,
|
24
26
|
generate_subcontents_automatically: false,
|
25
27
|
html_head_includes_metadata_tags: true,
|
@@ -42,12 +44,12 @@ module Muwu
|
|
42
44
|
render_title_section_metadata: ['title', 'subtitle', 'author'],
|
43
45
|
warning_if_parent_heading_lacks_source: true
|
44
46
|
}
|
45
|
-
|
46
|
-
|
47
|
+
|
48
|
+
|
47
49
|
PROJECT_OUTLINE = {
|
48
50
|
default_text_block_name: 'main'
|
49
51
|
}
|
50
|
-
|
51
|
-
|
52
|
+
|
53
|
+
|
52
54
|
end
|
53
|
-
end
|
55
|
+
end
|