Module: Rails3::Assist::Directory::Methods
- Included in:
- Rails3::Assist::Directory, Rails3::Assist::Directory
- Defined in:
- lib/rails3_assist/directory.rb
Overview
dir_for helpers
Constant Summary collapse
Instance Method Summary collapse
- #app_dir_for(type, options = {}) ⇒ Object
- #config_dir_for(type, options = {}) ⇒ Object
- #public_dir_for(type, options = {}) ⇒ Object
- #rails_dir_for(type, options = {}) ⇒ Object
Instance Method Details
#app_dir_for(type, options = {}) ⇒ Object
47 48 49 |
# File 'lib/rails3_assist/directory.rb', line 47 def app_dir_for type, ={} ::File.join(app_dir(), type.to_s.pluralize) end |
#config_dir_for(type, options = {}) ⇒ Object
51 52 53 |
# File 'lib/rails3_assist/directory.rb', line 51 def config_dir_for type, ={} ::File.join(config_dir(), type.to_s.pluralize) end |
#public_dir_for(type, options = {}) ⇒ Object
55 56 57 |
# File 'lib/rails3_assist/directory.rb', line 55 def public_dir_for type, ={} ::File.join(public_dir(), type.to_s.pluralize) end |
#rails_dir_for(type, options = {}) ⇒ Object
40 41 42 43 44 45 |
# File 'lib/rails3_assist/directory.rb', line 40 def rails_dir_for type, ={} raise ArgumentError, '#rails_dir_for takes a dir type argument' if !type dir_method = "#{type}_dir" return send(dir_method, ) if respond_to?(dir_method) DIR.send(dir_method, ) if DIR.respond_to?(dir_method) end |