review-retrovert 0.9.2 → 0.9.3

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: fdd00a05ee2fe184542575f75ff8b5f7541ea11ead119c28b1b00e00d38aeab8
4
- data.tar.gz: 6a1dcf4eedabf43d6be0b8bf7814dc11d30d8798730a95e33ed6a95cda59173d
3
+ metadata.gz: 978ce194146ec4de6a7ece5ac4ba182e6eff60670836f952f22578a25ec10a9e
4
+ data.tar.gz: 6889acc0183d72d30b7f87fdbd0fc4e5bd986b350d4c7fae8ba8e5895e7a476b
5
5
  SHA512:
6
- metadata.gz: 4f3748ae4c99d94ecb773de86501b720712f25381061055d42e12186f795775ad0a359e7c901b089fa804f82e9fb3d8506a17aeb693d51d14138a80a5b3a8256
7
- data.tar.gz: 7126a6536e53cceb34e41c9b606d6974b336bd6afb8d6391a279db5ba16ba3b3939aea4b9efcda8a51c0a2221ef0f1226aa4849625e90cd8e25a2e5900d2299f
6
+ metadata.gz: 2246191d2e227e1c8a4d322a9d9ec4f84e85904285e4952cabc6df9a87f89f1eab761edda301aca5e950494aa341e8e9ebeb4675118450082d841eea909c982e
7
+ data.tar.gz: c8f3757ef2da91d51c5fed0954e5ef4c710bbaee3fe014e728ae16d5f3a47bc10861910dc2d121a085e8ba14a7380ccf02e664f81ee64c582b6ba3b21e750078
@@ -8,12 +8,22 @@ name: Retrovert
8
8
  jobs:
9
9
  review:
10
10
  runs-on: ubuntu-latest
11
+ strategy:
12
+ matrix:
13
+ review-version: [ "3.2", "4.2", "5.0" ]
14
+ fail-fast: false
11
15
  steps:
12
16
  - uses: actions/checkout@v2
13
17
  - uses: ruby/setup-ruby@v1
14
18
  with:
15
19
  ruby-version: 2.6
16
- - run: bundle install
20
+ - run: |
21
+ rm -f Gemfile.lock
22
+ cp Gemfile Gemfile-${{ matrix.review-version }}
23
+ echo 'gem "review", "${{ matrix.review-version }}"' >> Gemfile-${{ matrix.review-version }}
24
+ cat Gemfile-${{ matrix.review-version }}
25
+ echo "BUNDLE_GEMFILE=Gemfile-${{ matrix.review-version }}" >> $GITHUB_ENV
26
+ - run: bundle install --gemfile=Gemfile-${{ matrix.review-version }}
17
27
  # spec
18
28
  - name: spec
19
29
  run: bundle exec rake spec
@@ -21,19 +31,31 @@ jobs:
21
31
  - name: convert
22
32
  run: bundle exec review-retrovert convert testdata/mybook/config.yml tmp -f
23
33
  # build
24
- - name: review build
25
- uses: docker://srzzumix/review-retrovert
34
+ # - name: review build
35
+ # uses: ${{ matrix.uses }}
36
+ # with:
37
+ # entrypoint: bash
38
+ # args: -c "cd tmp; rake preproc all"
39
+ # docker login
40
+ - name: Login to DockerHub
41
+ uses: docker/login-action@v1
26
42
  with:
27
- entrypoint: bash
28
- args: -c "cd tmp; rake preproc all"
43
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
44
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
45
+ - name: build html
46
+ run: |
47
+ docker run --rm -v "$(pwd)/tmp":/work -w /work vvakame/review:${{ matrix.review-version }} rake preproc html
48
+ - name: build pdf
49
+ run: |
50
+ docker run --rm -v "$(pwd)/tmp":/work -w /work vvakame/review:${{ matrix.review-version }} rake preproc pdf
29
51
  # artifacts
30
52
  - name: artifacts
31
53
  uses: actions/upload-artifact@v1
32
54
  with:
33
55
  name: mybook
34
56
  path: tmp/mybook.pdf
35
- - name: artifacts
36
- uses: actions/upload-artifact@v1
37
- with:
38
- name: mybook
39
- path: tmp/mybook.epub
57
+ # - name: artifacts
58
+ # uses: actions/upload-artifact@v1
59
+ # with:
60
+ # name: mybook
61
+ # path: tmp/mybook.epub
data/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM vvakame/review:3.2
1
+ FROM vvakame/review:5.0
2
2
 
