escape_utils 1.1.1 → 1.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e8e894a1012e4b7e8f3faaa7a942a5ba2c1711d
4
- data.tar.gz: 79c30477e80a0a3a1998f736ea63d83901a8d52f
3
+ metadata.gz: d21e40641fb15698dc8d2bf394ae9ff766c99b65
4
+ data.tar.gz: 2e72c13029f33a6cf11fd6980915552e62fa4d6b
5
5
  SHA512:
6
- metadata.gz: 6b8214e9b94dbc9cfc80de25aaa5e0e84262bc14cba81c5a682db42acfaa5197cc5fda8657afaf88ae7d930a2711df09ca6c431be65c78e4592eed4037c529cc
7
- data.tar.gz: def42fd99a18ba77515d7ad53484bb815adfac586151a9072d1e238cc25853f86af85c44479e3232a3da587b4404c7cfe208d5be997d54e28f5d51420d0dc46d
6
+ metadata.gz: e095eec1d4b9580837a1d5af995f1c8a400c3dcca7ea1a8b3a4a3079809d4e72166b844b17791ab4c90c828be9d7b52331690f30ba88790f79ff18707ead49d6
7
+ data.tar.gz: e89851568b2650c982297e6af0ae66d506c165be8ff5a3ea1f158f6665d1e15a567f5219741f5e4ab2a78ae5f503b093e171a600088c446dc487024224e9202f
@@ -2,7 +2,6 @@ language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
4
  - 2.0.0
5
- - rbx-19mode
6
- matrix:
7
- allow_failures:
8
- - rvm: rbx-19mode
5
+ - 2.1.0
6
+ - 2.2.0
7
+ - 2.3.0
@@ -15,7 +15,7 @@ module HamlBench
15
15
  extend Haml::Helpers
16
16
  end
17
17
 
18
- url = "http://en.wikipedia.org/wiki/Line_of_succession_to_the_British_throne"
18
+ url = "https://en.wikipedia.org/wiki/Succession_to_the_British_throne"
19
19
  html = `curl -s #{url}`
20
20
  html = html.force_encoding('utf-8') if html.respond_to?(:force_encoding)
21
21
  puts "Escaping #{html.bytesize} bytes of html from #{url}"
@@ -12,7 +12,7 @@ module HamlBench
12
12
  extend Haml::Helpers
13
13
  end
14
14
 
15
- url = "http://en.wikipedia.org/wiki/Line_of_succession_to_the_British_throne"
15
+ url = "https://en.wikipedia.org/wiki/Succession_to_the_British_throne"
16
16
  html = `curl -s #{url}`
17
17
  html = html.force_encoding('binary') if html.respond_to?(:force_encoding)
18
18
  escaped_html = EscapeUtils.escape_html(html)
@@ -110,4 +110,10 @@ extern void gh_buf_clear(gh_buf *buf);
110
110
 
111
111
  #define gh_buf_PUTS(buf, str) gh_buf_put(buf, str, sizeof(str) - 1)
112
112
 
113
+ /* support for environments where MIN is not provided */
114
+
115
+ #ifndef MIN
116
+ #define MIN(a,b) (((a)<(b))?(a):(b))
117
+ #endif
118
+
113
119
  #endif
@@ -118,7 +118,6 @@ static VALUE rb_eu_escape_html_as_html_safe(VALUE self, VALUE str)
118
118
  }
119
119
 
120
120
  rb_ivar_set(result, ID_at_html_safe, Qtrue);
121
- rb_enc_associate(result, rb_enc_get(str));
122
121
 
123
122
  return result;
124
123
  }
@@ -1,3 +1,3 @@
1
1
  module EscapeUtils
2
- VERSION = "1.1.1"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -0,0 +1,10 @@
1
+ #!/bin/sh
2
+ set -e
3
+ cd "$(dirname "$0")/.."
4
+
5
+ # run entire test suite
6
+ ruby --version 1>&2
7
+ exec ruby -I. -rubygems \
8
+ -r "$(pwd)/test/helper" \
9
+ -e "ARGV.each { |f| require(f) }" \
10
+ -- ${*:-`find test -name '*_test.rb'`}
@@ -4,30 +4,6 @@ class MyCustomHtmlSafeString < String
4
4
  end
5
5
 
6
6
  class HtmlEscapeTest < Minitest::Test
7
- def test_escape_source_encoding_is_maintained
8
- source = 'foobar'
9
- str = EscapeUtils.escape_html_as_html_safe(source)
10
- assert_equal source.encoding, str.encoding
11
- end
12
-
13
- def test_escape_binary_encoding_is_maintained
14
- source = 'foobar'.b
15
- str = EscapeUtils.escape_html_as_html_safe(source)
16
- assert_equal source.encoding, str.encoding
17
- end
18
-
19
- def test_escape_uft8_encoding_is_maintained
20
- source = 'foobar'.encode 'UTF-8'
21
- str = EscapeUtils.escape_html_as_html_safe(source)
22
- assert_equal source.encoding, str.encoding
23
- end
24
-
25
- def test_escape_us_ascii_encoding_is_maintained
26
- source = 'foobar'.encode 'US-ASCII'
27
- str = EscapeUtils.escape_html_as_html_safe(source)
28
- assert_equal source.encoding, str.encoding
29
- end
30
-
31
7
  def test_escape_basic_html_with_secure
32
8
  assert_equal "&lt;some_tag&#47;&gt;", EscapeUtils.escape_html("<some_tag/>")
33
9
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: escape_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Lopez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-13 00:00:00.000000000 Z
11
+ date: 2016-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler
@@ -171,6 +171,7 @@ files:
171
171
  - lib/escape_utils/version.rb
172
172
  - lib/escape_utils/xml/builder.rb
173
173
  - script/bootstrap
174
+ - script/testsuite
174
175
  - test/helper.rb
175
176
  - test/html/escape_test.rb
176
177
  - test/html/unescape_test.rb