muwu 3.1.0 → 3.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb244270b9a3f8c14b33190cd8145d7e2492d7360185f7004df15ddce25b8a63
4
- data.tar.gz: 647c1138722fd6dc8a4bf9ad41776797b1dffed79e5dd2e39c21a0e109633831
3
+ metadata.gz: 577c99af43ab26d7d3c9bf2fb9360b1778fb1affbdbce0328b38c0650b2a688a
4
+ data.tar.gz: 8af68dc1a7130c59efdda85afc0c76876c01d2eac79fb915616557ab0800bc76
5
5
  SHA512:
6
- metadata.gz: f0031172eff2715affff5e76f0dcf93159e08f443a8d8efb86d1d7c237be8c3dc49a18cac38f79c23cab4e2670f7a19d180ca4eeb20c15fca4cb08ff0449181d
7
- data.tar.gz: 790dcbeda168f13f47da07a868b9f71fabac2d1ecb2f015f8b6bbc94f128116be66bc0d613b418993a624858896fee2e49d7d0c0f086b0a22f560e2527bd3fcd
6
+ metadata.gz: 6be10f4e37e5470ad79fb598eda0bbc02bfe4e76d1dc059f17bf8f32de90576098372691e2979c3a53a8a5d275ebc430bf7be215128755fa14417eeb682fc53b
7
+ data.tar.gz: eb55d4dd1d75f943fd600f849cd333a0c8c5721dfd2c42067b911a58f3f7d52dba0e3cbb5c429ec3806ce75863fc0419b9253409e00ffe527979c27a881e365c
@@ -1,8 +1,6 @@
1
1
  - muwu concat
2
2
  - Combine all source files from the outline into a single markdown
3
3
  document.
4
-
5
- * Compiling a project will overwrite any previous output files without
6
- any warning.
7
4
 
8
- * This feature is still experimental.
5
+ * Compiling a project will overwrite any previous output files without
6
+ any warning.
@@ -149,7 +149,7 @@ module Muwu
149
149
  if @project.does_not_have_crucial_files
150
150
  reply_folder_does_not_have_valid_project
151
151
  else
152
- Viewer.new(@project)
152
+ Viewer.new(@project).view
153
153
  end
154
154
  end
155
155
 
@@ -0,0 +1,23 @@
1
+ module Muwu
2
+ module ProjectException
3
+ class ViewerMissingHomeDocument
4
+
5
+
6
+ def initialize
7
+ $stderr.puts "#{self.class}"
8
+ end
9
+
10
+
11
+ def report
12
+ "Viewer cannot find a compiled home document."
13
+ end
14
+
15
+
16
+ def type
17
+ :view
18
+ end
19
+
20
+
21
+ end
22
+ end
23
+ end
@@ -8,23 +8,30 @@ module Muwu
8
8
  def initialize(project)
9
9
  document_home = project.manifest.find_document_html_by_index(0)
10
10
  if document_home
11
- document_home_filepath = File.join(project.path_compiled, document_home.filename)
12
- initialize_viewer(document_home_filepath)
11
+ @document_home_filepath = File.join(project.path_compiled, document_home.filename)
13
12
  else
14
- puts "No documents in outline to view."
13
+ raise ProjectExceptionHandler::Fatal.new(ProjectException::ViewerMissingHomeDocument.new)
15
14
  end
16
15
  end
17
16
 
18
17
 
19
- def initialize_viewer(document_home_filepath)
20
- if File.exist?(document_home_filepath)
21
- begin
22
- system "lynx #{document_home_filepath}", exception: true
23
- rescue Errno::ENOENT
24
- raise ProjectExceptionHandler::Fatal.new(ProjectException::LynxNotAvailable.new)
25
- end
18
+ public
19
+
20
+
21
+ def view
22
+ if @document_home_filepath && File.exist?(@document_home_filepath)
23
+ view_home_document
26
24
  else
27
- puts "Compiled document not found: #{document_home_filepath}"
25
+ raise ProjectExceptionHandler::Fatal.new(ProjectException::ViewerMissingHomeDocument.new)
26
+ end
27
+ end
28
+
29
+
30
+ def view_home_document
31
+ begin
32
+ system "lynx #{@document_home_filepath}", exception: true
33
+ rescue Errno::ENOENT
34
+ raise ProjectExceptionHandler::Fatal.new(ProjectException::LynxNotAvailable.new)
28
35
  end
29
36
  end
30
37
 
data/lib/muwu.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Muwu
2
2
 
3
3
 
4
- VERSION = '3.1.0'
4
+ VERSION = '3.2.0'
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'))
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.1.0
4
+ version: 3.2.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: 2023-12-09 00:00:00.000000000 Z
11
+ date: 2023-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commonmarker
@@ -209,6 +209,7 @@ files:
209
209
  - lib/muwu/project_exception/subcontents_will_be_generated_automatically copy.rb
210
210
  - lib/muwu/project_exception/target_project_folder_already_exists.rb
211
211
  - lib/muwu/project_exception/text_source_file_not_found.rb
212
+ - lib/muwu/project_exception/viewer_missing_home_document.rb
212
213
  - lib/muwu/project_exception_handler/fatal.rb
213
214
  - lib/muwu/project_options/project_options.rb
214
215
  - lib/muwu/project_options_builder/project_option_validator.rb