demo/texts/append_styled_text.rb in goldendocx-0.2.2 vs demo/texts/append_styled_text.rb in goldendocx-0.2.3
- old
+ new
@@ -1,10 +1,9 @@
# frozen_string_literal: true
$LOAD_PATH.push "#{Dir.pwd}/lib"
require 'goldendocx'
-
-docx = Goldendocx::Docx.new("#{Dir.pwd}/demo/templates/blankDocument.docx")
+docx = Goldendocx::Docx.new.read_from("#{Dir.pwd}/demo/templates/blankDocument.docx")
# Register styles because default document without any style
docx.add_style(File.read("#{Dir.pwd}/demo/templates/styles/reportTitle"))
docx.add_style(File.read("#{Dir.pwd}/demo/templates/styles/reportSubTitle"))
docx.add_style(File.read("#{Dir.pwd}/demo/templates/styles/reportLabel"))