samwise 0.2.2 → 0.2.3

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: 0754234576533d754039f6b528c9faa216372c37
4
- data.tar.gz: 17a52375c6fb751dd308d5f08cf2dca01f8acd77
3
+ metadata.gz: 0bed49cb7a81e9e2d2375bd9de92743a11df4eae
4
+ data.tar.gz: 927992dce573abe901c4e40175840d36f244539a
5
5
  SHA512:
6
- metadata.gz: 9ffb00161c0246c796db3aaa978c96a39b3483024b401b6ae4681d3a1ff4720a0b7b3f9ea264da7c6c7195aeb04068ca4023366add0a39ef0cefd7a6efe47ef9
7
- data.tar.gz: 2e0d8d340d7763f18d8349a792104df283a3f01cdf712948b45c4145906db646c3147e1322829b1cc4d6b6c055a924df096a922f478ef1c31dd77913402d1dcc
6
+ metadata.gz: 6a4650866ec374da143ed0a390547cadf0b893182ff20f4076861d46ed1d4615201ed658da0f6c850df1c8e88f0c35177f75c20b468900069c73c919ab1e3a2c
7
+ data.tar.gz: 376870f9b72e13188e700df1213b256908737ae3df3c8c04e193296923fc51f0a21662f47a2c2d760c52124752511fd80967d4b0f60178dcc7b3ef74dd61c27c
data/lib/samwise/util.rb CHANGED
@@ -5,7 +5,7 @@ module Samwise
5
5
  def self.duns_is_properly_formatted?(duns: nil)
6
6
  return false if duns.nil?
7
7
 
8
- duns.gsub!('-', '')
8
+ duns = duns.gsub('-', '')
9
9
 
10
10
  return true if duns_contains_forbidden_characters?(duns: duns)
11
11
 
@@ -19,7 +19,7 @@ module Samwise
19
19
  def self.format_duns(duns: nil)
20
20
  raise Samwise::Error::InvalidFormat unless duns_is_properly_formatted?(duns: duns)
21
21
 
22
- duns.gsub!('-', '')
22
+ duns = duns.gsub('-', '')
23
23
 
24
24
  if duns_is_nine_digits?(duns: duns)
25
25
  duns = "#{duns}0000"
@@ -1,3 +1,3 @@
1
1
  module Samwise
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
data/spec/util_spec.rb CHANGED
@@ -60,6 +60,13 @@ describe Samwise::Util do
60
60
  end
61
61
 
62
62
  context '#format_duns' do
63
+ it 'should not suffer from mutability side effects' do
64
+ duns_copy = hyphen_duns.dup
65
+ Samwise::Util.format_duns(duns: hyphen_duns)
66
+
67
+ expect(hyphen_duns).to eq(duns_copy)
68
+ end
69
+
63
70
  it 'should format an 8 digit DUNS into a 13 digit DUNS' do
64
71
  formatted_duns = Samwise::Util.format_duns(duns: eight_duns)
65
72
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: samwise
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alan deLevie