This project is archived and is in readonly mode.
[PATCH] Make path to tmp directory configurable
-
Jeff Hodges
+1
This is a solid patch. I would like the task description "Clears all session files in tmp" changed to desc "Clears all session files in the tmp directory" and similar to the other one. However, that's just being picky.
-
Phil Hagelberg
- Tag changed from configuration to configuration, patch
-
Xavier Noria
Two things I'd like to improve:
-
I think tmp_dir may be useful to the end user, what about documentation for it.
-
I think it is better style not to mix slashes and File.join. If you use File.join then leave slashes to it.
-
The analogous accessors for lots of stuff end with "_path". To be consistent in that naming I'd call it "tmp_path".
-
-
Phil Hagelberg
Thanks, fellas. I will make these changes and attach another patch.
I added comments for the tmp_dir accessor; I believe those should get picked up by RDoc. Is there somewhere else it should be documented?
-
Phil Hagelberg
Made the fixes Xavier suggested.
-
Shane Liebling
I was wondering if this was going to get rolled into the mainline rails anytime soon - I for one could really use it!!
-
CancelProfileIsBroken
- Tag changed from configuration, patch to bugmash, configuration, patch
-
Kieran P
+1, but the patch supplied does not apply cleanly to Rails 3.0 (master). I've uploaded a modified patch that does.
-
Kieran P
Previous file wasn't a proper patch. This one should be better.
-
Dan Pickett
+1 for the feature
verified that the patch applies cleanly to master
There currently isn't any tests associated with this patch - would it be possible to include tests on this? (I'm asking if its possible, not being patronizing :-) )
-
José Valim
- Assigned user set to Yehuda Katz (wycats)
- Milestone cleared.
I was discussing about this feature with Yehuda a week ago. He told me that all Rails paths should be configurable, like Rails.paths.vendor #=> RAILS_ROOT/vendor. Not sure if he is already working on that with Carl, but I'm assigning it to him.
-
Rizwan Reza
+1 I agree with Yehuda on all Rails path being configurable... that would be awesome!
-
Elad Meidar
+1 on idea and approach to have all paths as configurable.
patch applies cleanly but contains a typo (fixed patch attached), i was unable to think of a proper way to test it, nor where other paths are tested.
I also think that it should be somewhat a Configuration accessor, other than the Rails instance. -
Kieran P
Michael (Koz) suggested (on IRC) that it be Rails.tmpdir to match Dir.tmpdir used other places in Rails, so I based the getter/setter from public_path, rather than make a Configuration accessor as in the original patch.
-
Yehuda Katz (wycats)
On master, we have already moved toward a more flexible way to describe paths. Check out this block from configuration.rb
@paths = Rails::Application::Root.new(root_path) @paths.app "app", :load_path => true @paths.app.metals "app/metal", :eager_load => true @paths.app.models "app/models", :eager_load => true @paths.app.controllers "app/controllers", builtin_directories, :eager_load => true @paths.app.helpers "app/helpers", :eager_load => true @paths.app.services "app/services", :load_path => true @paths.lib "lib", :load_path => true @paths.vendor "vendor", :load_path => true @paths.vendor.plugins "vendor/plugins" @paths.tmp "tmp" @paths.tmp.cache "tmp/cache" @paths.config "config" @paths.config.locales "config/locales" @paths.config.environments "config/environments", :glob => "#{RAILS_ENV}.rb"The basic idea is that we mirror the default directory structure for ease of understanding, but users can specify whatever paths they want for a part of the path hierarchy. Each virtual path can also have multiple physical paths. When Carl gets back from vacation we'll finish this up (we got detoured to work on the gem bundler) and write it up.
-
Yehuda Katz (wycats)
- Tag changed from bugmash, configuration, patch to configuration, patch