3
3
  RUN gem install review-retrovert
4
4
 
data/Gemfile CHANGED
@@ -5,4 +5,4 @@ gemspec
5
5
 
6
6
  gem "rake", "~> 12.0"
7
7
  gem "rspec", "~> 3.0"
8
- gem 'aruba', '~> 1.0.2'
8
+ gem 'aruba', '~> 1.0.2'
@@ -1,68 +1,67 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- review-retrovert (0.9.2)
5
- review (>= 3.2.0, < 4.0)
4
+ review-retrovert (0.9.3)
5
+ review (>= 3.2.0)
6
6
  thor
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (6.0.3.2)
11
+ activesupport (6.1.1)
12
12
  concurrent-ruby (~> 1.0, >= 1.0.2)
13
- i18n (>= 0.7, < 2)
14
- minitest (~> 5.1)
15
- tzinfo (~> 1.1)
16
- zeitwerk (~> 2.2, >= 2.2.2)
17
- aruba (1.0.2)
13
+ i18n (>= 1.6, < 2)
14
+ minitest (>= 5.1)
15
+ tzinfo (~> 2.0)
16
+ zeitwerk (~> 2.3)
17
+ aruba (1.0.4)
18
18
  childprocess (>= 2.0, < 5.0)
19
19
  contracts (~> 0.16.0)
20
- cucumber (>= 2.4, < 5.0)
21
- ffi (~> 1.9)
20
+ cucumber (>= 2.4, < 6.0)
22
21
  rspec-expectations (~> 3.4)
23
22
  thor (~> 1.0)
24
23
  builder (3.2.4)
25
24
  childprocess (4.0.0)
26
- concurrent-ruby (1.1.6)
25
+ concurrent-ruby (1.1.7)
27
26
  contracts (0.16.0)
28
- cucumber (4.1.0)
29
- builder (~> 3.2, >= 3.2.3)
30
- cucumber-core (~> 7.1, >= 7.1.0)
31
- cucumber-create-meta (~> 1.0.0, >= 1.0.0)
32
- cucumber-cucumber-expressions (~> 10.1, >= 10.1.0)
33
- cucumber-gherkin (~> 14.0, >= 14.0.1)
34
- cucumber-html-formatter (~> 7.0, >= 7.0.0)
35
- cucumber-messages (~> 12.2, >= 12.2.0)
36
- cucumber-wire (~> 3.1, >= 3.1.0)
37
- diff-lcs (~> 1.3, >= 1.3, < 1.4)
27
+ cucumber (5.2.0)
28
+ builder (~> 3.2, >= 3.2.4)
29
+ cucumber-core (~> 8.0, >= 8.0.1)
30
+ cucumber-create-meta (~> 2.0, >= 2.0.2)
31
+ cucumber-cucumber-expressions (~> 10.3, >= 10.3.0)
32
+ cucumber-gherkin (~> 15.0, >= 15.0.2)
33
+ cucumber-html-formatter (~> 9.0, >= 9.0.0)
34
+ cucumber-messages (~> 13.1, >= 13.1.0)
35
+ cucumber-wire (~> 4.0, >= 4.0.1)
36
+ diff-lcs (~> 1.4, >= 1.4.4)
38
37
  multi_test (~> 0.1, >= 0.1.2)
39
- sys-uname (~> 1.0, >= 1.0.2)
40
- cucumber-core (7.1.0)
41
- cucumber-gherkin (~> 14.0, >= 14.0.1)
42
- cucumber-messages (~> 12.2, >= 12.2.0)
38
+ sys-uname (~> 1.2, >= 1.2.1)
39
+ cucumber-core (8.0.1)
40
+ cucumber-gherkin (~> 15.0, >= 15.0.2)
41
+ cucumber-messages (~> 13.0, >= 13.0.1)
43
42
  cucumber-tag-expressions (~> 2.0, >= 2.0.4)
44
- cucumber-create-meta (1.0.0)
45
- cucumber-messages (~> 12.2, >= 12.2.0)
43
+ cucumber-create-meta (2.0.4)
44
+ cucumber-messages (~> 13.1, >= 13.1.0)
46
45
  sys-uname (~> 1.2, >= 1.2.1)
