Class: CrawlerEngineGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Extended by:
ActiveRecord::Generators::Migration
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/crawler_engine_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



10
11
12
# File 'lib/generators/crawler_engine_generator.rb', line 10

def self.source_root
	File.expand_path('../templates', __FILE__)
end

Instance Method Details

#crate_model_fileObject



18
19
20
21
# File 'lib/generators/crawler_engine_generator.rb', line 18

def crate_model_file
	template 'post.rb', 'app/models/post.rb'
	template 'source.rb', 'app/models/source.rb'
end

#create_migration_fileObject



14
15
16
# File 'lib/generators/crawler_engine_generator.rb', line 14

def create_migration_file
	migration_template 'migration.rb', 'db/migrate/create_crawler_engine'
end