liquidoc 0.9.4 → 0.9.5

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: b37eeec640e508911c065f9e9061c3f7b699ed7a939e4e827f468bba377b54d1
4
- data.tar.gz: 559ed408ee31cb7f3f12deb07d0da7ac6b09e79d2b3fe7b52892ad39707379bd
3
+ metadata.gz: 12b5d860a86e2b0c934b1cfc196df2a4ff6c92261eeea9770259716874f4b27f
4
+ data.tar.gz: 81e2e73815e12bccd7c4c09217ba1d86f6d8a96e4584842ebe2d2668958fe341
5
5
  SHA512:
6
- metadata.gz: 2a1979905f8eb82a27cc8cc1cc2b97b8ff94c610cd9e18e26c75ee7ad99ed2af0aac074675f4c1a516b0a761b2966f801275511ea879618d1f9269c401239779
7
- data.tar.gz: 57baff39f8f07381556c67916a060cf76e97ded4975d2ada78d6101bd18a28683f61efae42cbf81002e955767f6d7e9a576215b55fc297ee3eb2d01435a975bc
6
+ metadata.gz: b2c552ee847fc84d2a45333f00923c8a1d5305fa3db8a4c262b2ebfec7da234222471e7e5a88e72edff1b9c88213a092d9fc2caa083a671f56a05f406ccd3d7c
7
+ data.tar.gz: 60fa6c8196d38b609f5a59f8d922c89d25926d4122bb437e82b455a3c3ad2902b61bb6c9269e59acff97c425c6a11b02e0b7e97f2da1bc74409251098d43f2fd
@@ -0,0 +1,13 @@
1
+ require 'asciidoctor/extensions' unless RUBY_ENGINE == 'opal'
2
+
3
+ include Asciidoctor
4
+
5
+ Extensions.register {
6
+ preprocessor {
7
+ process {|document, reader|
8
+ Reader.new reader.readlines.map {|l|
9
+ (l.empty? || (l.start_with? '=')) ? l : %(#{l} +)
10
+ }
11
+ }
12
+ }
13
+ }
@@ -1,3 +1,3 @@
1
1
  module Liquidoc
2
- VERSION = "0.9.4"
2
+ VERSION = "0.9.5"
3
3
  end
data/lib/liquidoc.rb CHANGED
@@ -123,8 +123,12 @@ def iterate_build cfg
123
123
  end
124
124
  when "migrate"
125
125
  inclusive = true
126
- inclusive = step.options['inclusive'] if defined?(step.options['inclusive'])
127
- copy_assets(step.source, step.target, inclusive)
126
+ missing = "exit"
127
+ if step.options
128
+ inclusive = step.options['inclusive'] if step.options.has_key?("inclusive")
129
+ missing = step.options['missing'] if step.options.has_key?("missing")
130
+ end
131
+ copy_assets(step.source, step.target, inclusive, missing)
128
132
  when "render"
129
133
  validate_file_input(step.source, "source") if step.source
130
134
  builds = step.builds
@@ -252,6 +256,7 @@ class BuildConfigStep
252
256
  if (defined?(@step['action'])).nil?
253
257
  raise "ConfigStructError"
254
258
  end
259
+ @step['options'] = nil unless defined?(step['options'])
255
260
  validate()
256
261
  end
257
262
 
@@ -787,11 +792,25 @@ end
787
792
  # ===
788
793
 
789
794
  # Copy images and other files into target dir
790
- def copy_assets src, dest, inclusive=true
795
+ def copy_assets src, dest, inclusive=true, missing='exit'
791
796
  unless File.file?(src)
792
797
  unless inclusive then src = src + "/." end
793
798
  end
794
- @logger.debug "Copying #{src} to #{dest}"
799
+ src_to_dest = "#{src} to #{dest}"
800
+ unless (File.file?(src) || File.directory?(src))
801
+ case missing
802
+ when "warn"
803
+ @logger.warn "Skipping migrate action (#{src_to_dest}); source not found."
804
+ return
805
+ when "skip"
806
+ @logger.debug "Skipping migrate action (#{src_to_dest}); source not found."
807
+ return
808
+ when "exit"
809
+ @logger.error "Unexpected missing source in migrate action (#{src_to_dest})."
810
+ raise "MissingSourceExit"
811
+ end
812
+ end
813
+ @logger.debug "Copying #{src_to_dest}"
795
814
  begin
796
815
  FileUtils.mkdir_p(dest) unless File.directory?(dest)
797
816
  if File.directory?(src)
@@ -801,7 +820,7 @@ def copy_assets src, dest, inclusive=true
801
820
  end
802
821
  @logger.info "Copied #{src} to #{dest}."
803
822
  rescue Exception => ex
804
- @logger.warn "Problem while copying assets. #{ex.message}"
823
+ @logger.error "Problem while copying assets. #{ex.message}"
805
824
  raise
806
825
  end
807
826
  end
@@ -905,6 +924,9 @@ def asciidocify doc, build
905
924
  if build.backend == "pdf"
906
925
  @logger.info "Generating PDF. This can take some time..."
907
926
  end
927
+
928
+
929
+
908
930
  Asciidoctor.convert_file(
909
931
  doc.index,
910
932
  to_file: to_file,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: liquidoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Dominick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-20 00:00:00.000000000 Z
11
+ date: 2019-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -49,6 +49,7 @@ extensions: []
49
49
  extra_rdoc_files: []
50
50
  files:
51
51
  - bin/liquidoc
52
+ - lib/asciidoctor/xref-stripper-preprocessor.rb
52
53
  - lib/liquidoc.rb
53
54
  - lib/liquidoc/version.rb
54
55
  homepage: https://github.com/scalingdata/liquidoc
@@ -72,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
73
  version: '0'
73
74
  requirements: []
74
75
  rubyforge_project:
75
- rubygems_version: 2.7.7
76
+ rubygems_version: 2.7.6
76
77
  signing_key:
77
78
  specification_version: 4
78
79
  summary: A highly configurable command-line tool for parsing data and content in common