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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c8ae72b9c1732baa61ae18d0454a30d2a246fcd
4
- data.tar.gz: 2e1122b7b11dce472368b5e252a25a44aeef57b5
3
+ metadata.gz: ffa8552fcdaf4c45ea00ce88b97dacb9f763c842
4
+ data.tar.gz: 372f96bb23aac7d9a2e81a00d7184606e3c76747
5
5
  SHA512:
6
- metadata.gz: e8ecc2d16be738fa47c45e2c55c544a5aca200d2184b023bea55ef17441df0eafcf817e701759189c3a27f0b9dcf1f07523ed8a4cc6e5b1e9d1ddda864e8dae1
7
- data.tar.gz: 3e56068dc8148d8b230bf768b08549561b0da67328a1065d1ed2c011d1dc99cc4f4272bd0be280d9b27f8011b4b70c5281c8cc8c55b95bd6b3a9bbc15bd2e9dc
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"] || request.path
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
- end
109
+ end
105
110
 
106
111
  dst_name = if to_ext.nil?
107
112
  "dst"
108
113
  else
109
114
  ["dst", ".#{to_ext}"]
110
- end
115
+ end
116
+
111
117
  Tempfile.create(dst_name) do |dst_file|
112
118
  system_command = [
113
119
  { "OMP_NUM_THREADS" => "1" },
@@ -1,3 +1,3 @@
1
1
  module Kanoko
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
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.0
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-18 00:00:00.000000000 Z
11
+ date: 2016-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra