clogger 2.0.2 → 2.1.0

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: dd4966f902d26e1a0037ddf465336678a0d342ed
4
- data.tar.gz: b2f531772d210d2823187a8de8c76a1f8cdf0387
3
+ metadata.gz: 7d599688759448c6bf0402ae0ffe376133f79caa
4
+ data.tar.gz: 87a801805a909d115597fd8fb89c839f81db9c59
5
5
  SHA512:
6
- metadata.gz: aa24a2c1f213548c32055f04bbeb1e113ec063d27f77fb264ae121cb865aba887f525366a52cc375731be2f121a5dc102053b1ee146deb3c21e2f33ba5d209e0
7
- data.tar.gz: 618537067d02ef74554bc5355b0364c5bb4260212ee7b6cca218fe74a683cfed4e88ce3d0c257d9d45e14a1826044368c373c34e79e977c73a67f3fbf2d867ce
6
+ metadata.gz: c77852c8b454f4e7b67c3c1de5701506d7196e6d9307a14808ba28e1c69b48032b37f03b6b9ef281821b5c35bf818214e7c5a25956e95d195c7f8ccda068c81a
7
+ data.tar.gz: 472bdd0b12d9d79d43ac97070c9daee1c156adf7eadb38c9d634a52cc6e72314f62dcf32d73bef4b9f6abbee387ef9603e90fd799ad1e3015023b897fbaafbaf
@@ -1,7 +1,13 @@
1
1
  ---
2
- rdoc_url: http://clogger.bogomips.org/
3
- cgit_url: http://bogomips.org/clogger.git
2
+ rdoc_url: https://bogomips.org/clogger/
3
+ cgit_url: https://bogomips.org/clogger.git
4
4
  git_url: git://bogomips.org/clogger.git
5
5
  public_email: clogger-public@bogomips.org
6
6
  private_email: clogger@bogomips.org
7
- ml_url: http://bogomips.org/clogger-public/
7
+ ml_url:
8
+ - https://bogomips.org/clogger-public/
9
+ - http://ou63pmih66umazou.onion/clogger-public/
10
+ - nntp://news.public-inbox.org/inbox.comp.lang.ruby.clogger
11
+ source_code:
12
+ - git clone git://bogomips.org/clogger.git
13
+ - git clone https://bogomips.org/clogger.git
@@ -1,7 +1,7 @@
1
1
  #!/bin/sh
2
2
 
3
3
  GVF=GIT-VERSION-FILE
4
- DEF_VER=v2.0.2
4
+ DEF_VER=v2.1.0
5
5
 
6
6
  LF='
7
7
  '
@@ -1,5 +1,5 @@
1
1
  all::
2
- RSYNC_DEST := clogger.bogomips.org:/srv/clogger/
2
+ RSYNC_DEST := bogomips.org:/srv/bogomips/clogger/
3
3
  rfpackage := clogger
4
4
  include pkg.mk
5
5
  test-ext:
data/LICENSE CHANGED
@@ -3,7 +3,7 @@ revision control for names and email addresses of all of them.
3
3
 
4
4
  You can redistribute it and/or modify it under the terms of the GNU
5
5
  Lesser General Public License (LGPL) as published by the Free Software
