latinum 0.7.0 → 0.7.1

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: f7ea6c1821dd5955481bf78aeddadb8df92d6f4e
4
- data.tar.gz: 27b5bf126b861190724bf689e6d04ee534b789b0
3
+ metadata.gz: d6dd56393739d90d4d893817b978c8a14c3dc9c4
4
+ data.tar.gz: be685ba7796486a231c2483b417ed878c6100251
5
5
  SHA512:
6
- metadata.gz: fb53fc6b6c7067acb3129351b160a7b105e0eea8fa9395326106470bb23a66dbbd051f217bbca59820cf8cfb89f65fbf3e28d42c1e166f98a969600fe47ab7c4
7
- data.tar.gz: b2d02183d4da42c3cf2477e96964439e99fa8ec0fcc00e27775f08c9761e68ad06986963fd90ce6cc1a59951f145d1534b07d387468e3d7073e8e3ebbe1489ad
6
+ metadata.gz: d5e2b2826c9726d94e73f6d2f97773a19493281725d175c45c8415d827d7a776bf8fac76c60e5926aa818c1f2c3ceb03c6c8064eb5aaaa79580850da98bdf1c5
7
+ data.tar.gz: 0e093fc3b2a171f38b91781450b4eb9cc70c991ec34d4a09308cc5c4d70b9deecac11e2874be6ab6bcad8b6ee7e3dd2f07d21a75a499e04b9e4f85895ae89aa1
@@ -118,7 +118,12 @@ module Latinum
118
118
  end
119
119
 
120
120
  def load(string)
121
- parse(string) if string
121
+ if string
122
+ # Remove any whitespaces
123
+ string = string.strip
124
+
125
+ parse(string) unless string.empty?
126
+ end
122
127
  end
123
128
 
124
129
  def dump(resource)
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Latinum
22
- VERSION = "0.7.0"
22
+ VERSION = "0.7.1"
23
23
  end
@@ -36,6 +36,14 @@ module Latinum::ResourceSpec
36
36
  expect(Latinum::Resource.dump(nil)).to be nil
37
37
  end
38
38
 
39
+ it "should handle empty strings correctly" do
40
+ expect(Latinum::Resource.load("")).to be nil
41
+ end
42
+
43
+ it "should handle whitespace strings correctly" do
44
+ expect(Latinum::Resource.load(" ")).to be nil
45
+ end
46
+
39
47
  it "should load and dump resources correctly" do
40
48
  resource = Latinum::Resource.new(10, 'NZD')
41
49
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: latinum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-07 00:00:00.000000000 Z
11
+ date: 2015-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler