Browse files

Merge remote-tracking branch 'jondot/master'

Close #4
Conflicts:
	guard-sprockets.gemspec
	lib/guard/sprockets.rb
	lib/guard/sprockets/version.rb
  • Loading branch information...
2 parents 11e4908 + 4c6ebac commit 02aa51e11f1a8027b9464f48e9e34edb022b2b7f @pferdefleisch committed Mar 22, 2012
Showing with 12 additions and 2 deletions.
  1. +0 −1 guard-sprockets.gemspec
  2. +10 −0 lib/guard/sprockets.rb
  3. +2 −1 lib/guard/sprockets/version.rb
View
1 guard-sprockets.gemspec
@@ -1,6 +1,5 @@
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
-require 'guard/sprockets/version'
Gem::Specification.new do |s|
s.name = "guard-sprockets"
View
10 lib/guard/sprockets.rb
@@ -16,6 +16,16 @@ def initialize(watchers=[], options={})
@sprockets.append_path p
end
+ if options.delete(:minify)
+ begin
+ require 'uglifier'
+ @sprockets_env.js_compressor = ::Uglifier.new
+ UI.info "Sprockets will compress output (minify)."
+ rescue
+ UI.error "minify: Uglifier cannot be loaded. No compression will be used.\nPlease include 'uglifier' in your Gemfile.\n#{$!}"
+ end
+ end
+ # store the output destination
@destination = options.delete(:destination)
@root_file = options.delete(:root_file)
View
3 lib/guard/sprockets/version.rb
@@ -1,5 +1,6 @@
+#encoding: utf-8
module Guard
module SprocketsVersion
VERSION = "0.2.0"
end
-end
+end

0 comments on commit 02aa51e

Please sign in to comment.