Sha256: 31da33fa9f19187f721eb6d7a55b13d125c3a8fc67d18a9763d6ef6d7b06012b
Contents?: true
Size: 735 Bytes
Versions: 4
Compression:
Stored size: 735 Bytes
Contents
require 'generators/my_scaffold_generator' module MySpec module Generators class ViewGenerator < Rails::Generators::NamedBase include MyGenerators::Generators::MyScaffoldGenerator argument :actions, :type => :array, :default => [], :banner => "action action" 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 def self.source_root @source_root ||= File.expand_path("templates", File.dirname(__FILE__)) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems