Skip to content

Commit

Permalink
Merge pull request #17 from srz-zumix/feature/fix_noretrovert_config
Browse files Browse the repository at this point in the history
Feature/fix noretrovert config
  • Loading branch information
srz-zumix authored Jul 27, 2021
2 parents a9e94ef + 455aab9 commit 93a73d9
Show file tree
Hide file tree
Showing 5 changed files with 423 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
review-retrovert (0.9.9)
review-retrovert (0.9.10)
review (>= 3.0.0)
thor

Expand Down
12 changes: 7 additions & 5 deletions lib/review/retrovert/converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,13 @@ def update_config(outdir)
jsbook_config = "media=ebook,openany,paper=b5,fontsize=9pt,baselineskip=15.5pt,head_space=15mm,gutter=22mm,footskip=16mm,line_length=45zw,number_of_lines=38"
end
@configs.rewrite_yml_array('texdocumentclass', "[\"review-jsbook\", \"#{jsbook_config}\"]")
@config['retrovert'].each{ |k,v|
unless v..is_a?(Hash)
@configs.commentout_root_yml(k)
end
}
if @config.key?('retrovert')
@config['retrovert'].each{ |k,v|
unless v..is_a?(Hash)
@configs.commentout_root_yml(k)
end
}
end
if @ird
@configs.rewrite_yml('chapterlink', 'null')
end
Expand Down
2 changes: 1 addition & 1 deletion lib/review/retrovert/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module ReVIEW
module Retrovert
VERSION = "0.9.9"
VERSION = "0.9.10"
end
end
11 changes: 10 additions & 1 deletion spec/review/retrovert_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

RSpec.describe 'command test', type: :aruba do
let(:config_yaml) { File.join(File.dirname(__FILE__), '../../testdata/mybook/config.yml') }
let(:config_noretrovert_yaml) { File.join(File.dirname(__FILE__), '../../testdata/mybook/config-noretrovert.yml') }

context 'help' do
before(:each) { run_command('bundle exec review-retrovert help') }
Expand All @@ -29,7 +30,15 @@
end

context 'convert no preproc' do
before(:each) { run_command("review-retrovert convert --tabwidth 4 #{config_yaml} tmp") }
before(:each) { run_command("review-retrovert convert --tabwidth 4 #{config_yaml} tmp_preproc") }
it 'result' do
expect(last_command_started).to be_successfully_executed
expect(last_command_started).not_to have_output(/INFO.*: preproc/)
end
end

context 'convert no retrovert config' do
before(:each) { run_command("review-retrovert convert --tabwidth 4 #{config_noretrovert_yaml} tmp_noretrovert") }
it 'result' do
expect(last_command_started).to be_successfully_executed
expect(last_command_started).not_to have_output(/INFO.*: preproc/)
Expand Down
Loading

0 comments on commit 93a73d9

Please sign in to comment.