Class: Maglev::Hyperui::InstallGenerator

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#theme_nameObject (readonly)

Returns the value of attribute theme_name.



8
9
10
# File 'lib/generators/maglev/hyperui/install/install_generator.rb', line 8

def theme_name
  @theme_name
end

Instance Method Details

#copy_editor_headerObject



27
28
29
30
31
32
33
# File 'lib/generators/maglev/hyperui/install/install_generator.rb', line 27

def copy_editor_header
  if Gem.loaded_specs["maglevcms"].version > Gem::Version.new("2")
    FileUtils.rm_rf(Rails.root.join('app/views/maglev'))
  else
    FileUtils.rm_rf(Rails.root.join('app/views/layouts/maglev'))
  end        
end

#copy_pro_theme_and_sectionsObject



20
21
22
23
24
25
# File 'lib/generators/maglev/hyperui/install/install_generator.rb', line 20

def copy_pro_theme_and_sections
  return if theme_name.blank?
  rake('maglev_pro:hyperui_kit:create_pro_version')
  directory 'app_pro', 'app'
  directory 'public_pro', 'public'
end

#copy_theme_and_sectionsObject



14
15
16
17
18
# File 'lib/generators/maglev/hyperui/install/install_generator.rb', line 14

def copy_theme_and_sections
  return if theme_name.present?
  directory 'app'
  directory 'public'
end

#set_theme_nameObject



10
11
12
# File 'lib/generators/maglev/hyperui/install/install_generator.rb', line 10

def set_theme_name
  @theme_name = options['theme']
end