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

FileUtils#sh occurs TypeError when using hash style options. #201

Closed
igaiga opened this issue May 2, 2017 · 0 comments
Closed

FileUtils#sh occurs TypeError when using hash style options. #201

igaiga opened this issue May 2, 2017 · 0 comments

Comments

@igaiga
Copy link
Contributor

igaiga commented May 2, 2017

Until rake v.11.1.2, we can run sh commands with hash style option, like the follow. But we have "TypeError" now.

task :dir do
  sh "pwd", {chdir: "/home"}, { vernbose: true }
end
# before rake v.11.1.2 #=> /home [OK]
# after rake v.11.2.0  #=> TypeError: no implicit conversion of Hash into String [Error]

On the other hand, to write codes same as previous one like the follow, it doesn't work before v.11.1.2.

task :dir do
  verbose(true) do
    sh "pwd", {chdir: "/home"}
  end
end
# before rake v.11.1.2 #=> ArgumentError: no such option: chdir [Error]
# after rake v.11.2.0  #=> /home [OK]

Is it spec or bug?

information : About the "TypeError: no implicit conversion of Hash into String"

task :dir do
  sh "pwd", {chdir: "/home"}, { vernbose: true }
end
# before rake v.11.1.2 #=> /home
# after rake v.11.2.0  #=> TypeError: no implicit conversion of Hash into String

We have the "TypeError: no implicit conversion of Hash into String" error from v.11.2.0.

The error occurs on the lib/rake/file_utils.rb:56 line.
It looks like to become occur from this code changes.
226b8a0#diff-f7fcb87d482d055b9df1e86fd76ae06fR56

The code use Kernel#system method. After the change, arguments for system method is increasing.

v.11.1.2

system('pwd',  {chdir: "/home"})
#=> /home

v.11.2.0

system('pwd',  {chdir: "/home"}, {})
#=> TypeError: no implicit conversion of Hash into String
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant