lib/thesilverspoon.rb~ in thesilverspoon-0.0.4 vs lib/thesilverspoon.rb~ in thesilverspoon-0.0.5

- old
+ new

@@ -201,17 +201,17 @@ # If you use the NamedBase inheritance, a 'name' parameter has to follow the 'rails g integratedscaffold'. Won't work otherwise. If you don't want this, use ::Base end - #endd of class +#endd of class end module The_silver_spoon class Install < Rails::Generators::Base - def self.source_root + def self.source_root File.expand_path("../templates", __FILE__) end def initialize(*args, &block) @@ -221,18 +221,15 @@ Rails::Generators.invoke('gritter:locale') Rails::Generators.invoke('devise:install') Rails::Generators.invoke('devise', ["user"]) Rails::Generators.invoke('devise:views') Rails::Generators.invoke('cancan:ability') + end - - - - - - - + def create_appplication_helper + remove_file "app/helpers/application_helper.rb" + template 'application_helper.rb', "app/helpers/application_helper.rb" end def create_uploader #creates the uploader ruby file using carrierwave template 'file_uploader.rb', "app/uploaders/file_uploader.rb" @@ -254,16 +251,25 @@ end def create_javascripts # copies the standard javascripts into the assets/javascripts folder - Currently hard-coded - # TODO : Remove the hardcoding for the javascripts inclusion + # : Remove the hardcoding for the javascripts inclusion copy_file "#{Install.source_root}/assets/javascripts/jquery.dataTables.min.js", "app/assets/javascripts/jquery.dataTables.min.js" end + def create_stylesheet + template "#{Install.source_root}/assets/stylesheets/silverspoon.css.scss", "app/assets/stylesheets/silverspoon.css.scss" + template "#{Install.source_root}/assets/stylesheets/base_classes.css.scss", "app/assets/stylesheets/base_classes.css.scss" + template "#{Install.source_root}/assets/stylesheets/silverspoon.css.scss", "app/assets/stylesheets/information_page.css.scss" + template "#{Install.source_root}/assets/stylesheets/jquery-ui-1.8.17.custom.css", "app/assets/stylesheets/jquery-ui-1.8.17.custom.css" + + + end + def create_stylesheets_exclusions # copies the sequenced css into the assets/stylesheets/exclusions folder directory "#{Install.source_root}/assets/stylesheets/exclusions", "app/assets/stylesheets/exclusions" end @@ -291,9 +297,15 @@ template "#{Install.source_root}/layouts//dummy_data.html.erb", "app/views/layouts/scaffold.html.erb" template "#{Install.source_root}/layouts/information_page.html.erb", "app/views/layouts/information_page.html.erb" template "#{Install.source_root}/layouts/pageslide_form_at.html.erb", "app/views/layouts/pageslide_form_at.html.erb" template "#{Install.source_root}/layouts/welcome.html.erb", "app/views/layouts/welcome.html.erb" + end + + def insert_devise_code + prepend_to_file "config/application.rb",'require "devise"' + append_to_file "app/assets/stylesheets/application.css",'*=require_directory' +append_to_file "app/assets/javascripts/application.js",'//= require bootstrap' end end