clogger 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -39,8 +39,8 @@ VERSION := $(shell git describe 2>/dev/null | sed 's/^v//')
39
39
  ifneq ($(VERSION),)
40
40
  v := /^v$(VERSION)$$/
41
41
  vPREV := $(shell git tag -l 2>/dev/null | sed -n -e '$(v)!h' -e '$(v){x;p;q}')
42
- release_notes := release_notes-$(VERSION).txt
43
- release_changes := release_changes-$(VERSION).txt
42
+ release_notes := release_notes-$(VERSION)
43
+ release_changes := release_changes-$(VERSION)
44
44
  release-notes: $(release_notes)
45
45
  release-changes: $(release_changes)
46
46
  $(release_changes): verify
@@ -48,8 +48,15 @@ $(release_changes): verify
48
48
  echo >> $@+
49
49
  git log $(vPREV)..v$(VERSION) >> $@+
50
50
  $(VISUAL) $@+ && test -s $@+ && mv $@+ $@
51
+ $(release_notes): pkggem = pkg/clogger-$(VERSION).gem
51
52
  $(release_notes): verify package
52
- gem spec pkg/clogger-$(VERSION).gem description | sed -ne '/\w/p' > $@+
53
+ gem spec $(pkggem) description | sed -ne '/\w/p' > $@+
54
+ echo >> $@+
55
+ gem spec $(pkggem) homepage | sed -ne 's/^--- /* /p' >> $@+
56
+ gem spec $(pkggem) email | sed -ne 's/^--- /* /p' >> $@+
57
+ echo '* git://git.bogomips.org/clogger.git' >> $@+
58
+ echo >> $@+
59
+ echo Changes: >> $@+
53
60
  echo >> $@+
54
61
  git cat-file tag v$(VERSION) | awk 'p>1{print $$0}/^$$/{++p}' >> $@+
55
62
  $(VISUAL) $@+ && test -s $@+ && mv $@+ $@
data/README CHANGED
@@ -71,6 +71,7 @@ somewhere inside the "Rails::Initializer.run do |config|" block:
71
71
  * $response_length - body_bytes_sent, except "-" instead of "0" (Apache: %b)
72
72
  * $remote_user - HTTP-authenticated user
73
73
  * $remote_addr - IP of the requesting client socket
74
+ * $status - three-digit HTTP status code (e.g. 200, 404, 302)
74
75
  * $ip - X-Forwarded-For request header if available, $remote_addr if not
75
76
  * $pid - process ID of the current process
76
77
  * $e{Thread.current} - Thread processing the request
@@ -109,20 +110,20 @@ Homepage: http://clogger.rubyforge.org/
109
110
 
110
111
  == INSTALL
111
112
 
112
- For all Rubygems users:
113
+ For Rubygems users:
113
114
 
114
115
  gem install clogger
115
116
 
116
- If you do not use Rubygems, you may also use setup.rb from tarballs from
117
- the Rubyforge project page:
117
+ If you do not use Rubygems, you may also use setup.rb from the tarballs
118
+ on the Rubyforge project page:
118
119
 
119
120
  * http://rubyforge.org/frs/?group_id=8896
120
121
 
121
122
  There is an optional C extension that should be compatible with MRI
122
123
  1.8/1.9. The extensions should automatically be disabled for users of
123
124
  other Ruby implementations, but be sure to let us know if that's not the
124
- case. No pre-built currently distributed, let us know if you're
125
- interested in helping with the release/support effort.
125
+ case. No pre-built binaries are currently distributed, let us know if
126
+ you're interested in helping with the release/support effort.
126
127
 
127
128
  == LICENSE
128
129
 
data/Rakefile CHANGED
@@ -10,12 +10,12 @@ task :history do
10
10
  tags = `git tag -l`.split(/\n/).grep(/^v/).reverse
11
11
  timefmt = '%Y-%m-%d %H:%M UTC'
12
12
  tags.each do |tag|
13
- header, subject, body = `git cat-file tag #{tag}`.split(/\n\n/)
13
+ header, subject, body = `git cat-file tag #{tag}`.split(/\n\n/, 3)
14
14
  tagger = header.split(/\n/).grep(/^tagger /).first.split(/\s/)
15
15
  time = Time.at(tagger[-2].to_i).utc
16
16
  puts "=== #{tag.sub(/^v/, '')} / #{time.strftime(timefmt)}"
17
17
  puts ""
18
- puts body
18
+ puts body.gsub(/^/sm, " ")
19
19
  puts ""
20
20
  end
21
21
  end
@@ -28,5 +28,5 @@ is customizable so you can specify exactly which fields to log.
28
28
  # HeaderHash wasn't case-insensitive in old versions
29
29
  s.add_dependency(%q<rack>, ["> 0.9"])
30
30
  s.extensions = %w(ext/clogger_ext/extconf.rb)
31
-
31
+ s.license = "LGPLv3"
32
32
  end
@@ -656,7 +656,9 @@ static VALUE clogger_close(VALUE self)
656
656
  {
657
657
  struct clogger *c = clogger_get(self);
658
658
 
659
- return rb_funcall(c->body, close_id, 0);
659
+ if (rb_respond_to(c->body, close_id))
660
+ return rb_funcall(c->body, close_id, 0);
661
+ return Qnil;
660
662
  }
661
663
 
662
664
  /* :nodoc: */
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: binary -*-
2
2
  class Clogger
3
- VERSION = '0.0.6'
3
+ VERSION = '0.0.7'
4
4
 
5
5
  OP_LITERAL = 0
6
6
  OP_REQUEST = 1
@@ -47,7 +47,7 @@ class Clogger
47
47
  end
48
48
 
49
49
  def close
50
- @body.close
50
+ @body.close if @body.respond_to?(:close)
51
51
  end
52
52
 
53
53
  def reentrant?
@@ -469,4 +469,24 @@ class TestClogger < Test::Unit::TestCase
469
469
  assert_equal "<GET /hello?goodbye=true HTTP/1.0>", s
470
470
  end
471
471
 
472
+ def test_clogger_body_not_closeable
473
+ s = ''
474
+ app = lambda { |env| [302, [ %w(a) ], []] }
475
+ cl = Clogger.new(app, :logger => s)
476
+ status, headers, body = cl.call(@req)
477
+ assert_nil body.close
478
+ end
479
+
480
+ def test_clogger_body_close_return_value
481
+ s = ''
482
+ body = []
483
+ def body.close
484
+ :foo
485
+ end
486
+ app = lambda { |env| [302, [ %w(a) ], body ] }
487
+ cl = Clogger.new(app, :logger => s)
488
+ status, headers, body = cl.call(@req)
489
+ assert_equal :foo, body.close
490
+ end
491
+
472
492
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clogger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Wong
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-08 00:00:00 -07:00
12
+ date: 2009-09-09 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -53,8 +53,8 @@ files:
53
53
  - test/test_clogger.rb
54
54
  has_rdoc: true
55
55
  homepage: http://clogger.rubyforge.org/
56
- licenses: []
57
-
56
+ licenses:
57
+ - LGPLv3
58
58
  post_install_message:
59
59
  rdoc_options:
60
60
  - -Na