rack-stripper 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. data/lib/rack/stripper.rb +8 -3
  2. metadata +4 -4
data/lib/rack/stripper.rb CHANGED
@@ -2,7 +2,7 @@ require 'rack'
2
2
 
3
3
  module Rack
4
4
  class Stripper
5
- VERSION = '1.0.0'
5
+ VERSION = '1.0.1'
6
6
 
7
7
  attr_accessor :add_xml_instruction
8
8
  attr_accessor :is_xml_response
@@ -42,9 +42,14 @@ module Rack
42
42
  body
43
43
  end
44
44
 
45
+ # Determines if an instruction exists. In the safe case, say it already exists so we don't
46
+ # put doubles in, because that'd be worse than not having one at all.
47
+ #
48
+ # @param [String] body The body of the text.
49
+ #
50
+ # @return [Boolean] true if the content doesn't have an XML instruction, false if it does.
45
51
  def doesnt_have_xml_instruction_already?(body)
46
- match = body.match /<?xml version=/
47
- match.nil?
52
+ body.index('<?xml ').nil? rescue false
48
53
  end
49
54
  end
50
55
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-stripper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-24 00:00:00.000000000 Z
12
+ date: 2012-08-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -90,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
90
90
  version: '0'
91
91
  segments:
92
92
  - 0
93
- hash: -4515052134336603542
93
+ hash: 705178727278721884
94
94
  required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  version: '0'
100
100
  segments:
101
101
  - 0
102
- hash: -4515052134336603542
102
+ hash: 705178727278721884
103
103
  requirements: []
104
104
  rubyforge_project:
105
105
  rubygems_version: 1.8.23