sinew 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 33506a03f47a88cae5bf7e0f4675d7cf83d86ba3c96f0880f5c473a7b23b167b
4
- data.tar.gz: 990bd4690f9fe799774c349314a32ab2c08979d555f03891316c5e0be8a4ad3d
3
+ metadata.gz: e40f156ce6a8c625a93dd1cf0f9d60db825977cb352bf736f27b24afbc6bd182
4
+ data.tar.gz: f4392ccdc53b3cc5d8a07a26fe0aef3525c0e43c3b570ab96465a208ab8c1969
5
5
  SHA512:
6
- metadata.gz: 9644097a2e11d8cba59a7985dfe770f27b00d5d18b676d0cacdee3e73a21f1b6c237b3bb58d68489d2a67fc981f7a7f8bb27a6e6fb23781f318cde78b392d7cd
7
- data.tar.gz: 667c301e7896b27162a77cff5165f264a0c2b73afbe5c35f541181709118185a13241d187ff8f8d5964e302537064ff927d9fa64ece2cb10ca65ba7dd89ce807
6
+ metadata.gz: aa8dbb122c0ef5665822d08bb62293798873529107609718399307a0a7f31682283f7a0576b9628a4e29475031b999ebd70e07b49ab212b4b5e4002470f568dc
7
+ data.tar.gz: 9693d9fcd356e0c9e7732c186e18c228a4953117f07b57617e298a0e728e8bf8c31334de56d1ee99b43f8003fb7de0cbf219656d20f58ad68e345dc876cef229
data/README.md CHANGED
@@ -173,6 +173,10 @@ noko.css("table")[4].css("td").select { |i| i[:width].to_i > 80 }.map(&:text)
173
173
 
174
174
  ## Changelog
175
175
 
176
+ #### 2.0.3 (May 2018)
177
+
178
+ * & now normalizes to & (not and)
179
+
176
180
  #### 2.0.2 (May 2018)
177
181
 
178
182
  * Support for `--limit`, `--proxy` and the `xml` variable
@@ -52,14 +52,17 @@ module Sinew
52
52
  end
53
53
 
54
54
  def http(method, url, options = {})
55
- # reset
56
- instance_variables.each do |i|
57
- instance_variable_set(i, nil) if i != :@sinew
55
+ # these need to be cleared before each request
56
+ %i[@html @noko @xml @json].each do |i|
57
+ instance_variable_set(i, nil)
58
58
  end
59
59
 
60
60
  # fetch and make response available to callers
61
61
  response = sinew.http(method, url, options)
62
62
  @uri, @raw = response.uri, response.body
63
+
64
+ # don't confuse the user
65
+ nil
63
66
  end
64
67
 
65
68
  #
@@ -2,6 +2,13 @@ require 'csv'
2
2
  require 'set'
3
3
  require 'stringex'
4
4
 
5
+ #
6
+ # Stringex customizations
7
+ #
8
+
9
+ # turn '&' into '&', not 'and'
10
+ Stringex::Localization::DefaultConversions::HTML_ENTITIES[:amp] = '&'
11
+
5
12
  #
6
13
  # CSV output.
7
14
  #
@@ -1,4 +1,4 @@
1
1
  module Sinew
2
2
  # Gem version
3
- VERSION = '2.0.2'.freeze
3
+ VERSION = '2.0.3'.freeze
4
4
  end
@@ -47,7 +47,7 @@ class TestOutput < MiniTest::Test
47
47
  # convert_accented_html_entities
48
48
  assert_equal('a', output.send(:normalize, '&aacute;'))
49
49
  # convert_miscellaneous_html_entities
50
- assert_equal('<>', output.send(:normalize, '&lt;&gt;'))
50
+ assert_equal('<&>', output.send(:normalize, '&lt;&amp;&gt;'))
51
51
  # to_ascii
52
52
  assert_equal('cafe', output.send(:normalize, "caf\xc3\xa9"))
53
53
  # squish
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinew
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Doppelt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-03 00:00:00.000000000 Z
11
+ date: 2018-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print