Skip to content

Commit

Permalink
epub2html: add execute_with_params() to use without ARGV
Browse files Browse the repository at this point in the history
  • Loading branch information
takahashim committed Jan 10, 2022
1 parent 8f3fd82 commit dcb0c0d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/review/epub2html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def self.execute(*args)
new.execute(*args)
end

def execute(*args)
def parse_options!(*args)
opts = OptionParser.new

opts.banner = <<EOT
Expand All @@ -47,8 +47,17 @@ def execute(*args)
exit 1
end

htmls = parse_epub(args[0])
puts join_html(args[1], htmls)
args
end

def execute(*args)
params = parse_options!(*args)
execute_with_params(*params)
end

def execute_with_params(epubname, reffile)
htmls = parse_epub(epubname)
puts join_html(reffile, htmls)
end

def initialize
Expand Down

0 comments on commit dcb0c0d

Please sign in to comment.