I know that I can run a Ruby script in my active tab with the command
cmd /K ruby “$(FULL_CURRENT_PATH)”
However, I'd like to do with Notepad++ on my Windows system what I do regularly in BBEdit on my Mac: Have a text file open and then call a Ruby script from a menu, and have that script act on text in my active window without having to actually input the name of the file. Is that possible?
1 Answer. Show activity on this post. The shortcut for "Launch in IE" is Ctrl + Alt + Shift + I .
In this case, it's a Ruby file to be executed with the Ruby interpreter. To mark the file as executable, run the command chmod +x test. rb. This will set a file permission bit indicating that the file is a program and that it can be run.
Creating a Ruby Script. Let's start by creating a "Hello World!" script in Ruby. #!/usr/bin/env ruby puts "Hello world!" We can run this script in the command line by going to the directory where the file lives and typing in ruby hello.
To run a Ruby script in Notepad++, first install the NppExec plugin if it’s not already installed. Then in Notepad++ either hit F6 or go to Plugins > NppExec > Execute. In the Execute Command dialog type in the following:
ruby "$(FULL_CURRENT_PATH)"
See this for additional commandline options
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With