rack-revision-info 0.4 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
data/lib/rack-revision-info.rb
CHANGED
@@ -4,7 +4,7 @@ module Rack
|
|
4
4
|
|
5
5
|
def initialize(app, opts={})
|
6
6
|
@app = app
|
7
|
-
path = opts[:path] or raise ArgumentError, "You must specify directory of your local repository
|
7
|
+
path = opts[:path] or raise ArgumentError, "You must specify directory of your local repository with :path option"
|
8
8
|
revision, date = get_revision_info(path, opts)
|
9
9
|
@revision_info = "#{get_revision_label(opts)} #{revision || 'unknown'}"
|
10
10
|
@revision_info << " (#{date.strftime(get_date_format(opts))})" if date
|
@@ -40,7 +40,7 @@ module Rack
|
|
40
40
|
puts e.backtrace
|
41
41
|
end
|
42
42
|
body << %(\n<!-- #{@revision_info} -->\n)
|
43
|
-
headers["Content-Length"] = body.
|
43
|
+
headers["Content-Length"] = body.bytesize.to_s
|
44
44
|
body = [body]
|
45
45
|
end
|
46
46
|
[status, headers, body]
|
@@ -2,13 +2,14 @@ require 'nokogiri'
|
|
2
2
|
|
3
3
|
# extending Nokogiri with 'append' and 'prepend' methods
|
4
4
|
|
5
|
-
|
5
|
+
Nokogiri::XML::Element.class_eval do
|
6
6
|
def append(data)
|
7
|
-
|
7
|
+
child = self.children.last
|
8
|
+
child && child.after(data) || add_child(data)
|
8
9
|
end
|
9
10
|
|
10
11
|
def prepend(data)
|
11
|
-
|
12
|
+
child = self.children.first
|
13
|
+
child && child.before(data) || add_child(data)
|
12
14
|
end
|
13
15
|
end
|
14
|
-
|
metadata
CHANGED
@@ -5,7 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 4
|
8
|
-
|
8
|
+
- 1
|
9
|
+
version: 0.4.1
|
9
10
|
platform: ruby
|
10
11
|
authors:
|
11
12
|
- Marcin Kulik
|
@@ -13,13 +14,14 @@ autorequire:
|
|
13
14
|
bindir: bin
|
14
15
|
cert_chain: []
|
15
16
|
|
16
|
-
date: 2010-
|
17
|
+
date: 2010-12-13 00:00:00 +01:00
|
17
18
|
default_executable:
|
18
19
|
dependencies:
|
19
20
|
- !ruby/object:Gem::Dependency
|
20
21
|
name: nokogiri
|
21
22
|
prerelease: false
|
22
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
23
25
|
requirements:
|
24
26
|
- - ">="
|
25
27
|
- !ruby/object:Gem::Version
|
@@ -42,7 +44,7 @@ files:
|
|
42
44
|
- lib/rack-revision-info/nokogiri_backend.rb
|
43
45
|
- spec/spec-rack-revision-info.rb
|
44
46
|
has_rdoc: true
|
45
|
-
homepage: http://
|
47
|
+
homepage: http://ku1ik.com/
|
46
48
|
licenses: []
|
47
49
|
|
48
50
|
post_install_message:
|
@@ -51,6 +53,7 @@ rdoc_options: []
|
|
51
53
|
require_paths:
|
52
54
|
- lib
|
53
55
|
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
54
57
|
requirements:
|
55
58
|
- - ">="
|
56
59
|
- !ruby/object:Gem::Version
|
@@ -58,6 +61,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
58
61
|
- 0
|
59
62
|
version: "0"
|
60
63
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
61
65
|
requirements:
|
62
66
|
- - ">="
|
63
67
|
- !ruby/object:Gem::Version
|
@@ -67,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
67
71
|
requirements: []
|
68
72
|
|
69
73
|
rubyforge_project:
|
70
|
-
rubygems_version: 1.3.
|
74
|
+
rubygems_version: 1.3.7
|
71
75
|
signing_key:
|
72
76
|
specification_version: 3
|
73
77
|
summary: Rack middleware showing current git (or svn) revision number of application
|