I'm trying to setup the Notepad++ IDE so that when I press F6 the Ruby script I'm editing will run. After searching the internet I've found that putting
cmd /K ruby "$(FULL_CURRENT_PATH)"
into the run dialogue box that pops up when I press F5 will run basic scripts in the Command Prompt (I'm using Windows 7).
However, if my code loads any external data such as .txt files, or as I've found with Gosu, loads any image files, Ruby complains that things do not exist which do in fact exist.
I know my code and Ruby installation (Ruby 1.9.3) are fine because prior to now I've been using FreeRIDE, an older, somewhat buggy IDE that I've grown tired of, and my code runs fine when I press F5 using that IDE.
Some examples of the complaints follow.
My Text Adventure:
C:/Users/Estanislao/Dropbox/Allway Sync/My Important Documents/Text Focused Fold
er/Ruby Scripts/Text Adventure/0.1.0/File Parser/DungeonContentFileParser.rb:8:i
n `initialize': No such file or directory - Example Dungeon Creator File.txt (Er
rno::ENOENT)
from C:/Users/Estanislao/Dropbox/Allway Sync/My Important Documents/Text
Focused Folder/Ruby Scripts/Text Adventure/0.1.0/File Parser/DungeonContentFile
Parser.rb:8:in `open'
from C:/Users/Estanislao/Dropbox/Allway Sync/My Important Documents/Text
Focused Folder/Ruby Scripts/Text Adventure/0.1.0/File Parser/DungeonContentFile
Parser.rb:8:in `encapsulate_method'
from C:/Users/Estanislao/Dropbox/Allway Sync/My Important Documents/Text
Focused Folder/Ruby Scripts/Text Adventure/0.1.0/File Parser/DungeonContentFile
Parser.rb:117:in `sort_room_data_external_method'
from C:/Users/Estanislao/Dropbox/Allway Sync/My Important Documents/Text
Focused Folder/Ruby Scripts/Text Adventure/0.1.0/File Parser/DungeonContentFile
Parser.rb:125:in `<main>'
D:\Programming Stuff\Notepad++>
My Gosu Program:
C:/Users/Estanislao/Dropbox/Allway Sync/My Important Documents/Text Focused Fold
er/Ruby Scripts/Game Development/Circular Motion.rb:10:in `initialize': Could no
t load image media/Space2.png using either GDI+ or FreeImage: Unknown error (Run
timeError)
from C:/Users/Estanislao/Dropbox/Allway Sync/My Important Documents/Text
Focused Folder/Ruby Scripts/Game Development/Circular Motion.rb:10:in `new'
from C:/Users/Estanislao/Dropbox/Allway Sync/My Important Documents/Text
Focused Folder/Ruby Scripts/Game Development/Circular Motion.rb:10:in `initiali
ze'
from C:/Users/Estanislao/Dropbox/Allway Sync/My Important Documents/Text
Focused Folder/Ruby Scripts/Game Development/Circular Motion.rb:181:in `new'
from C:/Users/Estanislao/Dropbox/Allway Sync/My Important Documents/Text
Focused Folder/Ruby Scripts/Game Development/Circular Motion.rb:181:in `<main>'
D:\Programming Stuff\Notepad++>
If anyone could lend any help at all I'd really appreciate it.
Update: knut's suggestions have allowed me to get what I want after some inconvenient juggling each time I start the program up. There are a few problems. Using
cmd /K "cd "$(CURRENT_DIRECTORY)" && ruby "$(FULL_CURRENT_PATH)""
in the default run dialogue does not work. (I get the same complaints as above.) But using NppExec and
cd "$(CURRENT_DIRECTORY)"
ruby "$(FULL_CURRENT_PATH)"
for that works fine, except with my Gosu code, which should draw a window and animate some images, nothing happens. However, if each time I start up Notepad++ I run the NppExec and then use the default run dialogue everything works correctly using the built in run command for that session. Any ideas to why all this occurs and how to prevent it? Also, I'd prefer to have Notepad++ open a Command Prompt window instead of running inside Notepad++ itself, as it does with NppExec. And thank you!
Update2: It appears that restarting my computer has cleared up the problem, yet now I'm more confused as to what is actually taking place. Is it the NppExec plugin that is actually allowing things to work as I wish, even though I'm using a saved script for the default run dialog? Or Is this a bug, that kept
cmd /K "cd "$(CURRENT_DIRECTORY)" && ruby "$(FULL_CURRENT_PATH)""
from working until I restarted?