47
- cucumber-cucumber-expressions (10.2.2)
48
- cucumber-gherkin (14.2.0)
49
- cucumber-messages (~> 12.4, >= 12.4.0)
50
- cucumber-html-formatter (7.2.0)
51
- cucumber-messages (~> 12.4, >= 12.4.0)
52
- cucumber-messages (12.4.0)
46
+ cucumber-cucumber-expressions (10.3.0)
47
+ cucumber-gherkin (15.0.2)
48
+ cucumber-messages (~> 13.0, >= 13.0.1)
49
+ cucumber-html-formatter (9.0.0)
50
+ cucumber-messages (~> 13.0, >= 13.0.1)
51
+ cucumber-messages (13.2.1)
53
52
  protobuf-cucumber (~> 3.10, >= 3.10.8)
54
53
  cucumber-tag-expressions (2.0.4)
55
- cucumber-wire (3.1.0)
56
- cucumber-core (~> 7.1, >= 7.1.0)
57
- cucumber-cucumber-expressions (~> 10.1, >= 10.1.0)
58
- cucumber-messages (~> 12.2, >= 12.2.0)
59
- diff-lcs (1.3)
60
- ffi (1.13.1)
61
- i18n (1.8.5)
54
+ cucumber-wire (4.0.1)
55
+ cucumber-core (~> 8.0, >= 8.0.1)
56
+ cucumber-cucumber-expressions (~> 10.3, >= 10.3.0)
57
+ cucumber-messages (~> 13.0, >= 13.0.1)
58
+ diff-lcs (1.4.4)
59
+ ffi (1.14.2)
60
+ i18n (1.8.7)
62
61
  concurrent-ruby (~> 1.0)
63
62
  image_size (2.1.0)
64
63
  middleware (0.1.0)
65
- minitest (5.14.1)
64
+ minitest (5.14.3)
66
65
  multi_test (0.1.2)
67
66
  protobuf-cucumber (3.10.8)
68
67
  activesupport (>= 3.2)
@@ -70,32 +69,32 @@ GEM
70
69
  thor
71
70
  thread_safe
72
71
  rake (12.3.3)
73
- review (3.2.0)
72
+ review (5.0.0)
74
73
  image_size
75
74
  rouge
76
75
  rubyzip
77
76
  rouge (3.26.0)
78
- rspec (3.9.0)
79
- rspec-core (~> 3.9.0)
80
- rspec-expectations (~> 3.9.0)
81
- rspec-mocks (~> 3.9.0)
82
- rspec-core (3.9.1)
83
- rspec-support (~> 3.9.1)
84
- rspec-expectations (3.9.1)
77
+ rspec (3.10.0)
78
+ rspec-core (~> 3.10.0)
79
+ rspec-expectations (~> 3.10.0)
80
+ rspec-mocks (~> 3.10.0)
81
+ rspec-core (3.10.1)
82
+ rspec-support (~> 3.10.0)
83
+ rspec-expectations (3.10.1)
85
84
  diff-lcs (>= 1.2.0, < 2.0)
86
- rspec-support (~> 3.9.0)
87
- rspec-mocks (3.9.1)
85
+ rspec-support (~> 3.10.0)
86
+ rspec-mocks (3.10.1)
88
87
  diff-lcs (>= 1.2.0, < 2.0)
89
- rspec-support (~> 3.9.0)
90
- rspec-support (3.9.2)
88
+ rspec-support (~> 3.10.0)
89
+ rspec-support (3.10.1)
91
90
  rubyzip (2.3.0)
92
- sys-uname (1.2.1)
93
- ffi (>= 1.0.0)
91
+ sys-uname (1.2.2)
92
+ ffi (~> 1.1)
94
93
  thor (1.0.1)
95
94
  thread_safe (0.3.6)
96
- tzinfo (1.2.7)
97
- thread_safe (~> 0.1)
98
- zeitwerk (2.4.0)
95
+ tzinfo (2.0.4)
96
+ concurrent-ruby (~> 1.0)
97
+ zeitwerk (2.4.2)
99
98
 
100
99
  PLATFORMS
101
100
  ruby
@@ -67,6 +67,9 @@ module ReVIEW
67
67
  @configs.rewrite_yml('contentdir', '.')
68
68
  @configs.rewrite_yml('hook_beforetexcompile', 'null')
69
69
  @configs.rewrite_yml('texstyle', '["reviewmacro"]')
70
+ @configs.rewrite_yml('chapterlink', 'null')
71
+ pagesize = @config['starter']['pagesize'].downcase
72
+ @configs.rewrite_yml_array('texdocumentclass', "[\"review-jsbook\", \"media=print,paper=#{pagesize}\"]")
70
73
  end
