Sha256: f07c6455e2785c0f705446ed32657191f6a461d864918f917ac168f5356865f2

Contents?: true

Size: 1.82 KB

Versions: 5

Compression:

Stored size: 1.82 KB

Contents

module Jinda_adminlte 
  class InstallGenerator < Rails::Generators::Base

    desc "Install jinda adminlte theme to existing Jinda app "
    def self.source_root
      File.dirname(__FILE__) + "/templates"
    end

    def setup_app
      inside("app/views/layouts") { run "mv application.haml application.haml.bak" }
      inside("app/views/layouts") { run "mv lte lte.bak" }
      inside("app/views/identities") { run "mv new.html.haml new-bak.html.haml" }
      inside("app/views/sessions") { run "mv new.html.haml new-bak.html.haml" }
      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/views/adminltes"
      directory "app/views/layouts/lte"
      directory "app/views/identities"
      directory "app/views/sessions"

    end

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

    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
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
jinda_adminlte-0.8.0 lib/generators/jinda_adminlte/install_generator.rb
jinda_adminlte-0.7.5.1 lib/generators/jinda_adminlte/install_generator.rb
jinda_adminlte-0.7.5 lib/generators/jinda_adminlte/install_generator.rb
jinda_adminlte-0.7.3 lib/generators/jinda_adminlte/install_generator.rb
jinda_adminlte-0.7.0.4 lib/generators/jinda_adminlte/install_generator.rb