Module: RailsAssist::Artifact::Methods

Included in:
RailsAssist::Artifact, RailsAssist::Artifact
Defined in:
lib/rails_assist/artifact.rb

Instance Method Summary collapse

Instance Method Details

#app_artifactsObject



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

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

#helper_listObject



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

def helper_list
  RailsAssist.artifacts + [:view, :asset]
end

#rails_artifactsObject



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

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

    # dir_methods = RailsAssist::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/rails_assist/artifact.rb', line 24

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