Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: didip/jammit
base: 28ddf14bc7
...
head fork: didip/jammit
compare: 072a9ed7be
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
Commits on Mar 29, 2012
@didip Actually sets :jsmin as DEFAULT_JAVASCRIPT_COMPRESSOR AND :cssmin as …
…DEFAULT_CSS_COMPRESSOR. They both are loaded inside `lib/jammit/dependencies.rb`
05fdcb0
@didip Fixed SASS test, it actually cares about single vs double quotes. 072a9ed
View
5 lib/jammit.rb
@@ -24,11 +24,11 @@ module Jammit
JAVASCRIPT_COMPRESSORS = [:jsmin, :yui, :closure, :uglifier]
- DEFAULT_JAVASCRIPT_COMPRESSOR = :yui
+ DEFAULT_JAVASCRIPT_COMPRESSOR = :jsmin
CSS_COMPRESSORS = [:cssmin, :yui, :sass]
- DEFAULT_CSS_COMPRESSOR = :yui
+ DEFAULT_CSS_COMPRESSOR = :cssmin
# Extension matchers for JavaScript and JST, which need to be disambiguated.
JS_EXTENSION = /\.js\Z/
@@ -93,6 +93,7 @@ def self.load_configuration(config_path, soft=false)
@compressor_options = symbolize_keys(conf[:compressor_options] || {})
@css_compressor_options = symbolize_keys(conf[:css_compressor_options] || {})
set_javascript_compressor(conf[:javascript_compressor])
+ set_css_compressor(conf[:css_compressor])
set_package_assets(conf[:package_assets])
set_template_function(conf[:template_function])
set_template_namespace(conf[:template_namespace])
View
2  lib/jammit/dependencies.rb
@@ -42,6 +42,8 @@
Jammit.load_configuration(Jammit::DEFAULT_CONFIG_PATH, true) if defined?(Rails)
# Jammit Core:
+require 'jsmin'
+require 'cssmin'
require 'jammit/jsmin_compressor'
require 'jammit/cssmin_compressor'
require 'jammit/compressor'
View
1  test/fixtures/jammed/css_test-sass.css
@@ -0,0 +1 @@
+#hello{color:white;background:blue}#hello .world{border:1px solid red;margin-left:10px;margin-right:10px;margin-bottom:45px;margin-top:45px}#another{color:white;background:blue}#css .file{border:1px solid red;margin-left:10px;margin-right:10px;margin-bottom:45px;margin-top:45px}#with_images{background:url(../embed/asterisk_yellow.png?101)}#and_relative_paths{background:url(../embed/asterisk_orange.png?101)}#and_real_urls{background:url(http://example.com/image.png)}@font-face{font-family:'DroidSansMonoRegular';src:url(../embed/DroidSansMono.eot?101);src:local("Droid Sans Mono Regular"),local("DroidSansMono"),url(../embed/DroidSansMono.ttf?101) format("truetype")}
View
15 test/unit/test_sass_compressor.rb
@@ -1,19 +1,10 @@
require 'test_helper'
class SassCompressorTest < Test::Unit::TestCase
-
- def setup
- Jammit.load_configuration('test/config/assets-sass.yml').reload!
- @compressor = Compressor.new
- end
-
- def teardown
- Jammit.load_configuration('test/config/assets.yml').reload!
- end
-
def test_css_compression
- packed = @compressor.compress_css(glob('test/fixtures/src/*.css'))
- assert_equal File.read('test/fixtures/jammed/css_test.css'), packed
+ Jammit.load_configuration('test/config/assets-sass.yml')
+ packed = Compressor.new.compress_css(glob('test/fixtures/src/*.css'))
+ assert_equal File.read('test/fixtures/jammed/css_test-sass.css'), packed
end
end

No commit comments for this range

Something went wrong with that request. Please try again.