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

All Ruby filesystem system calls should be replaced with FileUtils #3

Closed
ronaldtse opened this issue Sep 22, 2018 · 4 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@ronaldtse
Copy link
Contributor

system mkdir ...
system cp ...
system rm ...

=>
https://ruby-doc.org/stdlib-2.4.1/libdoc/fileutils/rdoc/FileUtils.html

require 'fileutils'
FileUtils.cd(dir, options)
FileUtils.cd(dir, options) {|dir| block }
FileUtils.pwd()
FileUtils.mkdir(dir, options)
FileUtils.mkdir(list, options)
FileUtils.mkdir_p(dir, options)
FileUtils.mkdir_p(list, options)
FileUtils.rmdir(dir, options)
FileUtils.rmdir(list, options)
FileUtils.ln(target, link, options)
FileUtils.ln(targets, dir, options)
FileUtils.ln_s(target, link, options)
FileUtils.ln_s(targets, dir, options)
FileUtils.ln_sf(target, link, options)
FileUtils.cp(src, dest, options)
FileUtils.cp(list, dir, options)
FileUtils.cp_r(src, dest, options)
FileUtils.cp_r(list, dir, options)
FileUtils.mv(src, dest, options)
FileUtils.mv(list, dir, options)
FileUtils.rm(list, options)
FileUtils.rm_r(list, options)
FileUtils.rm_rf(list, options)
FileUtils.install(src, dest, options)
FileUtils.chmod(mode, list, options)
FileUtils.chmod_R(mode, list, options)
FileUtils.chown(user, group, list, options)
FileUtils.chown_R(user, group, list, options)
FileUtils.touch(list, options)
@ronaldtse ronaldtse added the bug Something isn't working label Sep 22, 2018
@opoudjis
Copy link
Contributor

opoudjis commented Sep 23, 2018

I can't do anything about the invokation of node.js for puppetteer:

        system "export NODE_PATH=$(npm root --quiet -g);
                node #{pdfjs} file://#{url} #{filename}.pdf"

Manipulating the environment PATH variable is still going to be needed for Windows.

Likewise the invocation of plantuml

@opoudjis
Copy link
Contributor

Have done all other instances of system with FileUtils. Close ticket?

@ronaldtse
Copy link
Contributor Author

Thanks @opoudjis ; are all instances of system across the Metnaorma system all replaced with FileUtils?

There's nothing much we can do with puppeteer / plantuml for now.

@opoudjis
Copy link
Contributor

All except for the calls to puppeteer and plantuml. I have not yet released gems for this change.

opoudjis added a commit to metanorma/asciidoctor-rfc that referenced this issue Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants