Skip to content
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

Rspec local image file processing #38

Merged
merged 15 commits into from
Dec 25, 2019

Conversation

w00lf
Copy link
Contributor

@w00lf w00lf commented Nov 28, 2019

Added specs for ReverseAsciidoctor: docx and html convert with external URI-s to images

#32

@w00lf w00lf force-pushed the feature/rspec-local-image-file-processing branch from 505df1c to 31a3df3 Compare November 28, 2019 09:52
@ronaldtse
Copy link
Contributor

@w00lf I'd recommend you implement metanorma/coradoc#84 before this one because it's not easy setting up and use LibreOffice in all platforms...

@w00lf
Copy link
Contributor Author

w00lf commented Nov 28, 2019

@w00lf I'd recommend you implement metanorma/coradoc#84 before this one because it's not easy setting up and use LibreOffice in all platforms...

Yes, i have switched to it. Will return to this one after complete it.

@ronaldtse
Copy link
Contributor

Sounds good, thanks!

@opoudjis
Copy link
Contributor

Fails on Windows:

[!] There was an error parsing `Gemfile`: 
8
[!] There was an error while loading `reverse_adoc.gemspec`: No such file or directory - git ls-files. Bundler cannot continue.
9

10
 #  from D:/a/reverse_adoc/reverse_adoc/reverse_adoc.gemspec:16
11
 #  -------------------------------------------
12
 #    s.add_dependency 'word-to-markdown'
13
 >  end
14
 #  # -*- encoding: utf-8 -*-
15
 #  -------------------------------------------
16
. Bundler cannot continue.
17

18
 #  from D:/a/reverse_adoc/reverse_adoc/Gemfile:6
19
 #  -------------------------------------------
20
 #  
21
 >  gem "byebug"
22
 #  source "https://rubygems.org"

@w00lf w00lf force-pushed the feature/rspec-local-image-file-processing branch from 181683d to f0ba495 Compare December 12, 2019 09:59
@ronaldtse
Copy link
Contributor

Passes on Windows and Linux but fails on Mac?

@w00lf
Copy link
Contributor Author

w00lf commented Dec 12, 2019 via email

@w00lf
Copy link
Contributor Author

w00lf commented Dec 13, 2019

@ronaldtse @opoudjis i have completed with github ci configuration. There is one issue with macos configuration - installed libreoffice cli tool freezes when i try to use it, so i have skipped it for now, left apropriate TODO for it, can you review changes and merge?

@w00lf
Copy link
Contributor Author

w00lf commented Dec 15, 2019

Hi there, @CAMOBAP795, can you please review the code i wrote here to see if its ok? I have noticed your comment in here - https://github.com/metanorma/reverse_adoc/blob/master/.github/workflows/macos.yml#L1 is it ok if i change github action yaml?

- name: Update gems
run: |
gem install bundler -v "~> 2"
bundle install --jobs 4 --retry 3
- name: Run specs
run: |
bundle exec rake
- name: Test reverse_adoc binary
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same as above may be better to keep them as ruby tests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, moved it

Copy link
Contributor

@CAMOBAP CAMOBAP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally good but some comments need to be addressed

@w00lf potentially, how many repos will need LibreOffice too?

I'm asking because we have many repos with exactly the same CI configuration so we decided to move all configuration to single place https://github.com/metanorma/metanorma-build-scripts/tree/master/ci-master/config/gh-actions and apply it with https://github.com/metanorma/ci-master script

BTW @w00lf I didn't found the line where you call LibreOffice's cli tool, could you please point where it is?

@w00lf
Copy link
Contributor Author

w00lf commented Dec 15, 2019

Generally good but some comments need to be addressed

@w00lf potentially, how many repos will need LibreOffice too?

I'm asking because we have many repos with exactly the same CI configuration so we decided to move all configuration to single place https://github.com/metanorma/metanorma-build-scripts/tree/master/ci-master/config/gh-actions and apply it with https://github.com/metanorma/ci-master script

Can tell for sure which repos need Libreoffice which dont, currently this repo need it because it uses this gem: https://github.com/benbalter/word-to-markdown in order to convert docx documents.

BTW @w00lf I didn't found the line where you call LibreOffice's cli tool, could you please point where it is?

Its used inside word-to-markdown gem: https://github.com/benbalter/word-to-markdown/blob/ef1af1ae7750c017d0ed3dd3bfd369a962e858d9/lib/word-to-markdown.rb#L32

@ronaldtse
Copy link
Contributor

I’m repeating myself but @camobap795 please do not add libreoffice to metanorma because THIS GEM IS NOT USED BY METANORMA. Thanks. 😉

@w00lf
Copy link
Contributor Author

w00lf commented Dec 21, 2019

@CAMOBAP795 can you please review again? Created separate specs for bin shell scripts, removed it from github actions. Also can you tell me how do you use rubocop in your project? I tried to use it from projects folder but it seems it uses completely different rules then the Hound does

@ronaldtse
Copy link
Contributor

@opoudjis could you please help review this? Thanks!

@w00lf
Copy link
Contributor Author

w00lf commented Dec 24, 2019

@CAMOBAP795 can you please review again?

@@ -50,9 +51,11 @@ if ReverseAsciidoctor.config.external_images && ReverseAsciidoctor.config.destin
end

ReverseAsciidoctor.config.sourcedir = Dir.mktmpdir
# TODO: Check if needed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Placing TODO is good practice, alongside with this I propose to report an issue also

Because sometimes those todo being ignored

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#40

# puts "ReverseAsciidoctor.config.sourcedir #{ReverseAsciidoctor.config.sourcedir}"

doc = WordToMarkdown.new(filename, ReverseAsciidoctor.config.sourcedir)
# TODO: Check if needed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same comment about TODO

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#40

subject(:convert) do
ShellUtils.execute!("./bin/w2a -e -o test1 #{input_file_path}")
end
# TODO: fix github actions integration with libreoffice, currently it hangs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same comment about TODO

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done - #41

end
end

# TODO: fix github actions integration with libreoffice, currently it hangs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same comment about TODO

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, #41

Copy link
Contributor

@CAMOBAP CAMOBAP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for me

P.S. my comment about TODO comments up to you, it should not stop you from merging this PR

@ronaldtse
Copy link
Contributor

Two approvals and merging. @w00lf could you help create those issues? Thanks!

@ronaldtse ronaldtse merged commit d30dbcc into master Dec 25, 2019
@w00lf
Copy link
Contributor Author

w00lf commented Dec 25, 2019

Two approvals and merging. @w00lf could you help create those issues? Thanks!

Will do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants