Sha256: 0061b087e1270399915139d8ce249824907771296ad75c836341f6523eb15018

Contents?: true

Size: 1.04 KB

Versions: 6

Compression:

Stored size: 1.04 KB

Contents

require 'rails/generators/rails/scaffold/scaffold_generator'

class ScaffoldhubGenerator < Rails::Generators::ScaffoldGenerator

  include Scaffoldhub::Helper

  remove_hook_for :scaffold_controller
  hook_for        :scaffold_controller, :as => :scaffoldhub

  remove_hook_for :orm
  hook_for        :orm, :as= => :scaffoldhub

  class_option :scaffold, :default => 'default', :banner => "SCAFFOLD_NAME",  :type => :string,  :desc => "Scaffold to use"
  class_option :local,    :default => false,     :banner => "LOCAL SCAFFOLD", :type => :boolean, :desc => "Use a local scaffold, not scaffoldhub.org"

  def download_and_copy_other_files
    each_template_file(:template) do |template_file|
      template  template_file.src, replace_name_tokens(template_file.dest)
    end
    each_template_file(:file) do |template_file|
      copy_file template_file.src, replace_name_tokens(template_file.dest)
    end
  end

  def add_gems_to_gemfile
    each_gem do |args|
      gem(*args)
    end
  end

  def display_post_install_message
    say post_install_message
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
scaffoldhub-0.1.3 lib/generators/scaffoldhub/scaffoldhub_generator.rb
scaffoldhub-0.1.2 lib/generators/scaffoldhub/scaffoldhub_generator.rb
scaffoldhub-0.1.1 lib/generators/scaffoldhub/scaffoldhub_generator.rb
scaffoldhub-0.1.0 lib/generators/scaffoldhub/scaffoldhub_generator.rb
scaffoldhub-0.0.14 lib/generators/scaffoldhub/scaffoldhub_generator.rb
scaffoldhub-0.0.13 lib/generators/scaffoldhub/scaffoldhub_generator.rb