middleman-smusher 0.2.0 → 3.0.0.beta.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,29 +1,8 @@
1
- module Middleman
2
- module Features
3
- module Smusher
4
- class << self
5
- def registered(app)
6
- require "smusher"
7
-
8
- app.after_build do
9
- smush_dir = File.join(app.build_dir, app.images_dir)
10
-
11
- files = ::Smusher.class_eval do
12
- images_in_folder(smush_dir)
13
- end
14
-
15
- files.each do |file|
16
- ::Smusher.optimize_image(
17
- [file],
18
- { :service => 'PunyPng', :quiet => true }
19
- )
20
-
21
- say_status :smushed, file.gsub(app.build_dir+"/", "")
22
- end
23
- end
24
- end
25
- alias :included :registered
26
- end
27
- end
28
- end
1
+ require "middleman-core"
2
+
3
+ require "middleman-smusher/version"
4
+
5
+ ::Middleman::Extensions.register(:smusher, ">= 3.0.0.beta.2") do
6
+ require "middleman-smusher/extension"
7
+ ::Middleman::Smusher
29
8
  end
@@ -0,0 +1,38 @@
1
+ module Middleman
2
+ module Smusher
3
+ class << self
4
+ def registered(app, options={})
5
+ require "smusher"
6
+
7
+ # options[:service] ||= "SmushIt"
8
+ options[:quiet] = true
9
+
10
+ app.after_configuration do
11
+ smush_dir = if options.has_key?(:path)
12
+ options.delete(:path)
13
+ else
14
+ File.join(build_dir, images_dir)
15
+ end
16
+
17
+ prefix = build_dir + File::SEPARATOR
18
+
19
+ after_build do |builder|
20
+ files = ::Smusher.class_eval do
21
+ images_in_folder(smush_dir)
22
+ end
23
+
24
+ files.each do |file|
25
+ ::Smusher.optimize_image(
26
+ [file],
27
+ options
28
+ )
29
+
30
+ builder.say_status :smushed, file.sub(prefix, "")
31
+ end
32
+ end
33
+ end
34
+ end
35
+ alias :included :registered
36
+ end
37
+ end
38
+ end
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module Smusher
3
- VERSION = "0.2.0"
3
+ VERSION = "3.0.0.beta.2"
4
4
  end
5
5
  end
@@ -19,6 +19,6 @@ Gem::Specification.new do |s|
19
19
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
20
  s.require_paths = ["lib"]
21
21
 
22
- s.add_runtime_dependency("middleman", ["~> 2.0.2"])
23
- s.add_runtime_dependency("smusher", ["~> 0.4.8"])
22
+ s.add_runtime_dependency("middleman", [">= 3.0.0.beta.2"])
23
+ s.add_runtime_dependency("smusher", ["~> 0.4.9"])
24
24
  end
metadata CHANGED
@@ -1,13 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-smusher
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
5
- prerelease:
4
+ hash: 62196423
5
+ prerelease: 6
6
6
  segments:
7
+ - 3
7
8
  - 0
8
- - 2
9
9
  - 0
10
- version: 0.2.0
10
+ - beta
11
+ - 2
12
+ version: 3.0.0.beta.2
11
13
  platform: ruby
12
14
  authors:
13
15
  - Thomas Reynolds
@@ -15,40 +17,42 @@ autorequire:
15
17
  bindir: bin
16
18
  cert_chain: []
17
19
 
18
- date: 2011-08-20 00:00:00 Z
20
+ date: 2012-04-25 00:00:00 Z
19
21
  dependencies:
20
22
  - !ruby/object:Gem::Dependency
23
+ type: :runtime
21
24
  name: middleman
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
25
+ version_requirements: &id001 !ruby/object:Gem::Requirement
24
26
  none: false
25
27
  requirements:
26
- - - ~>
28
+ - - ">="
27
29
  - !ruby/object:Gem::Version
28
- hash: 11
30
+ hash: 62196423
29
31
  segments:
30
- - 2
32
+ - 3
33
+ - 0
31
34
  - 0
35
+ - beta
32
36
  - 2
33
- version: 2.0.2
34
- type: :runtime
35
- version_requirements: *id001
37
+ version: 3.0.0.beta.2
38
+ prerelease: false
39
+ requirement: *id001
36
40
  - !ruby/object:Gem::Dependency
41
+ type: :runtime
37
42
  name: smusher
38
- prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
43
+ version_requirements: &id002 !ruby/object:Gem::Requirement
40
44
  none: false
41
45
  requirements:
42
46
  - - ~>
43
47
  - !ruby/object:Gem::Version
44
- hash: 31
48
+ hash: 29
45
49
  segments:
46
50
  - 0
47
51
  - 4
48
- - 8
49
- version: 0.4.8
50
- type: :runtime
51
- version_requirements: *id002
52
+ - 9
53
+ version: 0.4.9
54
+ prerelease: false
55
+ requirement: *id002
52
56
  description: Compress images in your Middleman project
53
57
  email:
54
58
  - me@tdreyno.com
@@ -63,8 +67,9 @@ files:
63
67
  - Gemfile
64
68
  - Rakefile
65
69
  - lib/middleman-smusher.rb
70
+ - lib/middleman-smusher/extension.rb
66
71
  - lib/middleman-smusher/version.rb
67
- - lib/middleman_init.rb
72
+ - lib/middleman_extension.rb
68
73
  - middleman-smusher.gemspec
69
74
  homepage: https://github.com/tdreyno/middleman-smusher
70
75
  licenses: []
@@ -86,16 +91,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
86
91
  required_rubygems_version: !ruby/object:Gem::Requirement
87
92
  none: false
88
93
  requirements:
89
- - - ">="
94
+ - - ">"
90
95
  - !ruby/object:Gem::Version
91
- hash: 3
96
+ hash: 25
92
97
  segments:
93
- - 0
94
- version: "0"
98
+ - 1
99
+ - 3
100
+ - 1
101
+ version: 1.3.1
95
102
  requirements: []
96
103
 
97
104
  rubyforge_project: middleman-smusher
98
- rubygems_version: 1.8.6
105
+ rubygems_version: 1.8.18
99
106
  signing_key:
100
107
  specification_version: 3
101
108
  summary: Compress images in your Middleman project