6
- Foundation, version {2.1}[http://www.gnu.org/licenses/lgpl-2.1.txt] or
6
+ Foundation, version {2.1}[https://www.gnu.org/licenses/lgpl-2.1.txt] or
7
7
  (at your option) any later version.
8
8
 
9
9
  clogger is distributed in the hope that it will be useful, but WITHOUT
@@ -12,5 +12,4 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12
12
  License for more details.
13
13
 
14
14
  You should have received a copy of the GNU Lesser General Public License
15
- along with this library; if not, write to the Free Software
16
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
15
+ along with this library; if not, see https://www.gnu.org/licenses/
data/README CHANGED
@@ -92,18 +92,18 @@ that receives a "<<" method:
92
92
 
93
93
  == REQUIREMENTS
94
94
 
95
- * {Ruby}[http://www.ruby-lang.org/], {Rack}[http://rack.github.io/]
95
+ * {Ruby}[https://www.ruby-lang.org/], {Rack}[https://rack.github.io/]
96
96
 
97
97
  == DEVELOPMENT
98
98
 
99
99
  The latest development happens in git and is published to the following:
100
100
 
101
- git://bogomips.org/clogger.git
102
- git://repo.or.cz/clogger.git
101
+ git clone git://bogomips.org/clogger.git
102
+ git clone git://repo.or.cz/clogger.git
103
103
 
104
104
  You may also browse and download snapshot tarballs:
105
105
 
106
- * http://bogomips.org/clogger.git (cgit)
106
+ * https://bogomips.org/clogger.git
107
107
  * http://repo.or.cz/w/clogger.git (gitweb)
108
108
 
109
109
  The mailing list (see below) is central for coordination and
@@ -119,7 +119,7 @@ requests) go to the public mailing list.
119
119
 
120
120
  Do not send HTML mail or attachments. Do not top post.
121
121
 
122
- Homepage: http://clogger.bogomips.org/
122
+ Homepage: https://bogomips.org/clogger/
123
123
 
124
124
  == INSTALL
125
125
 
@@ -17,8 +17,7 @@ Gem::Specification.new do |s|
17
17
  s.test_files = %w(test/test_clogger.rb test/test_clogger_to_path.rb)
18
18
 
19
19
  # HeaderHash wasn't case-insensitive in old versions
20
- s.add_dependency(%q<rack>, ["~> 1.0"])
21
- s.add_development_dependency(%q<olddoc>, "~> 1.0")
20
+ s.add_dependency(%q<rack>, ['>= 1.0', '< 3.0'])
22
21
  s.extensions = %w(ext/clogger_ext/extconf.rb)
23
22
 
24
23
  s.licenses = %w(LGPL-2.1+)
@@ -54,6 +54,9 @@ static ssize_t my_write(int fd, const void *buf, size_t count)
54
54
 
55
55
  return r;
56
56
  }
57
- # define stat(path,buf) my_stat((path),(buf))
58
- # define write(fd,buf,count) my_write((fd),(buf),(count))
57
+ # define nogvl_stat(path,buf) my_stat((path),(buf))
58
+ # define nogvl_write(fd,buf,count) my_write((fd),(buf),(count))
59
+ #else /* !WITHOUT_GVL, for Ruby 1.8 users: */
60
+ # define nogvl_stat(path,buf) stat((path),(buf))
61
+ # define nogvl_write(fd,buf,buf) write((fd),(buf),(count))
59
62
  #endif /* !WITHOUT_GVL */
@@ -243,7 +243,7 @@ static void write_full(int fd, const char *buf, size_t count)
243
243
  ssize_t r;
244
244
 
245
245
  while (count > 0) {
246
- r = write(fd, buf, count);
246
+ r = nogvl_write(fd, buf, count);
247
247
 
248
248
  if ((size_t)r == count) { /* overwhelmingly likely */
249
249
  return;
@@ -993,7 +993,7 @@ static VALUE to_path(VALUE self)
993
993
  if (sscanf(cpath, "/dev/fd/%u", &devfd) == 1)
994
994
  rv = fstat((int)devfd, &sb);
995
995
  else
996
- rv = stat(cpath, &sb);
996
+ rv = nogvl_stat(cpath, &sb);
997
997
 
998
998
  /*
999
999
  * calling this method implies the web server will bypass
@@ -5,12 +5,12 @@ class Clogger
5
5
  # predefined log formats in wide use
6
6
  module Format
7
7
  # common log format used by Apache:
8
- # http://httpd.apache.org/docs/2.2/logs.html
8
+ # https://httpd.apache.org/docs/2.4/logs.html
9
9
  Common = "$remote_addr - $remote_user [$time_local] " \
10
10
  '"$request" $status $response_length'
11
11
 
12
12
  # combined log format used by Apache:
13
- # http://httpd.apache.org/docs/2.2/logs.html
13
+ # https://httpd.apache.org/docs/2.4/logs.html
14
14
  Combined = %Q|#{Common} "$http_referer" "$http_user_agent"|
15
15
 
16
16
  # combined log format used by nginx:
@@ -53,7 +53,7 @@ class Clogger
53
53
  def each
54
54
  @body_bytes_sent = 0
55
55
  @body.each do |part|
56
- @body_bytes_sent += Rack::Utils.bytesize(part)
56
+ @body_bytes_sent += part.bytesize
57
57
  yield part
58
58
  end
59
59
  self
@@ -147,6 +147,7 @@ class TestClogger < Test::Unit::TestCase
147
147
  req = {
148
148
  'HTTP_HOST' => 'example.com:12345',
149
149
  'HTTP_COOKIE' => cookie,
150
+ 'REMOTE_USER' => 'foo_user',
150
151
  }
151
152
  req = @req.merge(req)
152
153
  body = cl.call(req).last
@@ -154,6 +155,7 @@ class TestClogger < Test::Unit::TestCase
154
155
  body.close
155
156
  str = str.string
156
157
  assert(str.size > 128)
158
+ assert_equal 'foo_user', str.split(' ')[2]
157
159
  assert_match %r["echo and socat \\o/" "#{cookie}" \d+\.\d{3}], str
158
160
  assert_match %r["#{cookie}" \d+\.\d{3} example\.com:12345\n\z], str
159
161
  end
metadata CHANGED
@@ -1,43 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clogger
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - cloggers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-27 00:00:00.000000000 Z
11
+ date: 2016-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.0'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '3.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.0'
27
- - !ruby/object:Gem::Dependency
28
- name: olddoc
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
27
+ - - ">="
32
28
  - !ruby/object:Gem::Version
33
29
  version: '1.0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
30
+ - - "<"
39
31
  - !ruby/object:Gem::Version
40
- version: '1.0'
32
+ version: '3.0'
41
33
  description: |-
42
34
  clogger is Rack middleware for logging HTTP requests. The log format
43
35
  is customizable so you can specify exactly which fields to log.
@@ -83,7 +75,7 @@ files:
83
75
  - setup.rb
84
76
  - test/test_clogger.rb
85
77
  - test/test_clogger_to_path.rb
86
- homepage: http://clogger.bogomips.org/
78
+ homepage: https://bogomips.org/clogger/
87
79
  licenses:
88
80
  - LGPL-2.1+
89
81
  metadata: {}
@@ -103,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
95
  version: '0'
104
96
  requirements: []
105
97
  rubyforge_project:
106
- rubygems_version: 2.4.5
98
+ rubygems_version: 2.6.6
107
99
  signing_key:
108
100
  specification_version: 4
109
101
  summary: configurable request logging for Rack