Sha256: 8c601498877a382e07b67d512ab4775df3d97f7226c96ca16781ce0efc55b333
Contents?: true
Size: 743 Bytes
Versions: 3
Compression:
Stored size: 743 Bytes
Contents
class FilterGenerator < Rails::Generator::NamedBase def manifest record do |m| # Check for class naming collisions. m.class_collisions class_path, "#{class_name}Filter", "#{class_name}FilterTest" # Model, test, and fixture directories. m.directory File.join('app/filters', class_path) m.directory File.join('test/unit/filters', class_path) # Model class, unit test, and fixtures. m.template 'model.rb.template', File.join('app/filters', class_path, "#{file_name}_filter.rb") m.template 'unit_test.rb.template', File.join('test/unit/filters', class_path, "#{file_name}_filter_test.rb") end end def filter_name class_name.gsub(/([A-Z][a-z])/, ' \1').strip end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
radiant-0.5.0 | lib/generators/filter/filter_generator.rb |
radiant-0.5.1 | lib/generators/filter/filter_generator.rb |
radiant-0.5.2 | lib/generators/filter/filter_generator.rb |