Class: MySpec::Generators::ViewGenerator
Class Method Summary
collapse
Instance Method Summary
collapse
#method_missing
Class Method Details
.source_root ⇒ Object
18
19
20
|
# File 'lib/generators/my_spec/view/view_generator.rb', line 18
def self.source_root
@source_root ||= File.expand_path("templates", File.dirname(__FILE__))
end
|
Instance Method Details
#create_view_specs ⇒ Object
8
9
10
11
12
13
14
15
16
|
# File 'lib/generators/my_spec/view/view_generator.rb', line 8
def create_view_specs
empty_directory File.join("spec", "views", file_path)
actions.each do |action|
@action = action
template 'view_spec.rb',
File.join("spec", "views", file_path, "#{@action}.html.#{options[:template_engine]}_spec.rb")
end
end
|