# This generator is run for a new RTML application, and should be rerun after # every RTML update. It is responsible for generating the base set of RTML # support files: # # * db/migrate/*.rb # - Database migrations for RTML models # # * config/tml_dom_ruleset.rb # - The TML ruleset which governs RTML's document generation rules # # * lib/tasks/rtml.rake # - RTML-specific rake tasks # # * doc/io_tml-application-development-guidelines.pdf # - The Incendo Online TML documentation (Never leave home without it!) # class RtmlGenerator < Rails::Generator::Base def manifest record do |m| m.directory 'db/migrate' m.directory 'config/initializers' m.directory 'lib/tasks' m.directory 'doc' m.file 'config/tml_dom_ruleset.rb', 'config/tml_dom_ruleset.rb' m.file 'config/initializers/rtml.rb', 'config/initializers/rtml.rb' m.file 'lib/tasks/rtml.rake', 'lib/tasks/rtml.rake' m.file 'doc/io_tml-application-development-guidelines.pdf', 'doc/io_tml-application-development-guidelines.pdf' MIGRATIONS.each do |migration| name = File.join("db/migrate", migration) m.file name, name end end end protected def banner <<-EOS This command is used to apply an RTML configuration to your Rails project. It can safely be run multiple times, and you should consider doing so every time you update your 'rtml' gem in order to make sure your project contains the latest database migrations, TML rules, and so on. USAGE: #{$0} #{spec.name} EOS end MIGRATIONS = %w( 20100113131401_add_options_to_properties.rb 20100110071920_add_parent_id_to_rtml_instructions.rb 20100110060124_create_rtml_instructions.rb 20100108165127_create_rtml_documents.rb 20100108163827_create_rtml_dom_properties.rb 20100108163703_create_rtml_dom_elements.rb 20100127173146_add_parent_type_to_rtml_dom_elements.rb 20100208114234_create_rtml_states.rb 20100303021609_add_x_and_y_to_rtml_instructions.rb ) end