cshoes (osx) confused about DIR #175

Closed
ccoupe opened this Issue Jan 1, 2016 · 2 comments

Comments

Projects
None yet
1 participant
@ccoupe
Contributor

ccoupe commented Jan 1, 2016

on osx terminal, in the shoes source code root,
./cshoes samples/good-svgview.rb
will draw an Shoes console message about not finding the file (from shy handling code in shoes.rb:471?). That's Bug 1. When your script uses the DIR constant to locate resources (like the paris.svg). DIR points to a directory inside the Shoes.app being executed and not to the directory the user started from. This makes it difficult to write and test scripts in osx from the command line. The same problem exists if you installed shoes in Linux and run ~/.shoes/walkabout/shoes mygame/myscript.rb and the script attempts to use "#{DIR}/my.resource"

The DIR constant is set into ruby before shoes.rb runs so it shouldn't be modified and there are legacy issues if it was changeable. Should we have an SDIR (e.g.)constant that script writers can use to locate their resources next to their script, whether it was launched from the command line or inside a package app? I suspect `SDIR = Dir.getwd() would work for most cases which also means I should not be a lazy script writer and use DIR Having written this much and thought about it even more, SDIR is probably a bad idea.

@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Feb 6, 2016

Contributor

Changes for #190 use -f to launch shoes-bin (vs open -a). It's a do nothing switch on linux and windows but it fixes OSX command line. Added it to cshoes and it looks good to me. Fixed until I discover other wise.

Contributor

ccoupe commented Feb 6, 2016

Changes for #190 use -f to launch shoes-bin (vs open -a). It's a do nothing switch on linux and windows but it fixes OSX command line. Added it to cshoes and it looks good to me. Fixed until I discover other wise.

ccoupe added a commit that referenced this issue Feb 10, 2016

on #133, osx command line/env vars is a problem.
* rename samples/videoFiddleVlc01.rb to expert-video-player.rb
  It make OSX testing much easier if it's runnable from the Manual
  since choes script is pretty FU #175.
@ccoupe

This comment has been minimized.

Show comment
Hide comment
@ccoupe

ccoupe Mar 8, 2016

Contributor

I believe this is fixed in 3.3.1

Contributor

ccoupe commented Mar 8, 2016

I believe this is fixed in 3.3.1

@ccoupe ccoupe closed this Mar 8, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment