Class: Lolita::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/lolita/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_initializerObject



7
8
9
# File 'lib/generators/lolita/install_generator.rb', line 7

def copy_initializer
  template "lolita.rb", "config/initializers/lolita.rb" unless File.exist?(Rails.root + "config/initializers/lolita.rb")
end

#copy_tinymceObject



11
12
13
# File 'lib/generators/lolita/install_generator.rb', line 11

def copy_tinymce
  template "tinymce.yml", "config/tinymce.yml" unless File.exist?(Rails.root + "config/tinymce.yml")
end

#install_modulesObject



15
16
17
18
19
# File 'lib/generators/lolita/install_generator.rb', line 15

def install_modules
  Lolita.modules.each do |module_name|
    invoke "lolita:#{module_name.to_s.underscore.gsub("/","_").gsub(/^lolita_/,"")}:install" rescue nil
  end
end