71
74
 
72
75
  def replace_compatible_block_command_outline(content, command, new_command, option_count)
@@ -173,17 +176,29 @@ module ReVIEW
173
176
  end
174
177
 
175
178
  def replace_block_command_nested_boxed_articles(content)
176
- replace_block_command_nested_boxed_article(content, 'note')
177
- replace_block_command_nested_boxed_article(content, 'memo')
178
- replace_block_command_nested_boxed_article(content, 'tip')
179
- replace_block_command_nested_boxed_article(content, 'info')
180
- replace_block_command_nested_boxed_article(content, 'warning')
181
- replace_block_command_nested_boxed_article(content, 'important')
182
- replace_block_command_nested_boxed_article(content, 'caution')
183
- replace_block_command_nested_boxed_article(content, 'notice')
179
+ unless Gem::Version.new(ReVIEW::VERSION) >= Gem::Version.new('5.0.0')
180
+ replace_block_command_nested_boxed_article(content, 'note')
181
+ replace_block_command_nested_boxed_article(content, 'memo')
182
+ replace_block_command_nested_boxed_article(content, 'tip')
183
+ replace_block_command_nested_boxed_article(content, 'info')
184
+ replace_block_command_nested_boxed_article(content, 'warning')
185
+ replace_block_command_nested_boxed_article(content, 'important')
186
+ replace_block_command_nested_boxed_article(content, 'caution')
187
+ replace_block_command_nested_boxed_article(content, 'notice')
188
+ end
184
189
  end
185
190
 
186
191
  def replace_block_commentout(content)
