Shoes/samples/good-cardflip.rb
def find_paris
    cdir = Dir.getwd
    if File.exist? "paris.svg"
      "#{cdir}/paris.svg"
    elsif File.exist? "#{DIR}/paris.svg"
      "#{DIR}/paris.svg"
    else
      ask_open_file "Locate paris.svg"
    end
  end
# finding script resources is odd when developing a samples/myprogram.rb
# particularly on osx when invoked with ./cshoes mydir/myprogram.rb
# DIR is not sufficient.
# its best to return a full path.
finding script resources is odd when developing a samples/myprogram.rb
particularly on osx when invoked with ./cshoes mydir/myprogram.rb
DIR is not sufficient.
its best to return a full path.
finding script resources is odd when developing a samples / myprogram . rb particularly on osx when invoked with . / cshoes mydir / myprogram . rb DIR is not sufficient . its best to return a full path .
def find_paris
    cdir = Dir.getwd
    if File.exist? "paris.svg"
      "#{cdir}/paris.svg"
    elsif File.exist? "#{DIR}/paris.svg"
      "#{DIR}/paris.svg"
    else
      ask_open_file "Locate paris.svg"
    end
  end
def find_paris cdir = Dir . getwd if File . exist? "paris.svg" "#{cdir}/paris.svg" elsif File . exist? "#{DIR}/paris.svg" "#{DIR}/paris.svg" else ask_open_file "Locate paris.svg" end end
finding script resources is odd when developing a samples/myprogram.rb
particularly on osx when invoked with ./cshoes mydir/myprogram.rb
DIR is not sufficient.
finding script resources is odd when developing a samples / myprogram . rb particularly on osx when invoked with . / cshoes mydir / myprogram . rb DIR is not sufficient .