Sha256: dd0b17b6cd85d843ab3dcb44182a00bd45c3c94f09eb02663435c049740261d1
Contents?: true
Size: 1.19 KB
Versions: 1
Compression:
Stored size: 1.19 KB
Contents
module Draper class InstallGenerator < Rails::Generators::Base desc <<-DESC Description: Generate application and spec decorators in your application. DESC class_option "test-framework", :type => :string, :default => "rspec", :aliases => "-t", :desc => "Test framework to be invoked" source_root File.expand_path('../templates', __FILE__) def build_application_decorator empty_directory 'app/decorators' template 'application_decorator.rb', File.join('app/decorators', 'application_decorator.rb') end def build_decorator_tests case options["test-framework"] when "rspec" build_application_decorator_spec when "test_unit" build_application_decorator_test end end private def build_application_decorator_spec empty_directory 'spec/decorators' template 'application_decorator_spec.rb', File.join('spec/decorators', 'application_decorator_spec.rb') end def build_application_decorator_test empty_directory 'test/decorators/' template 'application_decorator_test.rb', File.join('test/decorators', 'application_decorator_test.rb') end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
draper-0.10.0 | lib/generators/draper/install/install_generator.rb |