192
+ d = content.dup
193
+ d.scan(/(^#@)(\++)(.*?)(^#@)(-+)/m) { |m|
194
+ matched = m[0..-1].join
195
+ inner = m[2]
196
+ inner.gsub!(/(^.)/, '#@#\1')
197
+ content.gsub!(/#{Regexp.escape(matched)}/m, "#@##{m[1]}#{inner}#@##{m[4]}")
198
+ }
199
+ end
200
+
201
+ def replace_block_commentout_without_sampleout(content)
187
202
  d = content.dup
188
203
  d.gsub!(/(^\/\/sampleoutputbegin\[)(.*?)(\])(.*?)(^\/\/sampleoutputend)/m, '')
189
204
  d.scan(/(^#@)(\++)(.*?)(^#@)(-+)/m) { |m|
@@ -195,7 +210,7 @@ module ReVIEW
195
210
  end
196
211
 
197
212
  def replace_sampleoutput(content)
198
- replace_block_commentout(content)
213
+ # replace_block_commentout_without_sampleout(content)
199
214
  content.dup.scan(/(^\/\/sampleoutputbegin\[)(.*?)(\].*?\R)(.*?)(^\/\/sampleoutputend)/m) { |m|
200
215
  matched = m[0..-1].join
201
216
  sampleoutputbegin = m[0..2].join
@@ -216,6 +231,12 @@ module ReVIEW
216
231
  end
217
232
  end
218
233
 
234
+ def fix_deprecated_list(content)
235
+ if Gem::Version.new(ReVIEW::VERSION) >= Gem::Version.new('4.0.0')
236
+ content.gsub!(/^: (.*)/, ' : \1')
237
+ end
238
+ end
239
+
219
240
  def remove_starter_refid(content)
220
241
  # note - noteref
221
242
  content.dup.scan(/(@<noteref>)(?:(\$)|(?:({)|(\|)))(.*?)(?(2)(\$)|(?(3)(})|(\|)))/) { |m|
@@ -289,7 +310,7 @@ module ReVIEW
289
310
  post = m[6]
290
311
  id = "link_auto_footnote#{urls.length}"
291
312
  urls[id] = url
292
- content.sub!(/#{matched}$/, "#{prev}@<href>{#{url},#{text}} @<fn>{#{id}} #{post}")
313
+ content.sub!(/#{Regexp.escape(matched)}$/, "#{prev}@<href>{#{url},#{text}} @<fn>{#{id}} #{post}")
293
314
  end
294
315
  }
295
316
 
@@ -346,6 +367,11 @@ module ReVIEW
346
367
  # fixed lack of options
347
368
  content.gsub!(/^\/\/list{/, '//list[][]{')
348
369
 
370
+ if Gem::Version.new(ReVIEW::VERSION) >= Gem::Version.new('4.0.0')
371
+ # empty caption is not allow
372
+ content.gsub!(/^\/\/image\[(.*)\]\[\]{/, '//image[\1][ ]{')
373
+ end
374
+
349
375
  # special command
350
376
  replace_sampleoutput(content)
351
377
 
@@ -353,6 +379,9 @@ module ReVIEW
353
379
  add_linkurl_footnote(content)
354
380
  end
355
381
 
382
+ # # br to blankline
383
+ # content.gsub!(/(.*)@<br>{}(.*)/, '\1\n//blankline\n\2')
384
+
356
385
  # nested command
357
386
  replace_block_command_nested_boxed_articles(content)
358
387
 
@@ -364,6 +393,9 @@ module ReVIEW
364
393
  remove_starter_refid(content)
365
394
  remove_starter_options(content)
366
395
 
396
+ # replace block comment
397
+ replace_block_commentout(content)
398
+
367
399
  # special charactor
368
400
  content.gsub!('@<LaTeX>{}', 'LaTeX')
369
401
  content.gsub!('@<TeX>{}', 'TeX')
@@ -377,6 +409,9 @@ module ReVIEW
377
409
  # expand nested inline command
378
410
  expand_nested_inline_command(content)
379
411
 
412
+ # fix deprecated
413
+ fix_deprecated_list(content)
414
+
380
415
  File.write(contentfile, content)
381
416
  copy_embedded_contents(outdir, content)
382
417
  end
@@ -491,7 +526,10 @@ module ReVIEW
491
526
  updater = ReVIEW::Update.new
492
527
  updater.force = true
493
528
  # updater.backup = false
494
- updater.execute()
529
+ begin
530
+ updater.execute()
531
+ rescue
532
+ end
495
533
  Dir.chdir(pwd)
496
534
 
497
535
  if options['preproc']
@@ -1,5 +1,5 @@
1
1
  module ReVIEW
2
2
  module Retrovert
3
- VERSION = "0.9.2"
3
+ VERSION = "0.9.3"
4
4
  end
5
5
  end
@@ -99,6 +99,18 @@ module ReVIEW
99
99
  }
100
100
  end
101
101
 
102
+ def rewrite_yml_array_(yamlfile, key, val)
103
+ content = File.read(yamlfile)
104
+ content.gsub!(/^(\s*)#{key}:\s*\[.*?\]/m, '\1' + "#{key}: #{val}")
105
+ File.write(yamlfile, content)
106
+ end
107
+
108
+ def rewrite_yml_array(key, val)
109
+ config_files.each { |current_file|
110
+ rewrite_yml_array_(File.join(@basedir, current_file), key, val)
111
+ }
112
+ end
113
+
102
114
  def rewrite_retrovert_yml()
103
115
  @retrovert_configs.each { |current_file|
104
116
  yamlfile = File.expand_path(current_file, @basedir)
@@ -127,4 +139,4 @@ module ReVIEW
127
139
 
128
140
  end
129
141
  end
130
- end
142
+ end
@@ -29,5 +29,5 @@ Gem::Specification.new do |spec|
29
29
 
30
30
  spec.add_dependency "thor"
31
31
  spec.add_development_dependency "aruba"
32
- spec.add_runtime_dependency "review", ['>= 3.2.0', '< 4.0']
32
+ spec.add_runtime_dependency "review", ['>= 3.2.0']
33
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: review-retrovert
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - srz_zumix
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-11 00:00:00.000000000 Z
11
+ date: 2021-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -45,9 +45,6 @@ dependencies:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: 3.2.0
48
- - - "<"
49
- - !ruby/object:Gem::Version
50
- version: '4.0'
51
48
  type: :runtime
52
49
  prerelease: false
53
50
  version_requirements: !ruby/object:Gem::Requirement
@@ -55,9 +52,6 @@ dependencies:
55
52
  - - ">="
56
53
  - !ruby/object:Gem::Version
57
54
  version: 3.2.0
58
- - - "<"
59
- - !ruby/object:Gem::Version
60
- version: '4.0'
61
55
  description: Re:VIEW Starter to Re:VIEW
62
56
  email:
63
57
  - zumix.cpp@gmail.com
@@ -195,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
195
189
  - !ruby/object:Gem::Version
196
190
  version: '0'
197
191
  requirements: []
198
- rubygems_version: 3.1.4
192
+ rubygems_version: 3.2.3
199
193
  signing_key:
200
194
  specification_version: 4
201
195
  summary: Re:VIEW Starter to Re:VIEW