Class: Jinda_adminbsb::InstallGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



4
5
6
# File 'lib/generators/jinda_adminbsb/install_generator.rb', line 4

def self.source_root
  File.dirname(__FILE__) + "/templates"
end

Instance Method Details

#copy_themeObject



19
20
21
22
23
24
25
26
# File 'lib/generators/jinda_adminbsb/install_generator.rb', line 19

def copy_theme
    copy_file "application.js","app/assets/javascripts/application.js"
    copy_file "jindabsb.js","app/assets/javascripts/jindabsb.js"
    copy_file "application.css.scss","app/assets/stylesheets/application.css.scss"
    copy_file "jindabsb.css.scss","app/assets/stylesheets/jindabsb.css.scss"
    copy_file "application.haml","app/views/layouts/application.haml"
    copy_file "adminbsbs_controller.rb","app/controllers/adminbsbs_controller.rb"
end

#finishObject



28
29
30
31
32
33
34
35
36
37
# File 'lib/generators/jinda_adminbsb/install_generator.rb', line 28

def finish        
  puts "------------------------------------------------\n"
  puts "                                                \n"
  puts "  Jinda Theme installation finished             \n"
  puts "  Note: last jinda_assets was move to tmp/cache \n"
  puts "  To delte run the following command            \n"
  puts "                                                \n"
  puts "rake tmp:cache:clear                            \n"
  puts "------------------------------------------------\n"
end

#setup_appObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/generators/jinda_adminbsb/install_generator.rb', line 8

def setup_app
  inside("app/views/layouts") { run "mv application.haml application.haml.bak" }
  inside("app/views/layouts") { run "mv bsb bsb.bak" }
  inside("app/assets") { run "mv jinda_assets ../../tmp/cache" }
  inside("app/assets") { run "mv javascripts ../../tmp/cache" }
  inside("app/assets") { run "mv stylesheets ../../tmp/cache" }
  directory "app/assets/jinda_assets"
  directory "app/views/adminbsbs"
  directory "app/views/layouts/bsb"  
end