bypass 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MGE5YjdiM2QyNTc1MTM4MzQ3NGVhODRmM2ZiM2ZhMDAzYmZjZTVhZg==
4
+ Y2ZhMzg2MTM3ZjEwMDkzM2RmZDhmMDdjYTdhNWUyNTgzM2E0ZDljYQ==
5
5
  data.tar.gz: !binary |-
6
- MGU0ODk2YmVmN2Q3ZjNiNjZiZGI3YmNlYjNlYmVlYzYzZjY0NTA2Yw==
6
+ NDg3NGIwZGM4MzZjMDJiMjJhNmU0MGYzMWVhNmJmYmJlNWVjY2EyZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzY2NjUzNDJjYjE3MzBjYzY1ZjQ5NTQ0NGY3ZjFhM2I2YWMyYjYxNWI5MTU3
10
- OWNmMzMxMTFhZWI3NzRjNjFiZWUwNjZiNGUyMzc3ZDNiMDA1MzQ5ZmRiMGEy
11
- MGE2OWUwY2E5NWJkMjdmYzFjYWI1MTM1OTY4NzQ2YjYwMjA3MDU=
9
+ ZGFkODc2NDNjODQzN2IzNTM4MDM0ZmY1NzM5OGQyODc3NDA3M2UzZTU1NjQw
10
+ ZTNiMmYwOTE2MDY3NTg3MGRiMmUxYTgxNDFhMjVkNjQ4ZTllMGYyZTI2NGQ5
11
+ YmU5ODQ2YzNjMzBmZjUxMTMwMzUxM2QyNWQ4MjY3ZDEwYzIxMzk=
12
12
  data.tar.gz: !binary |-
13
- YTNmZTcyMzFmMmMxYmNlOTgwZjRiZWI3YjQwM2IwY2ZjMDlmMzU1NjVjMjcz
14
- YWU0MGE4OWVhZTY5ODY3Njg3OWIyMDkzMGNmZTg4YmViNWEyYzhhNThiMWQ3
15
- NDkyZGE2NDllNzc3OGU2NmMyMjE2ZTI1MTIyZWYzNGU5OTU5Yzg=
13
+ ODYyMDZiODQ3ZjZhOGQxNmIyZGJkNGVmMzBjNWE1NDdhZTU2N2FjODAxODI2
14
+ ZjE1MTI2NGY0ODc2ZmM1NTc1NmQ2NTk3NDhjMDU3NDE0ZThlOTlkMjMwNjU2
15
+ YTM1MjNjM2I5NzFiYjgxZWJjZjUzNjA3YmUzNWEyNTMzMGNkNmU=
data/lib/bypass/filter.rb CHANGED
@@ -27,7 +27,7 @@ module Bypass
27
27
  end
28
28
 
29
29
  def parse_uri(uri)
30
- Bypass::URI.parse(uri)
30
+ Bypass::URI.parse(uri.to_s.strip)
31
31
  rescue => ex
32
32
  nil
33
33
  end
@@ -1,3 +1,3 @@
1
1
  module Bypass
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -23,6 +23,17 @@ class Bypass::HTMLFilterTest < Test::Unit::TestCase
23
23
  filter.replace { "foo" }
24
24
  assert_equal text, filter.content
25
25
  end
26
+
27
+ should "strip whitespace around URLs" do
28
+ text = "<a href=\"http://example.com \">Example</a>"
29
+ filter = Bypass::HTMLFilter.new(text)
30
+ filter.replace do |url|
31
+ url.append_to_query_values(:foo => "bar")
32
+ url
33
+ end
34
+ expected = "<a href=\"http://example.com?foo=bar\">Example</a>"
35
+ assert_equal expected, filter.content
36
+ end
26
37
  end
27
38
 
28
39
  context "#auto_link" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bypass
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derrick Reimer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-07 00:00:00.000000000 Z
11
+ date: 2014-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri