inukshuk/anystyle-cli

anystyle-cli fails to open file in Ruby 2.7.7

jfelixhe opened this issue · 2 comments

Scenario:

  • Installed Ruby 2.7.7:
ruby --version
ruby 2.7.7p221 (2022-11-24 revision 168ec2b1e5) [x64-mingw32]
  • Installed anystyle via gem install anystyle-cli.

  • Executed the following command with a previously tested text file used on another (also Windows 64-bit) host :
    anystyle -f json,xml parse _citations.txt

Apparently, data is not correctly read from file, instead it appears to try to use the file location as URL. The outcome to previous command was:

[
  {
    "url": [
      "D:/data/<a_long_path...>/_citations.txt"
    ],
    "type": null
  }
]

Also, I was able to confirm that the parser works fine if directly called from the Interactive Ruby environment.

Oh, that's an issue in the latest version. For security reasons, we stopped opening paths automatically, so the CLI tool must open the file now.

We'll push an update in the coming days; meanwhile you can just use the previous version (on Ruby 2.7 you're not missing any relevant updates).

Should be fixed in 1.4.1