Skip to content

Commit

Permalink
add asset manifest files and include them with the install generator
Browse files Browse the repository at this point in the history
  • Loading branch information
citrus committed Mar 7, 2012
1 parent 7d320a4 commit 4949617
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/assets/javascripts/admin/spree_essentials.js
@@ -0,0 +1 @@
//= require_tree .
5 changes: 5 additions & 0 deletions app/assets/stylesheets/admin/markitup.css.erb
Expand Up @@ -2,6 +2,11 @@
// markItUp! Universal MarkUp Engine, JQuery plugin
// By Jay Salvat - http://markitup.jaysalvat.com/
// ------------------------------------------------------------------*/

.markdown-helper {
margin-left: 1em;
}

.markItUp * {
margin:0px; padding:0px;
outline:none;
Expand Down
3 changes: 3 additions & 0 deletions app/assets/stylesheets/admin/spree_essentials.css
@@ -0,0 +1,3 @@
/*
*= require_tree ./
*/
13 changes: 13 additions & 0 deletions lib/generators/spree_essentials/install_generator.rb
Expand Up @@ -4,9 +4,22 @@ class InstallGenerator < Rails::Generators::Base

desc "Installs required migrations for spree_essentials"

class_option :add_stylesheets, :type => :boolean, :default => true, :banner => 'Append spree_essentials to admin/all.css'
class_option :add_javascripts, :type => :boolean, :default => true, :banner => 'Append spree_essentials to admin/all.js'

def copy_migrations
rake "spree_essentials:install:migrations"
end

def append_stylesheets
return unless options[:add_stylesheets]
gsub_file "app/assets/stylesheets/admin/all.css", "*/", "*= require admin/spree_essentials\n*/"
end

def append_javascripts
return unless options[:add_javascripts]
append_file "app/assets/javascripts/admin/all.js", "//= require admin/spree_essentials"
end

end
end
Expand Down

0 comments on commit 4949617

Please sign in to comment.