kanoko 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/kanoko/application/convert.rb +10 -4
- data/lib/kanoko/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: ffa8552fcdaf4c45ea00ce88b97dacb9f763c842
         | 
| 4 | 
            +
              data.tar.gz: 372f96bb23aac7d9a2e81a00d7184606e3c76747
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 732f5d80d8a18f124ccd63409b67897c36466766bbd060e8090d6ee8546c8bb1e21cddbaef07fb00f370edcfb51b7dc6a1d875b74cb3e57c979db2c0f25f125b
         | 
| 7 | 
            +
              data.tar.gz: 94056f5166082d2303b88503eb09041ea6f8049a1bc710d1baca9b5a10d3b5635bafb08d8f1d9473cfd9923cc0267b4670a2a744387dc957f99017ba0f414b24
         | 
| @@ -45,12 +45,17 @@ module Kanoko | |
| 45 45 | 
             
                      h[ext] = i.to_s
         | 
| 46 46 | 
             
                    end
         | 
| 47 47 | 
             
                  end
         | 
| 48 | 
            +
                  QUERY_REGEXP = /\?.*/
         | 
| 48 49 |  | 
| 49 50 | 
             
                  # /123abc456def=/resize/200x200/crop/100x100/path/to/src
         | 
| 50 51 | 
             
                  get '/:hash/*' do
         | 
| 51 52 | 
             
                    # REQUEST_URI dependent on unicorn.
         | 
| 52 53 | 
             
                    # request.path should be use only testing
         | 
| 53 | 
            -
                    raw_request_uri = env["REQUEST_URI"] | 
| 54 | 
            +
                    raw_request_uri = if env["REQUEST_URI"]
         | 
| 55 | 
            +
                                        env["REQUEST_URI"]
         | 
| 56 | 
            +
                                      else
         | 
| 57 | 
            +
                                        "#{request.path}#{request.params.empty? ? "" : "?#{request.query_string}"}"
         | 
| 58 | 
            +
                                      end
         | 
| 54 59 | 
             
                    request_params = raw_request_uri.split('/').tap(&:shift)
         | 
| 55 60 | 
             
                    hash = request_params.shift
         | 
| 56 61 | 
             
                    unless 0 < request_params.length
         | 
| @@ -61,7 +66,7 @@ module Kanoko | |
| 61 66 | 
             
                    list = Kanoko::Application::Convert::Function.list
         | 
| 62 67 | 
             
                    convert_options = []
         | 
| 63 68 | 
             
                    arguments = []
         | 
| 64 | 
            -
                    to_ext = File.extname(request_params.last)[1..-1]
         | 
| 69 | 
            +
                    to_ext = File.extname(request_params.last).sub(QUERY_REGEXP, '')[1..-1]
         | 
| 65 70 | 
             
                    while id = request_params.shift.to_sym
         | 
| 66 71 | 
             
                      if id == :to
         | 
| 67 72 | 
             
                        to_ext = request_params.shift
         | 
| @@ -101,13 +106,14 @@ module Kanoko | |
| 101 106 | 
             
                        "#{t}:"
         | 
| 102 107 | 
             
                      else
         | 
| 103 108 | 
             
                        ""
         | 
| 104 | 
            -
             | 
| 109 | 
            +
                      end
         | 
| 105 110 |  | 
| 106 111 | 
             
                      dst_name = if to_ext.nil?
         | 
| 107 112 | 
             
                        "dst"
         | 
| 108 113 | 
             
                      else
         | 
| 109 114 | 
             
                        ["dst", ".#{to_ext}"]
         | 
| 110 | 
            -
             | 
| 115 | 
            +
                      end
         | 
| 116 | 
            +
             | 
| 111 117 | 
             
                      Tempfile.create(dst_name) do |dst_file|
         | 
| 112 118 | 
             
                        system_command = [
         | 
| 113 119 | 
             
                          { "OMP_NUM_THREADS" => "1" },
         | 
    
        data/lib/kanoko/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: kanoko
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.3. | 
| 4 | 
            +
              version: 0.3.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - ksss
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2016-04- | 
| 11 | 
            +
            date: 2016-04-20 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: sinatra
         |