diff --git a/lib/middleman/features.rb b/lib/middleman/features.rb index 5cafd0d8..f57bffbc 100644 --- a/lib/middleman/features.rb +++ b/lib/middleman/features.rb @@ -64,10 +64,6 @@ module Middleman::Features # will attempt to generate a `sitemap.html` file from your project. autoload :Slickmap, "middleman/features/slickmap" - # SmushPngs uses Yahoo's Smush.it API to compresses PNGs and JPGs. Often times - # the service can decrease the size of Photoshop-exported images by 30-50% - autoload :SmushPngs, "middleman/features/smush_pngs" - # CodeRay is a syntax highlighter. autoload :CodeRay, "middleman/features/code_ray" diff --git a/lib/middleman/features/smush_pngs.rb b/lib/middleman/features/smush_pngs.rb deleted file mode 100644 index ab0e2855..00000000 --- a/lib/middleman/features/smush_pngs.rb +++ /dev/null @@ -1,48 +0,0 @@ -module Middleman::Features::SmushPngs - module ThorActions - def smush_pngs - # Read cache - cache_file = File.join(Middleman::Server.root, ".smush-cache") - cache_data = if File.exists?(cache_file) - Marshal.restore(File.read(cache_file)) - else - {} - end - - smush_dir = File.join(Middleman::Server.build_dir, Middleman::Server.images_dir) - - files = ::Smusher.class_eval do - images_in_folder(smush_dir) - end - - files.each do |file| - ::Smusher.class_eval do - original_file_size = size(file) - return if original_file_size.zero? - return if cache_data[file] && cache_data[file] == original_file_size - - with_logging(file, true) do - write_optimized_data(file) - cache_data[file] = size(file) # Add or update cache - File.open(cache_file, "w") { |f| f.write Marshal.dump(cache_data) } # Write cache - end - end - - say_status :smushed, file.gsub(Middleman::Server.build_dir+"/", "") - end - end - end - - class << self - def registered(app) - require "middleman/builder" - require "smusher" - require "json/pure" - - Middleman::Builder.send :include, ThorActions - Middleman::Builder.after_run "smush_pngs" do - smush_pngs - end - end - end -end \ No newline at end of file diff --git a/lib/middleman/templates/default/config.tt b/lib/middleman/templates/default/config.tt index 0f43c0b6..cfef2135 100755 --- a/lib/middleman/templates/default/config.tt +++ b/lib/middleman/templates/default/config.tt @@ -49,9 +49,6 @@ configure :build do # Minify Javascript on build # activate :minify_javascript - # Shrink/smush PNG/JPEGs on build - # activate :smush_pngs - # Enable cache buster # activate :cache_buster diff --git a/lib/middleman/templates/html5/config.tt b/lib/middleman/templates/html5/config.tt index 67e092bb..7a916ea9 100755 --- a/lib/middleman/templates/html5/config.tt +++ b/lib/middleman/templates/html5/config.tt @@ -37,9 +37,6 @@ configure :build do # Minify Javascript on build # activate :minify_javascript - # Shrink/smush PNG/JPEGs on build - # activate :smush_pngs - # Enable cache buster # activate :cache_buster diff --git a/lib/middleman/version.rb b/lib/middleman/version.rb index c3da7aa1..ee556552 100644 --- a/lib/middleman/version.rb +++ b/lib/middleman/version.rb @@ -1,3 +1,3 @@ module Middleman - VERSION = "1.1.1.a" + VERSION = "1.1.2" end diff --git a/middleman.gemspec b/middleman.gemspec index c19c8622..210dea35 100644 --- a/middleman.gemspec +++ b/middleman.gemspec @@ -34,8 +34,6 @@ Gem::Specification.new do |s| s.add_runtime_dependency("compass", ["0.11.beta.6"]) s.add_runtime_dependency("chunky_png", ["~> 1.1.0"]) s.add_runtime_dependency("oily_png", ["~> 1.0"]) unless defined?(JRUBY_VERSION) - s.add_runtime_dependency("json", [">= 0"]) - s.add_runtime_dependency("smusher", ["~> 0.4.5"]) s.add_runtime_dependency("compass-slickmap", ["~> 0.4.0"]) s.add_runtime_dependency("coffee-script", ["~> 2.1.0"]) s.add_runtime_dependency("less", ["~> 1.2.0"])