middleman 1.1.1.a → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
data/lib/middleman/features.rb
CHANGED
@@ -64,10 +64,6 @@ module Middleman::Features
|
|
64
64
|
# will attempt to generate a `sitemap.html` file from your project.
|
65
65
|
autoload :Slickmap, "middleman/features/slickmap"
|
66
66
|
|
67
|
-
# SmushPngs uses Yahoo's Smush.it API to compresses PNGs and JPGs. Often times
|
68
|
-
# the service can decrease the size of Photoshop-exported images by 30-50%
|
69
|
-
autoload :SmushPngs, "middleman/features/smush_pngs"
|
70
|
-
|
71
67
|
# CodeRay is a syntax highlighter.
|
72
68
|
autoload :CodeRay, "middleman/features/code_ray"
|
73
69
|
|
data/lib/middleman/version.rb
CHANGED
data/middleman.gemspec
CHANGED
@@ -34,8 +34,6 @@ Gem::Specification.new do |s|
|
|
34
34
|
s.add_runtime_dependency("compass", ["0.11.beta.6"])
|
35
35
|
s.add_runtime_dependency("chunky_png", ["~> 1.1.0"])
|
36
36
|
s.add_runtime_dependency("oily_png", ["~> 1.0"]) unless defined?(JRUBY_VERSION)
|
37
|
-
s.add_runtime_dependency("json", [">= 0"])
|
38
|
-
s.add_runtime_dependency("smusher", ["~> 0.4.5"])
|
39
37
|
s.add_runtime_dependency("compass-slickmap", ["~> 0.4.0"])
|
40
38
|
s.add_runtime_dependency("coffee-script", ["~> 2.1.0"])
|
41
39
|
s.add_runtime_dependency("less", ["~> 1.2.0"])
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
|
11
|
-
version: 1.1.1.a
|
9
|
+
- 2
|
10
|
+
version: 1.1.2
|
12
11
|
platform: ruby
|
13
12
|
authors:
|
14
13
|
- Thomas Reynolds
|
@@ -16,7 +15,7 @@ autorequire:
|
|
16
15
|
bindir: bin
|
17
16
|
cert_chain: []
|
18
17
|
|
19
|
-
date: 2011-04-
|
18
|
+
date: 2011-04-18 00:00:00 -07:00
|
20
19
|
default_executable:
|
21
20
|
dependencies:
|
22
21
|
- !ruby/object:Gem::Dependency
|
@@ -262,40 +261,10 @@ dependencies:
|
|
262
261
|
version: "1.0"
|
263
262
|
type: :runtime
|
264
263
|
version_requirements: *id015
|
265
|
-
- !ruby/object:Gem::Dependency
|
266
|
-
name: json
|
267
|
-
prerelease: false
|
268
|
-
requirement: &id016 !ruby/object:Gem::Requirement
|
269
|
-
none: false
|
270
|
-
requirements:
|
271
|
-
- - ">="
|
272
|
-
- !ruby/object:Gem::Version
|
273
|
-
hash: 3
|
274
|
-
segments:
|
275
|
-
- 0
|
276
|
-
version: "0"
|
277
|
-
type: :runtime
|
278
|
-
version_requirements: *id016
|
279
|
-
- !ruby/object:Gem::Dependency
|
280
|
-
name: smusher
|
281
|
-
prerelease: false
|
282
|
-
requirement: &id017 !ruby/object:Gem::Requirement
|
283
|
-
none: false
|
284
|
-
requirements:
|
285
|
-
- - ~>
|
286
|
-
- !ruby/object:Gem::Version
|
287
|
-
hash: 5
|
288
|
-
segments:
|
289
|
-
- 0
|
290
|
-
- 4
|
291
|
-
- 5
|
292
|
-
version: 0.4.5
|
293
|
-
type: :runtime
|
294
|
-
version_requirements: *id017
|
295
264
|
- !ruby/object:Gem::Dependency
|
296
265
|
name: compass-slickmap
|
297
266
|
prerelease: false
|
298
|
-
requirement: &
|
267
|
+
requirement: &id016 !ruby/object:Gem::Requirement
|
299
268
|
none: false
|
300
269
|
requirements:
|
301
270
|
- - ~>
|
@@ -307,11 +276,11 @@ dependencies:
|
|
307
276
|
- 0
|
308
277
|
version: 0.4.0
|
309
278
|
type: :runtime
|
310
|
-
version_requirements: *
|
279
|
+
version_requirements: *id016
|
311
280
|
- !ruby/object:Gem::Dependency
|
312
281
|
name: coffee-script
|
313
282
|
prerelease: false
|
314
|
-
requirement: &
|
283
|
+
requirement: &id017 !ruby/object:Gem::Requirement
|
315
284
|
none: false
|
316
285
|
requirements:
|
317
286
|
- - ~>
|
@@ -323,11 +292,11 @@ dependencies:
|
|
323
292
|
- 0
|
324
293
|
version: 2.1.0
|
325
294
|
type: :runtime
|
326
|
-
version_requirements: *
|
295
|
+
version_requirements: *id017
|
327
296
|
- !ruby/object:Gem::Dependency
|
328
297
|
name: less
|
329
298
|
prerelease: false
|
330
|
-
requirement: &
|
299
|
+
requirement: &id018 !ruby/object:Gem::Requirement
|
331
300
|
none: false
|
332
301
|
requirements:
|
333
302
|
- - ~>
|
@@ -339,11 +308,11 @@ dependencies:
|
|
339
308
|
- 0
|
340
309
|
version: 1.2.0
|
341
310
|
type: :runtime
|
342
|
-
version_requirements: *
|
311
|
+
version_requirements: *id018
|
343
312
|
- !ruby/object:Gem::Dependency
|
344
313
|
name: cucumber
|
345
314
|
prerelease: false
|
346
|
-
requirement: &
|
315
|
+
requirement: &id019 !ruby/object:Gem::Requirement
|
347
316
|
none: false
|
348
317
|
requirements:
|
349
318
|
- - ~>
|
@@ -355,11 +324,11 @@ dependencies:
|
|
355
324
|
- 0
|
356
325
|
version: 0.10.0
|
357
326
|
type: :development
|
358
|
-
version_requirements: *
|
327
|
+
version_requirements: *id019
|
359
328
|
- !ruby/object:Gem::Dependency
|
360
329
|
name: rspec
|
361
330
|
prerelease: false
|
362
|
-
requirement: &
|
331
|
+
requirement: &id020 !ruby/object:Gem::Requirement
|
363
332
|
none: false
|
364
333
|
requirements:
|
365
334
|
- - ">="
|
@@ -369,11 +338,11 @@ dependencies:
|
|
369
338
|
- 0
|
370
339
|
version: "0"
|
371
340
|
type: :development
|
372
|
-
version_requirements: *
|
341
|
+
version_requirements: *id020
|
373
342
|
- !ruby/object:Gem::Dependency
|
374
343
|
name: rocco
|
375
344
|
prerelease: false
|
376
|
-
requirement: &
|
345
|
+
requirement: &id021 !ruby/object:Gem::Requirement
|
377
346
|
none: false
|
378
347
|
requirements:
|
379
348
|
- - ">="
|
@@ -383,7 +352,7 @@ dependencies:
|
|
383
352
|
- 0
|
384
353
|
version: "0"
|
385
354
|
type: :development
|
386
|
-
version_requirements: *
|
355
|
+
version_requirements: *id021
|
387
356
|
description:
|
388
357
|
email:
|
389
358
|
- tdreyno@gmail.com
|
@@ -475,7 +444,6 @@ files:
|
|
475
444
|
- lib/middleman/features/relative_assets.rb
|
476
445
|
- lib/middleman/features/slickmap.rb
|
477
446
|
- lib/middleman/features/slickmap/template.html.haml
|
478
|
-
- lib/middleman/features/smush_pngs.rb
|
479
447
|
- lib/middleman/features/ugly_haml.rb
|
480
448
|
- lib/middleman/renderers/haml.rb
|
481
449
|
- lib/middleman/renderers/sass.rb
|
@@ -531,14 +499,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
531
499
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
532
500
|
none: false
|
533
501
|
requirements:
|
534
|
-
- - "
|
502
|
+
- - ">="
|
535
503
|
- !ruby/object:Gem::Version
|
536
|
-
hash:
|
504
|
+
hash: 3
|
537
505
|
segments:
|
538
|
-
-
|
539
|
-
|
540
|
-
- 1
|
541
|
-
version: 1.3.1
|
506
|
+
- 0
|
507
|
+
version: "0"
|
542
508
|
requirements: []
|
543
509
|
|
544
510
|
rubyforge_project: middleman
|
@@ -1,48 +0,0 @@
|
|
1
|
-
module Middleman::Features::SmushPngs
|
2
|
-
module ThorActions
|
3
|
-
def smush_pngs
|
4
|
-
# Read cache
|
5
|
-
cache_file = File.join(Middleman::Server.root, ".smush-cache")
|
6
|
-
cache_data = if File.exists?(cache_file)
|
7
|
-
Marshal.restore(File.read(cache_file))
|
8
|
-
else
|
9
|
-
{}
|
10
|
-
end
|
11
|
-
|
12
|
-
smush_dir = File.join(Middleman::Server.build_dir, Middleman::Server.images_dir)
|
13
|
-
|
14
|
-
files = ::Smusher.class_eval do
|
15
|
-
images_in_folder(smush_dir)
|
16
|
-
end
|
17
|
-
|
18
|
-
files.each do |file|
|
19
|
-
::Smusher.class_eval do
|
20
|
-
original_file_size = size(file)
|
21
|
-
return if original_file_size.zero?
|
22
|
-
return if cache_data[file] && cache_data[file] == original_file_size
|
23
|
-
|
24
|
-
with_logging(file, true) do
|
25
|
-
write_optimized_data(file)
|
26
|
-
cache_data[file] = size(file) # Add or update cache
|
27
|
-
File.open(cache_file, "w") { |f| f.write Marshal.dump(cache_data) } # Write cache
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
say_status :smushed, file.gsub(Middleman::Server.build_dir+"/", "")
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
class << self
|
37
|
-
def registered(app)
|
38
|
-
require "middleman/builder"
|
39
|
-
require "smusher"
|
40
|
-
require "json/pure"
|
41
|
-
|
42
|
-
Middleman::Builder.send :include, ThorActions
|
43
|
-
Middleman::Builder.after_run "smush_pngs" do
|
44
|
-
smush_pngs
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|