Sha256: ae32da297d82a161121243758a21b01e8a7ac2d3cd5f79792ab901fd23de0519
Contents?: true
Size: 696 Bytes
Versions: 21
Compression:
Stored size: 696 Bytes
Contents
class FeatureGenerator < RubiGen::Base attr_reader :plural_name, :singular_name, :class_name def initialize(runtime_args, runtime_options = {}) super usage if args.empty? @name = args.shift @plural_name = @name.pluralize.underscore @singular_name = @name.singularize.underscore @class_name = @name.singularize.classify end def manifest record do |m| m.directory 'features/steps' m.template 'feature.erb', "features/manage_#{plural_name}.feature" m.template 'steps.erb', "features/steps/#{singular_name}_steps.rb" end end protected def banner "Usage: #{$0} feature ModelName [feature1] [feature2]" end end
Version data entries
21 entries across 21 versions & 1 rubygems