photo-cook 1.2.3 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 654d5fd2b8fe7bd8b296817062dc007a661aca94
4
- data.tar.gz: 4522e68c06b3955db4b81e08beed6bdfb3131e7b
3
+ metadata.gz: 4b183067366f3120d9a50a812562e4236106a599
4
+ data.tar.gz: e89b75704d7b123fb26f69bb53878fb2dd7c7c8f
5
5
  SHA512:
6
- metadata.gz: aa5c419b8b1c9dec864a590deaf2d494c0cabc508241d9a740d8261d57a2538fa86e5628301c032a928bd1f58ed4900cc959e8c10db6f2dcba739c07ce245503
7
- data.tar.gz: 84912264a46fb54cadcedfd6dc8c66979cc67021dbc7c9e1684f74ea8a5cf7f2061ac9231c8891492d6e042770065e5f64f2315566c1825ec966d21ac0bbbca6
6
+ metadata.gz: 1567b3e12e1c77463023e7cd9f9bdfd4bcdd26dce9781975944a6e8937abf5c2e73cb13cc25e7cf6592fd2316d10f5ed3c25a5deeca0be88e5d6a3ff1a7ec0b1
7
+ data.tar.gz: f1e65c98bfa38d1e475dbfc926db3badccdad1d4aaca22f98409af2d806143b99a4f27a80a62fa9db34b6292cf0f7452ade8f444f452cea1c9ce91f92993bf23
data/Gemfile CHANGED
@@ -1,3 +1,6 @@
1
+ # encoding: utf-8
2
+ # frozen_string_literal: true
3
+
1
4
  source 'https://rubygems.org'
2
5
 
3
6
  gemspec
data/Rakefile CHANGED
@@ -1,3 +1,6 @@
1
+ # encoding: utf-8
2
+ # frozen_string_literal: true
3
+
1
4
  begin
2
5
  require 'bundler/setup'
3
6
  rescue LoadError
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  module PhotoCookHelper
3
5
  def device_pixel_ratio
4
6
  PhotoCook.device_pixel_ratio
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  module PhotoCook
3
5
  module DevicePixelRatioSpy
4
6
  extend ActiveSupport::Concern
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  module PhotoCook
3
5
  module DevicePixelRatio
4
6
  DEFAULT = 1.0.freeze
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  module PhotoCook
3
5
  class Engine < ::Rails::Engine
4
6
  initializer :photo_cook_root do |app|
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  module PhotoCook
3
5
  class << self
4
6
  def notify(event, *params)
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  module PhotoCook
3
5
  class << self
4
6
  attr_accessor :logger
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  module PhotoCook
3
5
  module Optimization
4
6
  class << self
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  module PhotoCook
3
5
  module Optimization
4
6
  module CarrierWave
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  module PhotoCook
3
5
  module Optimization
4
6
  class ImageOptim
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  module PhotoCook
3
5
  module Optimization
4
6
  class Job < ActiveJob::Base
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  PhotoCook.subscribe 'optimization:success' do |path, original_size, new_size, msec|
3
5
  PhotoCook.log do
4
6
  diff = original_size - new_size
@@ -1,7 +1,9 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  module PhotoCook
3
5
  module Pixels
4
- MAX = 4256.freeze
6
+ MAX = 9999.freeze
5
7
 
6
8
  class << self
7
9
  def parse(x)
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  module PhotoCook
3
5
  module Resize
4
6
  class << self
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  module PhotoCook
3
5
  module Resize
4
6
  module Assemble
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  module PhotoCook
3
5
  module Resize
4
6
  module Calculations
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  module PhotoCook
3
5
  module Resize
4
6
  module CarrierWave
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  module PhotoCook
3
5
  module Resize
4
6
  module Command
@@ -10,7 +12,7 @@ module PhotoCook
10
12
  # http://dpi.lv/
11
13
  # http://www.canbike.org/CSSpixels/
12
14
  def regex
13
- @regex ||= /\A(?<mode>fit|fill)-(?<width>\d+)x(?<height>\d+)\z/
15
+ @regex ||= /\A(?<mode>fit|fill)-(?<width>[1-9]\d{0,3})x(?<height>[1-9]\d{0,3})\z/
14
16
  end
15
17
 
16
18
  # NOTE: This method performs no validation
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  PhotoCook.subscribe 'resize:middleware:match' do |uri|
3
5
  PhotoCook.log do
4
6
  log "PhotoCook::Resize::Middleware matched request for photo resize"
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  module PhotoCook
3
5
  module Resize
4
6
  class MagickPhoto < MiniMagick::Image
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  module PhotoCook
3
5
  module Resize
4
6
  class Middleware
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  module PhotoCook
3
5
  module Resize
4
6
  module Mode
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  module PhotoCook
3
5
  module Resize
4
6
  class << self
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  module PhotoCook
3
5
  module Utils
4
6
  class << self
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  module PhotoCook
3
- VERSION = '1.2.3'
5
+ VERSION = '1.2.4'
4
6
  end
data/lib/photo-cook.rb CHANGED
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  require 'fileutils'
3
5
  require 'pathname'
4
6
  require 'open3'
data/photo-cook.gemspec CHANGED
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  require File.expand_path('../lib/photo-cook/version', __FILE__)
3
5
 
4
6
  Gem::Specification.new do |s|
data/srcset.rb CHANGED
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  # def test_something
3
5
  # def lol(maxw, maxh, w, h)
4
6
  # ary = []
data/test/helper.rb CHANGED
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  module TestHelper
3
5
  class << self
4
6
  def fixtures_dirpath
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  require 'test/unit'
3
5
  require 'shoulda-context'
4
6
  require 'photo-cook'
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  require 'test/unit'
3
5
  require 'shoulda-context'
4
6
  require 'photo-cook'
@@ -1,4 +1,6 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
3
+
2
4
  require 'test/unit'
3
5
  require 'shoulda-context'
4
6
  require 'photo-cook'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: photo-cook
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yaroslav Konoplov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-15 00:00:00.000000000 Z
11
+ date: 2016-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack