Sha256: 57721d80274924ce45144a660d714d7ad4865348e338cb34f5fdd3cb1c57ee6a

Contents?: true

Size: 609 Bytes

Versions: 13

Compression:

Stored size: 609 Bytes

Contents

# This program is free software.
# You can distribute or modify this program under the terms of
# the GNU LGPL, Lesser General Public License version 2.1.
#

module ReVIEW
  class Converter
    attr_accessor :target

    def initialize(book, builder)
      @book = book
      @book.config['builder'] = builder.target_name
      @compiler = ReVIEW::Compiler.new(builder)
    end

    def convert(file, output_path)
      chap_name = File.basename(file, '.*')
      chap = @book.chapter(chap_name)
      result = @compiler.compile(chap)
      File.open(output_path, 'w') { |f| f.puts result }
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
review-4.2.0 lib/review/converter.rb
review-4.1.0 lib/review/converter.rb
review-4.0.0 lib/review/converter.rb
review-3.2.0 lib/review/converter.rb
review-3.1.0 lib/review/converter.rb
review-3.0.0 lib/review/converter.rb
review-3.0.0.rc1 lib/review/converter.rb
review-3.0.0.preview4 lib/review/converter.rb
review-3.0.0.preview3 lib/review/converter.rb
review-3.0.0.preview2 lib/review/converter.rb
review-3.0.0.preview1 lib/review/converter.rb
review-2.5.0 lib/review/converter.rb
review-2.4.0 lib/review/converter.rb