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

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

Instance Method Summary collapse

Instance Method Details

#app_artifactsObject



7
8
9
# File 'lib/rails3_assist/artifact.rb', line 7

def app_artifacts
  [:controller, :mailer, :helper, :view, :model, :permit, :license, :validator]
end

#helper_listObject



3
4
5
# File 'lib/rails3_assist/artifact.rb', line 3

def helper_list
  Rails3::Assist.artifacts + [:view]
end

#rails_artifactsObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/rails3_assist/artifact.rb', line 11

def rails_artifacts
  @rails_artifacts ||= begin
    files_methods = Rails3::Assist::Artifact::Files.instance_methods        
    files_symbols = files_methods.grep(/_files$/).map{|f| f.to_s.gsub(/^(.*)_files/, '\1').to_sym }

    # dir_methods = Rails3::Assist::Artifact::Directory.instance_methods        
    # dir_symbols = dir_methods.map{|dir| dir.to_s.gsub(/^(.*)_dir/, '\1').to_sym }
    dir_symbols = []
  
    (files_symbols + dir_symbols).uniq
  end      
end

#valid_artifact?(type) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/rails3_assist/artifact.rb', line 24

def valid_artifact? type
  rails_artifacts.include?(type)
end