strip_attributes 1.10.1 → 1.11.0

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: 49befdc57853f5989b4fc51155992959980603b2f6faced6def64dcd79433c6b
4
- data.tar.gz: 573f57793b9863e54fdde65b4dbf88e0d145098466e365ba91f595036ef16359
3
+ metadata.gz: ed9be0d24aad9365c9d797bb0f2fbbf421462a273b2d91ed5ea87c4eccee6abe
4
+ data.tar.gz: e5bf778e55185b5def4c968092830948d1cf37089f7adbd8f84783ceeabbcb35
5
5
  SHA512:
6
- metadata.gz: 2adee723efb508757540eb6a6fcc87a4fd24408e97174614e36bf29e80b06c0c209e0deb78e9416add3af0bbcb3e7719611d9e5ceefeef4f9cd777c5dde75a7e
7
- data.tar.gz: 8cf717ef066842affe6d4f160fca46b2bcec3ea17afbaa03119b7312b2556d859e36b992a904570faa3f12dcbeea02bf5a05fbc3a464d87a17a1335c59ab54e0
6
+ metadata.gz: 550b50a9bd0386a91ecb213d400be75a006603f016ef958f9e22111d800933769fabd5abd67094d607b2c4d7bc98d97b9699189125b30afc324c1ae514d140cc
7
+ data.tar.gz: 29d1fb640513e0f996928251d21e3466b96bc679ee742c7101b92cca3c3bba9233fcee7cb6c9438987ab3216cd2adff96d6581d368334d3450025d4f4981d47f
@@ -52,14 +52,13 @@ module StripAttributes
52
52
 
53
53
  def self.strip_string(value, options = {})
54
54
  return value unless value.is_a?(String)
55
- # TODO: FUTURE CHANGE: return value if value.frozen?
55
+ return value if value.frozen?
56
56
 
57
57
  allow_empty = options[:allow_empty]
58
58
  collapse_spaces = options[:collapse_spaces]
59
59
  replace_newlines = options[:replace_newlines]
60
60
  regex = options[:regex]
61
61
 
62
- value = value.dup
63
62
  value.gsub!(regex, "") if regex
64
63
 
65
64
  if MULTIBYTE_SUPPORTED && Encoding.compatible?(value, MULTIBYTE_SPACE)
@@ -1,3 +1,3 @@
1
1
  module StripAttributes
2
- VERSION = "1.10.1"
2
+ VERSION = "1.11.0"
3
3
  end
@@ -204,10 +204,10 @@ class StripAttributesTest < Minitest::Test
204
204
  assert_equal "", record.bang
205
205
  end
206
206
 
207
- def test_should_strip_frozen_values
207
+ def test_should_skip_frozen_values
208
208
  record = StripAllMockRecord.new(frozen: " ice ".freeze)
209
209
  record.valid?
210
- assert_equal "ice", record.frozen
210
+ assert_equal " ice ", record.frozen
211
211
  end
212
212
 
213
213
  def test_should_collapse_duplicate_spaces
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strip_attributes
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.1
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan McGeary