lib/dj_dashboard/tasks/install.rb in dj_dashboard-0.0.5 vs lib/dj_dashboard/tasks/install.rb in dj_dashboard-0.0.6
- old
+ new
@@ -4,25 +4,33 @@
module Tasks
class Install
def self.run
puts 'installing dj_dashboard'
copy_assets_files
- copy_migration_files
+ copy_db_files
+ copy_config_files
end
def self.copy_assets_files
return nil if Rails.version =~ /3.0/ # not needed for rails 3.0
origin = File.join(gem_path, 'public')
destination = Rails.root.join('app/assets') if Rails.version =~ /3.1/
destination = Rails.root.join('public') if Rails.version =~ /3.0/
puts copy_files(%w( stylesheets images javascripts ), origin, destination, 'dj_dashboard')
end
- def self.copy_migration_files
- puts 'now copying migration files'
+ def self.copy_db_files
+ puts 'now copying db files'
origin = File.join(gem_path, 'db')
destination = Rails.root.join('db')
puts copy_files(%w( migrate ), origin, destination)
+ end
+
+ def self.copy_config_files
+ puts 'now copying initializer file'
+ origin = File.join(gem_path, 'config')
+ destination = Rails.root.join('config')
+ puts copy_files(%w( initializers ), origin, destination)
end
def self.gem_path
File.expand_path('../../..', File.dirname(__FILE__))
end