Module: Rails3::Assist::Artifact::Files::Methods

Included in:
Rails3::Assist::Artifact::Files, Rails3::Assist::Artifact::Files
Defined in:
lib/rails3_assist/artifact/files.rb

Instance Method Summary collapse

Instance Method Details

#view_files(*args) {|files| ... } ⇒ Object

Yields:

  • (files)


27
28
29
30
31
32
33
34
# File 'lib/rails3_assist/artifact/files.rb', line 27

def view_files *args 
  expr, model_name = Helper.get_view_args args
  ext = last_option(args)[:template_language] || 'erb'
  pattern = model_name ? "#{model_name.to_s.pluralize}/*.#{ext}*" : "**/*.#{ext}*"
  files = Rails3::Assist::Files.rails_app_files(:views, :pattern => pattern).grep_it expr
  yield files if block_given?
  files          
end