aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorCarl Lerche <carllerche@mac.com>2010-05-06 12:02:54 +0300
committerCarl Lerche <carllerche@mac.com>2010-05-06 12:02:54 +0300
commit6d7f2790cdb6cb23285067ed2bd91fd5122adbbc (patch)
tree94fd365c22ee2b073ee725fc495f514b9a7d912f /railties/lib
parent5be49884b5947d4624bdaaf9cf2629ca4dd73567 (diff)
downloadrails-6d7f2790cdb6cb23285067ed2bd91fd5122adbbc.tar.gz
rails-6d7f2790cdb6cb23285067ed2bd91fd5122adbbc.tar.bz2
rails-6d7f2790cdb6cb23285067ed2bd91fd5122adbbc.zip
Expand paths to app builders relative to the working directory
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/generators/rails/app/app_generator.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb
index 10d8b8f85a..0a0b033738 100644
--- a/railties/lib/rails/generators/rails/app/app_generator.rb
+++ b/railties/lib/rails/generators/rails/app/app_generator.rb
@@ -200,6 +200,9 @@ module Rails
def initialize(*args)
raise Error, "Options should be given after the application name. For details run: rails --help" if args[0].blank?
+
+ @original_wd = Dir.pwd
+
super
if !options[:skip_activerecord] && !DATABASES.include?(options[:database])
@@ -316,7 +319,7 @@ module Rails
if URI(path).is_a?(URI::HTTP)
contents = open(path, "Accept" => "application/x-thor-template") {|io| io.read }
else
- contents = open(path) {|io| io.read }
+ contents = open(File.expand_path(path, @original_wd)) {|io| io.read }
end
prok = eval("proc { #{contents} }", TOPLEVEL_BINDING, path, 1)