Sha256: f58607ef52fd62551352a2e84a5c279baa8415b31b203394faeed7d9af0760cf

Contents?: true

Size: 918 Bytes

Versions: 4

Compression:

Stored size: 918 Bytes

Contents

require File.join(File.dirname(__FILE__), '..', '..', 'lib', 'restfulx') if !defined?(RestfulX)

class RxControllerGenerator < Rails::Generator::Base
  include RestfulX::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
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
dima-restfulx-1.2.0 rails_generators/rx_controller/rx_controller_generator.rb
dima-restfulx-1.2.1 rails_generators/rx_controller/rx_controller_generator.rb
restfulx-1.2.1 rails_generators/rx_controller/rx_controller_generator.rb
restfulx-1.2.0 rails_generators/rx_controller/rx_controller_generator.rb