Sha256: 46f40c9f7faf659bb906203a14843dab30c99c469ce535ec6f7e0ab72df58205

Contents?: true

Size: 1.03 KB

Versions: 14

Compression:

Stored size: 1.03 KB

Contents

class DesktopApplicationGenerator < Rails::Generators::NamedBase
  source_root File.expand_path('../templates', __FILE__)
  argument :description, :type => :string 
  argument :icon, :type => :string 

  def generate_desktop_application
    #Controller
    template "controllers/controller_template.erb", "app/controllers/erp_app/desktop/#{file_name}/base_controller.rb"

    #make javascript
    template "public/module.js.erb", "public/javascripts/erp_app/desktop/applications/#{file_name}/module.js"

    #make css folder
    empty_directory "public/stylesheets/erp_app/desktop/applications/#{file_name}"

    #make images folder
    empty_directory "public/images/erp_app/desktop/applications/#{file_name}"
    
    #add route
    route "match '/erp_app/desktop/#{file_name}(/:action)' => \"erp_app/desktop/#{file_name}/base\""
    
    #migration
    template "migrate/migration_template.erb", "db/data_migrations/#{RussellEdge::DataMigrator.next_migration_number(1)}_create_#{file_name}_desktop_application.rb"
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
erp_app-4.0.0 lib/generators/desktop_application/desktop_application_generator.rb
erp_app-3.1.16 lib/generators/desktop_application/desktop_application_generator.rb
erp_app-3.1.15 lib/generators/desktop_application/desktop_application_generator.rb
erp_app-3.1.14 lib/generators/desktop_application/desktop_application_generator.rb
erp_app-3.1.13 lib/generators/desktop_application/desktop_application_generator.rb
erp_app-3.1.12 lib/generators/desktop_application/desktop_application_generator.rb
erp_app-3.1.11 lib/generators/desktop_application/desktop_application_generator.rb
erp_app-3.1.10 lib/generators/desktop_application/desktop_application_generator.rb
erp_app-3.1.9 lib/generators/desktop_application/desktop_application_generator.rb
erp_app-3.1.8 lib/generators/desktop_application/desktop_application_generator.rb
erp_app-3.1.7 lib/generators/desktop_application/desktop_application_generator.rb
erp_app-3.1.6 lib/generators/desktop_application/desktop_application_generator.rb
erp_app-3.1.5 lib/generators/desktop_application/desktop_application_generator.rb
erp_app-3.1.4 lib/generators/desktop_application/desktop_application_generator.rb