Ruby accepts argument by drag and drop on rb script

Possible duplicate:
Enable file deletion in Ruby script

I would like to have ruby ​​open with the files dropped as arguments. I am running Win 7 Enterprise, Ruby 1.8.6 and have tried RubyDragAndDrop.dll, which I could not install. Any ideas?

+3
source share
1 answer

One option is to create a batch file that handles part of the drag and drop. As you can see here , when dragging files into a batch file, the list of deleted files will be stored in %*the form of a list separated by spaces. The batch file that just said ruby yourscript.rb %*should take this list of files and pass it to your script (where you can access the arguments with an array ARGS).

+3
source

Source: https://habr.com/ru/post/1757719/


All Articles