rack-validate 0.1.3 → 0.1.4

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.
data/.gitignore CHANGED
@@ -7,4 +7,5 @@ vendor/gems/ruby/1.8/gems
7
7
  vendor/gems/ruby/1.8/specifications
8
8
  vendor/gems/ruby/1.8/doc
9
9
  vendor/gems/environment.rb
10
- vendor/gems/ruby/1.8/environment.rb
10
+ vendor/gems/ruby/1.8/environment.rb
11
+ .bundle/
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'http://rubygems.org'
2
+ gemspec
@@ -0,0 +1,23 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ rack-validate (0.1.3)
5
+ w3c_validators
6
+
7
+ GEM
8
+ remote: http://rubygems.org/
9
+ specs:
10
+ nokogiri (1.4.1)
11
+ rspec (1.3.0)
12
+ thoughtbot-shoulda (2.11.1)
13
+ w3c_validators (1.1.1)
14
+ nokogiri
15
+
16
+ PLATFORMS
17
+ ruby
18
+
19
+ DEPENDENCIES
20
+ rack-validate!
21
+ rspec
22
+ thoughtbot-shoulda
23
+ w3c_validators
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
@@ -13,24 +13,25 @@ module Rack
13
13
  end
14
14
 
15
15
  def call( env )
16
- status, headers, response = @app.call( env )
16
+ status, headers, body = @app.call(env)
17
+ resp = Rack::Response.new(body, status, headers)
17
18
 
18
19
  request = Rack::Request.new( env )
19
- if !request.params['rack-validate'].blank?
20
+ if request.params['rack-validate'] == "true"
20
21
  if headers['Content-Type'] =~ /text\/html|application\/xhtml\+xml/
21
- body = response.body
22
+ body = resp.body.dup
22
23
 
23
24
  issues = Validator.validate( body )
24
25
 
25
26
  body.insert( 0, Validator.generate_report( issues ) )
26
27
 
27
- headers["Content-Length"] = body.length.to_s
28
- response = [body]
28
+ resp.body = ""
29
+ resp.write(body)
29
30
  end
30
31
  end
31
32
 
32
- [status, headers, response]
33
+ resp.to_a
33
34
  end
34
35
 
35
36
  end
36
- end
37
+ end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rack-validate}
8
- s.version = "0.1.3"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ed Schmalzle"]
12
- s.date = %q{2010-03-24}
12
+ s.date = %q{2010-10-25}
13
13
  s.description = %q{Rack middleware that validates HTML with w3c validator and displays result in page.}
14
14
  s.email = %q{Jonas714@gmail.com}
15
15
  s.executables = ["autospec", "rackup", "spec"]
@@ -20,6 +20,8 @@ Gem::Specification.new do |s|
20
20
  s.files = [
21
21
  ".document",
22
22
  ".gitignore",
23
+ "Gemfile",
24
+ "Gemfile.lock",
23
25
  "LICENSE",
24
26
  "README.rdoc",
25
27
  "Rakefile",
@@ -27,7 +29,6 @@ Gem::Specification.new do |s|
27
29
  "bin/autospec",
28
30
  "bin/rackup",
29
31
  "bin/spec",
30
- "gemfile",
31
32
  "lib/rack-validate.rb",
32
33
  "lib/rack-validate/response_file.rb",
33
34
  "lib/rack-validate/validator.rb",
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 3
9
- version: 0.1.3
8
+ - 4
9
+ version: 0.1.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ed Schmalzle
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-03-24 00:00:00 -04:00
17
+ date: 2010-10-25 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -67,6 +67,8 @@ extra_rdoc_files:
67
67
  files:
68
68
  - .document
69
69
  - .gitignore
70
+ - Gemfile
71
+ - Gemfile.lock
70
72
  - LICENSE
71
73
  - README.rdoc
72
74
  - Rakefile
@@ -74,7 +76,6 @@ files:
74
76
  - bin/autospec
75
77
  - bin/rackup
76
78
  - bin/spec
77
- - gemfile
78
79
  - lib/rack-validate.rb
79
80
  - lib/rack-validate/response_file.rb
80
81
  - lib/rack-validate/validator.rb
data/gemfile DELETED
@@ -1,6 +0,0 @@
1
- gem 'w3c_validators'
2
-
3
- only :test do
4
- gem 'rspec'
5
- gem 'rack'
6
- end