Module: RailsAssist::Directory::Methods
- Included in:
- RailsAssist::Directory, RailsAssist::Directory
- Defined in:
- lib/rails_assist/directory.rb
Overview
dir_for helpers
Constant Summary collapse
- DIR =
RailsAssist::Artifact::Directory
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
53 54 55 |
# File 'lib/rails_assist/directory.rb', line 53 def app_dir_for type, ={} ::File.join(app_dirpath(), type.to_s.pluralize) end |
#config_dir_for(type, options = {}) ⇒ Object
57 58 59 |
# File 'lib/rails_assist/directory.rb', line 57 def config_dir_for type, ={} ::File.join(config_dirpath(), type.to_s.pluralize) end |
#public_dir_for(type, options = {}) ⇒ Object
61 62 63 |
# File 'lib/rails_assist/directory.rb', line 61 def public_dir_for type, ={} ::File.join(public_dirpath(), type.to_s.pluralize) end |
#rails_dir_for(type, options = {}) ⇒ Object
46 47 48 49 50 51 |
# File 'lib/rails_assist/directory.rb', line 46 def rails_dir_for type, ={} raise ArgumentError, '#rails_dir_for takes a dir type argument' if !type dir_method = "#{type}_dirpath" return send(dir_method, ) if respond_to?(dir_method) DIR.send(dir_method, ) if DIR.respond_to?(dir_method) end |