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

DIR =
Rails3::Assist::Artifact::Directory

Instance Method Summary collapse

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, options={}
  ::File.join(app_dir(options), 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, options={}
  ::File.join(config_dir(options), 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, options={}
  ::File.join(public_dir(options), type.to_s.pluralize)
end

#rails_dir_for(type, options = {}) ⇒ Object

Raises:

  • (ArgumentError)


40
41
42
43
44
45
# File 'lib/rails3_assist/directory.rb', line 40

def rails_dir_for type, options={}
  raise ArgumentError, '#rails_dir_for takes a dir type argument' if !type
  dir_method = "#{type}_dir"
  return send(dir_method, options) if respond_to?(dir_method)
  DIR.send(dir_method, options) if DIR.respond_to?(dir_method)
end