I'm running a test script where one ruby script reads and executes additional ruby scripts from a 'scripts' folder.
Folder structure: RubyInception |_main.rb |_scripts |_1.rb |_2.rb Testing the filepaths like so:
irb(main):014:0> Dir.foreach('./scripts') {|x| puts File.absolute_path x} yielded the following results:
C:/.../Desktop/RubyInception C:/.../Desktop C:/.../Desktop/RubyInception/1.rb C:/.../Desktop/RubyInception/2.rb Why isn't it showing:
C:/.../Desktop/RubyInception/scripts/1.rb ?
Environment:
Windows 7 Prof x64
ruby 1.9.3p448
SOLUTION:
What worked for me:
Dir["./scripts/*.rb"].each {|x| puts File.absolute_path x }