middleman-minify-html 3.0.0.beta.3 → 3.0.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,3 +1,5 @@
1
1
  .DS_Store
2
2
  Gemfile.lock
3
3
  tmp
4
+ .rbenv-*
5
+ pkg
data/.travis.yml CHANGED
@@ -2,8 +2,9 @@ rvm:
2
2
  - 1.8.7
3
3
  - 1.9.2
4
4
  - 1.9.3
5
+ - jruby-18mode
6
+ - jruby-19mode
7
+
5
8
  script: "bundle exec rake test"
6
9
 
7
- branches:
8
- only:
9
- - master
10
+ env: TEST=true
data/Rakefile CHANGED
@@ -4,7 +4,12 @@ Bundler::GemHelper.install_tasks
4
4
  require 'cucumber/rake/task'
5
5
 
6
6
  Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t|
7
- t.cucumber_opts = "--color --tags ~@wip --strict --format #{ENV['CUCUMBER_FORMAT'] || 'Fivemat'}"
7
+ ENV["TEST"] = "true"
8
+
9
+ exempt_tags = ""
10
+ exempt_tags << "--tags ~@nojava" if RUBY_PLATFORM == "java"
11
+
12
+ t.cucumber_opts = "--color --tags ~@wip #{exempt_tags} --strict --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'}"
8
13
  end
9
14
 
10
15
  require 'rake/clean'
@@ -29,4 +29,4 @@ Feature: Minify HTML
29
29
  """
30
30
  And a successfully built app at "basic-app"
31
31
  When I cd to "build"
32
- Then the file "index.html" should contain "<h1> Multi Line </h1> <h2> Broken Up </h2>"
32
+ Then the file "index.html" should contain "<h1> Multi Line </h1><h2> Broken Up </h2>"
@@ -1,50 +1,20 @@
1
1
  module Middleman
2
2
  module MinifyHtml
3
3
  class << self
4
- def registered(app)
4
+ def registered(app, options={})
5
5
  app.set :html_compressor, false
6
6
 
7
7
  app.after_configuration do
8
8
  unless respond_to?(:html_compressor) && html_compressor
9
- require 'html_compressor'
10
- set :html_compressor, ::HtmlCompressor::HtmlCompressor.new
9
+ require 'htmlcompressor'
10
+ set :html_compressor, ::HtmlCompressor::Compressor.new(options)
11
11
  end
12
12
 
13
13
  # Setup Rack to watch for inline JS
14
- use MinifyHtmlRack, :compressor => html_compressor
14
+ use ::HtmlCompressor::Rack, options
15
15
  end
16
16
  end
17
17
  alias :included :registered
18
18
  end
19
-
20
- class MinifyHtmlRack
21
-
22
- # Init
23
- # @param [Class] app
24
- # @param [Hash] options
25
- def initialize(app, options={})
26
- @app = app
27
- @compressor = options[:compressor]
28
- end
29
-
30
- # Rack interface
31
- # @param [Rack::Environmemt] env
32
- # @return [Array]
33
- def call(env)
34
- status, headers, response = @app.call(env)
35
-
36
- path = env["PATH_INFO"]
37
-
38
- if path.end_with?('.html')
39
- uncompressed_source = ::Middleman::Util.extract_response_text(response)
40
- minified_html = @compressor.compress(uncompressed_source)
41
-
42
- headers["Content-Length"] = ::Rack::Utils.bytesize(minified_html).to_s
43
- response = [minified_html]
44
- end
45
-
46
- [status, headers, response]
47
- end
48
- end
49
19
  end
50
20
  end
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module MinifyHtml
3
- VERSION = "3.0.0.beta.3"
3
+ VERSION = "3.0.0.rc.1"
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
1
  require "middleman-core"
2
2
 
3
- ::Middleman::Extensions.register(:minify_html, ">= 3.0.0.beta.3") do
3
+ ::Middleman::Extensions.register(:minify_html) do
4
4
  require "middleman-minify-html/extension"
5
5
  ::Middleman::MinifyHtml
6
6
  end
@@ -16,9 +16,9 @@ Gem::Specification.new do |s|
16
16
 
17
17
  s.files = `git ls-files`.split("\n")
18
18
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ # s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
20
  s.require_paths = ["lib"]
21
21
 
22
22
  s.add_runtime_dependency("middleman-core", [">= 3.0.0.beta.3"])
23
- s.add_runtime_dependency("html_compressor")
23
+ s.add_runtime_dependency("htmlcompressor")
24
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-minify-html
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.beta.3
4
+ version: 3.0.0.rc.1
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-21 00:00:00.000000000Z
12
+ date: 2012-06-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: middleman-core
16
- requirement: &70134298159860 !ruby/object:Gem::Requirement
16
+ requirement: &70141864374620 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.0.0.beta.3
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70134298159860
24
+ version_requirements: *70141864374620
25
25
  - !ruby/object:Gem::Dependency
26
- name: html_compressor
27
- requirement: &70134298159440 !ruby/object:Gem::Requirement
26
+ name: htmlcompressor
27
+ requirement: &70141864374200 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70134298159440
35
+ version_requirements: *70141864374200
36
36
  description: A html whitespace minifier for Middleman
37
37
  email:
38
38
  - me@tdreyno.com
@@ -69,7 +69,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
69
69
  version: '0'
70
70
  segments:
71
71
  - 0
72
- hash: 2516722774850114131
72
+ hash: 105983893746764668
73
73
  required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
78
  version: 1.3.1
79
79
  requirements: []
80
80
  rubyforge_project: middleman-minify-html
81
- rubygems_version: 1.8.10
81
+ rubygems_version: 1.8.11
82
82
  signing_key:
83
83
  specification_version: 3
84
84
  summary: A html whitespace minifier for Middleman