class UnifiedPayment::InstallGenerator
Public Class Methods
source_root()
click to toggle source
I can later access that option using: options
# File lib/generators/unified_payment/install_generator.rb, line 13 def self.source_root @source_root ||= File.join(File.dirname(__FILE__), 'templates') end
Public Instance Methods
create_migrations()
click to toggle source
Generator Code. Remember this is just suped-up Thor so methods are executed in order
# File lib/generators/unified_payment/install_generator.rb, line 18 def create_migrations Dir["#{self.class.source_root}/migrations/*.rb"].sort.each do |filepath| name = File.basename(filepath) template "migrations/#{name}", "db/migrate/#{name}" sleep 1 end end