-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test code not working, OpenOffice jumbled #14
Comments
@cboe are the tests passing on your machine?
|
@cboe There is a sample file checked into the repository. This file is used to compare generated files and make sure they are identical. You can find it here. Up to this point sablon was developed with only Microsoft Word in mind. I've downloaded OpenOffice and when I open the sample files they do look hugely distorted. I'm guessing there is something wrong in the XML-structure that Word happily ignores: As the README states, this is very much in early development and focused on the use-cases I've encountered so far. If you'd like to use sablon with OpenOffice I expect you'd have to submit some patches to get it to work accordingly. I'm very open to pull requests if you decide to go that path. I can't guarantee that I'll have the time to make it work with OpenOffice in the near future. |
Opening and Saving the generated documents with Microsoft Word makes the generated files work with Open Office. It could be non-significant whitespace that I generate into the Following is a screenshot of the same document as above but with a open/save roundtrip through MS Word: |
@cboe I pushed a commit addressing the whitespace issue with Open Office. This solves the jumbled look of generated documents opened with Open Office (at least on my machine). However, this does not change the fact that your rendered document still contains the placeholders. |
Thanks for that, it looks right in Open Office now! I have problems running the tests, I'll try again later. BTW, does the gem support chinese characters? |
@cboe I have no idea 😁 I'n theory it should work with any unicode character. |
well here are some of the results from the tests christophs-mbp:sablon-3d38b9668dc5 cboe$ ruby -I ./test test/processor_test.rb Running:FFFFFFFFFEFFFFFFF Finished in 0.204225s, 83.2415 runs/s, 78.3450 assertions/s.
17 runs, 16 assertions, 16 failures, 1 errors, 0 skips |
christophs-mbp:sablon-3d38b9668dc5 cboe$ ruby -I ./test test/sablon_test.rb Running:E Finished in 0.024424s, 40.9433 runs/s, 0.0000 assertions/s.
1 runs, 0 assertions, 0 failures, 1 errors, 0 skips |
christophs-mbp:sablon-3d38b9668dc5 cboe$ ruby -I ./test test/section_properties_test.rb Running:FF Finished in 0.004225s, 473.3728 runs/s, 710.0592 assertions/s.
2 runs, 3 assertions, 2 failures, 0 errors, 0 skips |
christophs-mbp:sablon-3d38b9668dc5 cboe$ ruby -I ./test test/section_properties_test.rb Running:FF Finished in 0.004225s, 473.3728 runs/s, 710.0592 assertions/s.
2 runs, 3 assertions, 2 failures, 0 errors, 0 skips Running:FE.FFE Finished in 0.005531s, 1084.7948 runs/s, 723.1965 assertions/s.
6 runs, 4 assertions, 3 failures, 2 errors, 0 skips |
@cboe thank you for the output. You can run all tests together by executing I see that the test already fail with I'll try to figure out what the cause could be but without a way for me to reproduce the errors it's going to be difficult. |
@cboe The errors could be related to the version of
Did you use system libraries when installing nokogiri? |
Well that solved that, I had nokogiri v. 1.4.3.1 installed... thank you so much for your quick help! |
@cboe thank you for confirming. I added a version requirement for nokogiri to make sure this doesn't happen to other people. |
I've tried using Sablon in my own code with the same code used in the test example and the provided docx template, however, none of the contents seem to be replaced by sablon. Here is the code:
all I've changed is the filename, the about_me content and removed the page properties. In addition, opening the output document in OpenOffice 4.0.1, the document is all over the place, see picture of first page.
Specs:
OSX 10.9.5
ruby-2.1.0, rails 3.2.21
added sablon through gemfile like this
gem 'sablon', :git => "https://github.com/senny/sablon.git"
doing it without git yielded the same results
The text was updated successfully, but these errors were encountered: