Sha256: c2440907984facefa6b399b97f910b3a76f5b94ffffe31fb00200a67649efa93

Contents?: true

Size: 1002 Bytes

Versions: 1

Compression:

Stored size: 1002 Bytes

Contents

require File.join(File.dirname(__FILE__), '..', '..', 'lib', 'ruboss4ruby') if !defined?(Ruboss4Ruby)

class RubossControllerGenerator < Rails::Generator::Base
  include Ruboss4Ruby::Configuration
  
  attr_reader :project_name, 
              :flex_project_name, 
              :base_package, 
              :base_folder, 
              :command_controller_name,
              :model_names, 
              :command_names

  def initialize(runtime_args, runtime_options = {})
    super
    @project_name, @flex_project_name, @command_controller_name, @base_package, @base_folder = extract_names
    
    @model_names = list_as_files("app/flex/#{base_folder}/models")
    @command_names = list_as_files("app/flex/#{base_folder}/commands")
  end

  def manifest
    record do |m|      
      m.template 'controller.as.erb', File.join("app/flex/#{base_folder}/controllers", 
        "#{command_controller_name}.as")
    end
  end

  protected
    def banner
      "Usage: #{$0} #{spec.name}" 
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruboss4ruby-1.1.0 rails_generators/ruboss_controller/ruboss_controller_generator.rb