Class: ContactUs::Tasks::Install
- Inherits:
-
Object
- Object
- ContactUs::Tasks::Install
- Defined in:
- lib/contact_us/tasks/install.rb
Class Method Summary collapse
- .copy_initializer_file ⇒ Object
- .copy_locales_files ⇒ Object
- .copy_view_files ⇒ Object
- .run ⇒ Object
Class Method Details
.copy_initializer_file ⇒ Object
13 14 15 16 17 |
# File 'lib/contact_us/tasks/install.rb', line 13 def copy_initializer_file print "Copying initializer file...\n" app_path = Rails.root.join("config/initializers") copier.copy_file File.join(gem_path, 'lib/templates/contact_us.rb'), File.join(app_path, 'contact_us.rb') end |
.copy_locales_files ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/contact_us/tasks/install.rb', line 19 def copy_locales_files print "Copying locales files...\n" locales_path = gem_path + "/config/locales/*.yml" app_path = Rails.root.join("config/locales") unless File.directory?(app_path) app_path.mkdir end Dir.glob(locales_path).each do |file| copier.copy_file file, File.join(app_path, File.basename(file)) end end |
.copy_view_files ⇒ Object
33 34 35 36 37 38 |
# File 'lib/contact_us/tasks/install.rb', line 33 def copy_view_files print "Copying view files...\n" origin = File.join(gem_path, 'app/views') destination = Rails.root.join('app/views') copy_files(['.'], origin, destination) end |
.run ⇒ Object
8 9 10 11 |
# File 'lib/contact_us/tasks/install.rb', line 8 def run copy_initializer_file puts "Done!" end |