racknga 0.9.4 → 0.9.5

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
  SHA256:
3
- metadata.gz: cd550e89e845e0e90ccac2ef34bf3823e03639b0d61e71fe75ee02bb9ad63e2a
4
- data.tar.gz: 4365f32450b7b0a9fc95b77cfbe3403119b8f2623824f3b4be199ec594255011
3
+ metadata.gz: a79351d478e9f65c4a538c46887772e03d50a40ec6184cd293a66c4fd3b17693
4
+ data.tar.gz: 6063c757219857417651798caa288da2467e891faadaf0ff1699b1ac0f171d0a
5
5
  SHA512:
6
- metadata.gz: a1d84e5281d56bd2f520d0483f1a9ba6cdd1dafbc363268e466b4fea860dd832892d7b5d84ec9ba6d38ebc74d5d356603e7857543ea21029a512fa0b1cd438ae
7
- data.tar.gz: f983eab4c092d7d2215d2d52310ff51dc3568be0fb197444f4a5f0a8a7c36ef806cb45a2451b38636994d9fac6d53cda6ca07008d91f0d18557cf5f2d8ff0fc9
6
+ metadata.gz: 7b5143554b8e2ded028e10e37f74b6b01064c12a8bfc8fee957bbb0167748cbb043c9ebb0ccbc7e9949239bd095bb971f449dc85e4a4fb7688647b4536fce905
7
+ data.tar.gz: 902a9509717410a4f9221f7d12b7398485ab7a0ecb2996e80874ffd97f050d52446aca77e20d2a6c2f9365110742d97d55b3704481f6a3debf0070387f82ff50
data/README.md ADDED
@@ -0,0 +1,44 @@
1
+ # README
2
+
3
+ ## Name
4
+
5
+ Racknga
6
+
7
+ ## Description
8
+
9
+ Rack middlewares that use Rroonga features and
10
+ middlewares/utilities that don't use Rroonga features.
11
+
12
+ * [Rroonga](https://ranguba.org/)
13
+ * [Rack](https://rack.github.io/)
14
+
15
+ ## Authors
16
+
17
+ * Sutou Kouhei `<kou@clear-code.com>`
18
+
19
+ ## License
20
+
21
+ LGPL 2.1 or later. See license/lgpl-2.1.txt for details.
22
+
23
+ (Sutou Kouhei has a right to change the license
24
+ including contributed patches.)
25
+
26
+ ## Dependencies
27
+
28
+ * Ruby >= 1.9.1
29
+ * Rroonga
30
+ * Rack
31
+
32
+ ## Suggested libraries
33
+
34
+ * jpmobile
35
+
36
+ ## Install
37
+
38
+ ```console
39
+ $ sudo gem install racknga
40
+ ```
41
+
42
+ ## Documents
43
+
44
+ https://ranguba.org/racknga/en/
data/Rakefile CHANGED
@@ -50,7 +50,7 @@ end
50
50
 
51
51
  desc "Run test"
52
52
  task :test do
53
- ruby("-rubygems", "test/run-test.rb")
53
+ ruby("test/run-test.rb")
54
54
  end
55
55
 
56
56
  task :default => :test
@@ -1,16 +1,25 @@
1
- h1. NEWS
1
+ # NEWS
2
2
 
3
- h2. 0.9.4: 2023-09-03
3
+ ## 0.9.5: 2024-04-08
4
4
 
5
- h3. Improvments
5
+ ### Improvments
6
+
7
+ * Added `base64` dependency.
8
+ * Added `net-smtp` dependency.
9
+ * Removed `nkf` dependency.
10
+ * Stopped using deprecated APIs of Rack.
11
+
12
+ ## 0.9.4: 2023-09-03
13
+
14
+ ### Improvments
6
15
 
7
16
  * [cache] Made Rroonga dependency optional. Users must add Rroonga
8
17
  dependency explicitly.
9
18
  * And more improvements...
10
19
 
11
- h2. 0.9.3: 2011-11-12
20
+ ## 0.9.3: 2011-11-12
12
21
 
13
- h3. Improvments
22
+ ### Improvments
14
23
 
15
24
  * [access-log-parser] Supported Apache log.
16
25
  * [cache] Fixed unknown name errors.
@@ -20,9 +29,9 @@ h3. Improvments
20
29
  * [exception-mail-notifier] Used #message instead of #to_s.
21
30
  * [logger] Logged also X-Runtime.
22
31
 
23
- h2. 0.9.2: 2011-08-07
32
+ ## 0.9.2: 2011-08-07
24
33
 
25
- h3. Improvments
34
+ ### Improvments
26
35
 
27
36
  * [munin] Supported Passenger 3 support.
28
37
  * [munin] Removed Passenger 2 support.
@@ -36,7 +45,7 @@ h3. Improvments
36
45
  * Added NginixAccessLogParser.
37
46
  * Documented middlewares.
38
47
 
39
- h2. 0.9.1: 2010-11-11
48
+ ## 0.9.1: 2010-11-11
40
49
 
41
50
  * Improved cache validation.
42
51
  * Supported caches per User-Agent.
@@ -47,6 +56,6 @@ h2. 0.9.1: 2010-11-11
47
56
  * Changed license to LGPLv2.1 or later from LGPLv2.1.
48
57
  * Supported will_paginate.
49
58
 
50
- h2. 0.9.0: 2010-07-04
59
+ ## 0.9.0: 2010-07-04
51
60
 
52
61
  * Initial release!
@@ -1,6 +1,5 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
1
  # Copyright (C) 2012 Haruka Yoshihara <yoshihara@clear-code.com>
2
+ # Copyright (C) 2024 Sutou Kouhei <kou@clear-code.com>
4
3
  #
5
4
  # This library is free software; you can redistribute it and/or
6
5
  # modify it under the terms of the GNU Lesser General Public
@@ -32,7 +31,7 @@ module Racknga
32
31
  # @return [Boolean] true if an API key is included, or false if not.
33
32
  def include?(environment)
34
33
  request = Rack::Request.new(environment)
35
- key = request[@query_parameter]
34
+ key = request.params[@query_parameter]
36
35
 
37
36
  @api_keys.include?(key)
38
37
  end
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2010-2011 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2010-2024 Sutou Kouhei <kou@clear-code.com>
4
2
  #
5
3
  # This library is free software; you can redistribute it and/or
6
4
  # modify it under the terms of the GNU Lesser General Public
@@ -16,13 +14,13 @@
16
14
  # License along with this library; if not, write to the Free Software
17
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
16
 
19
- require 'time'
20
- require 'net/smtp'
21
- require 'etc'
22
- require 'socket'
23
- require 'nkf'
17
+ require "base64"
18
+ require "etc"
19
+ require "net/smtp"
20
+ require "socket"
21
+ require "time"
24
22
 
25
- require 'racknga/utils'
23
+ require "racknga/utils"
26
24
 
27
25
  module Racknga
28
26
  # Ruby 1.9 only. 1.8 isn't supported.
@@ -198,10 +196,13 @@ EOB
198
196
  def encode_subject(subject)
199
197
  case charset
200
198
  when /\Aiso-2022-jp\z/i
201
- NKF.nkf('-Wj -M', subject)
202
- else
203
- NKF.nkf('-Ww -M', subject)
199
+ subject = subject.encode("ISO-2022-JP")
200
+ end
201
+ base64_subject = Base64.encode64(subject)
202
+ lines = base64_subject.lines.collect do |line|
203
+ "=?#{charset}?B?#{line.chomp}?="
204
204
  end
205
+ lines.join("\r\n")
205
206
  end
206
207
  end
207
208
  end
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2010 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2010-2024 Sutou Kouhei <kou@clear-code.com>
4
2
  #
5
3
  # This library is free software; you can redistribute it and/or
6
4
  # modify it under the terms of the GNU Lesser General Public
@@ -138,7 +136,7 @@ module Racknga
138
136
  def skip_caching_response?(status, headers, body)
139
137
  return true if status != 200
140
138
 
141
- headers = Rack::Utils::HeaderHash.new(headers)
139
+ headers = Rack::Headers[headers]
142
140
  content_type = headers["Content-Type"]
143
141
  if /\A(\w+)\/([\w.+\-]+)\b/ =~ content_type
144
142
  media_type = $1
@@ -167,7 +165,7 @@ module Racknga
167
165
  end
168
166
 
169
167
  now = Time.now
170
- headers = Rack::Utils::HeaderHash.new(headers)
168
+ headers = Rack::Headers[headers]
171
169
  headers["Last-Modified"] ||= now.httpdate
172
170
  encoded_body = ''.force_encoding("ASCII-8BIT")
173
171
  deflater = ::Zlib::Deflate.new
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2010-2012 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2010-2024 Sutou Kouhei <kou@clear-code.com>
4
2
  #
5
3
  # This library is free software; you can redistribute it and/or
6
4
  # modify it under the terms of the GNU Lesser General Public
@@ -84,11 +82,11 @@ module Racknga
84
82
  # For Rack.
85
83
  def call(environment)
86
84
  request = Rack::Request.new(environment)
87
- callback = request["callback"]
85
+ callback = request.params["callback"]
88
86
  update_cache_key(request) if callback
89
87
  status, headers, body = @application.call(environment)
90
88
  return [status, headers, body] unless callback
91
- header_hash = Rack::Utils::HeaderHash.new(headers)
89
+ header_hash = Rack::Headers[headers]
92
90
  return [status, headers, body] unless json_response?(header_hash)
93
91
  body = Writer.new(callback, body)
94
92
  update_header_hash(header_hash, body)
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2010 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2010-2024 Sutou Kouhei <kou@clear-code.com>
4
2
  #
5
3
  # This library is free software; you can redistribute it and/or
6
4
  # modify it under the terms of the GNU Lesser General Public
@@ -38,7 +36,7 @@ module Racknga
38
36
  status, headers, body = @application.call(environment)
39
37
  return [status, headers, body] if status != 200
40
38
 
41
- headers = Rack::Utils::HeaderHash.new(headers)
39
+ headers = Rack::Headers[headers]
42
40
  headers["Accept-Ranges"] = "bytes"
43
41
  request = Rack::Request.new(environment)
44
42
  range = request.env["HTTP_RANGE"]
@@ -60,7 +58,7 @@ module Racknga
60
58
 
61
59
  if first_byte.empty? and last_byte.empty?
62
60
  headers["Content-Length"] = "0"
63
- return [Rack::Utils.status_code(:requested_range_not_satisfiable),
61
+ return [Rack::Utils.status_code(:range_not_satisfiable),
64
62
  headers,
65
63
  []]
66
64
  end
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2010-2011 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2010-2023 Sutou Kouhei <kou@clear-code.com>
4
2
  #
5
3
  # This library is free software; you can redistribute it and/or
6
4
  # modify it under the terms of the GNU Lesser General Public
@@ -17,5 +15,5 @@
17
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
16
 
19
17
  module Racknga
20
- VERSION = '0.9.4'
18
+ VERSION = "0.9.5"
21
19
  end
@@ -22,11 +22,6 @@ require 'racknga/middleware/auth/api-key'
22
22
  require 'racknga/middleware/cache'
23
23
  require 'racknga/middleware/instance_name'
24
24
 
25
- Capybara.configure do |config|
26
- config.default_driver = nil
27
- config.current_driver = nil
28
- end
29
-
30
25
  module RackngaTestUtils
31
26
  include Capybara::DSL
32
27
 
data/test/run-test.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  #
3
- # Copyright (C) 2010-2011 Kouhei Sutou <kou@clear-code.com>
3
+ # Copyright (C) 2010-2024 Sutou Kouhei <kou@clear-code.com>
4
4
  #
5
5
  # This library is free software; you can redistribute it and/or
6
6
  # modify it under the terms of the GNU Lesser General Public
@@ -31,7 +31,6 @@ require "rubygems"
31
31
  require "bundler/setup"
32
32
 
33
33
  require 'test/unit'
34
- require 'test/unit/notify'
35
34
 
36
35
  Test::Unit::Priority.enable
37
36
 
metadata CHANGED
@@ -1,17 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: racknga
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-09-03 00:00:00.000000000 Z
10
+ date: 2024-04-08 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
- name: rack
13
+ name: base64
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - ">="
@@ -25,13 +24,41 @@ dependencies:
25
24
  - !ruby/object:Gem::Version
26
25
  version: '0'
27
26
  - !ruby/object:Gem::Dependency
28
- name: RedCloth
27
+ name: csv
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - ">="
32
31
  - !ruby/object:Gem::Version
33
32
  version: '0'
34
- type: :development
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ - !ruby/object:Gem::Dependency
41
+ name: net-smtp
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ - !ruby/object:Gem::Dependency
55
+ name: rack
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ type: :runtime
35
62
  prerelease: false
36
63
  version_requirements: !ruby/object:Gem::Requirement
37
64
  requirements:
@@ -53,7 +80,7 @@ dependencies:
53
80
  - !ruby/object:Gem::Version
54
81
  version: '0'
55
82
  - !ruby/object:Gem::Dependency
56
- name: packnga
83
+ name: kramdown
57
84
  requirement: !ruby/object:Gem::Requirement
58
85
  requirements:
59
86
  - - ">="
@@ -67,7 +94,7 @@ dependencies:
67
94
  - !ruby/object:Gem::Version
68
95
  version: '0'
69
96
  - !ruby/object:Gem::Dependency
70
- name: rake
97
+ name: packnga
71
98
  requirement: !ruby/object:Gem::Requirement
72
99
  requirements:
73
100
  - - ">="
@@ -81,7 +108,7 @@ dependencies:
81
108
  - !ruby/object:Gem::Version
82
109
  version: '0'
83
110
  - !ruby/object:Gem::Dependency
84
- name: rroonga
111
+ name: rake
85
112
  requirement: !ruby/object:Gem::Requirement
86
113
  requirements:
87
114
  - - ">="
@@ -95,7 +122,7 @@ dependencies:
95
122
  - !ruby/object:Gem::Version
96
123
  version: '0'
97
124
  - !ruby/object:Gem::Dependency
98
- name: test-unit
125
+ name: rroonga
99
126
  requirement: !ruby/object:Gem::Requirement
100
127
  requirements:
101
128
  - - ">="
@@ -109,7 +136,7 @@ dependencies:
109
136
  - !ruby/object:Gem::Version
110
137
  version: '0'
111
138
  - !ruby/object:Gem::Dependency
112
- name: test-unit-capybara
139
+ name: test-unit
113
140
  requirement: !ruby/object:Gem::Requirement
114
141
  requirements:
115
142
  - - ">="
@@ -123,7 +150,7 @@ dependencies:
123
150
  - !ruby/object:Gem::Version
124
151
  version: '0'
125
152
  - !ruby/object:Gem::Dependency
126
- name: test-unit-notify
153
+ name: test-unit-capybara
127
154
  requirement: !ruby/object:Gem::Requirement
128
155
  requirements:
129
156
  - - ">="
@@ -142,13 +169,13 @@ email:
142
169
  executables: []
143
170
  extensions: []
144
171
  extra_rdoc_files:
145
- - README.textile
172
+ - README.md
146
173
  files:
147
174
  - AUTHORS
148
175
  - Gemfile
149
- - README.textile
176
+ - README.md
150
177
  - Rakefile
151
- - doc/text//news.textile
178
+ - doc/text//news.md
152
179
  - lib/racknga.rb
153
180
  - lib/racknga/access_log_parser.rb
154
181
  - lib/racknga/api-keys.rb
@@ -185,7 +212,6 @@ homepage: http://ranguba.org/
185
212
  licenses:
186
213
  - LGPLv2.1 or later
187
214
  metadata: {}
188
- post_install_message:
189
215
  rdoc_options: []
190
216
  require_paths:
191
217
  - lib
@@ -200,8 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
200
226
  - !ruby/object:Gem::Version
201
227
  version: '0'
202
228
  requirements: []
203
- rubygems_version: 3.5.0.dev
204
- signing_key:
229
+ rubygems_version: 3.6.0.dev
205
230
  specification_version: 4
206
231
  summary: A Rack middleware collection for Rroonga features.
207
232
  test_files:
data/README.textile DELETED
@@ -1,53 +0,0 @@
1
- h1. README
2
-
3
- h2. Name
4
-
5
- Racknga
6
-
7
- h2. Description
8
-
9
- Rack middlewares that use Rroonga features and
10
- middlewares/utilities that don't use Rroonga features.
11
-
12
- * "Rroonga":http://ranguba.org/
13
- * "Rack":http://rack.github.io/
14
-
15
- h2. Authors
16
-
17
- * Kouhei Sutou <kou@clear-code.com>
18
-
19
- h2. License
20
-
21
- LGPL 2.1 or later. See license/lgpl-2.1.txt for details.
22
-
23
- (Kouhei Sutou has a right to change the license
24
- including contributed patches.)
25
-
26
- h2. Dependencies
27
-
28
- * Ruby >= 1.9.1
29
- * Rroonga
30
- * Rack
31
-
32
- h2. Suggested libraries
33
-
34
- * jpmobile
35
-
36
- h2. Install
37
-
38
- <pre>
39
- % sudo gem install racknga
40
- </pre>
41
-
42
- h2. Documents
43
-
44
- http://ranguba.org/racknga/en/
45
-
46
- h2. Mailing list
47
-
48
- * English: "groonga-talk":http://lists.sourceforge.net/mailman/listinfo/groonga-talk
49
- * Japanese: "groonga-dev":http://lists.sourceforge.jp/mailman/listinfo/groonga-dev
50
-
51
- h2. Thanks
52
-
53
- * ...