symbolmatrix 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -2,6 +2,8 @@ class SymbolMatrix < Hash
|
|
2
2
|
class Serialization
|
3
3
|
def self.parse serialization
|
4
4
|
result = SymbolMatrix.new
|
5
|
+
return result if serialization.length == 0
|
6
|
+
|
5
7
|
if serialization.include? " "
|
6
8
|
serialization.split(" ").each do |command|
|
7
9
|
result = result.recursive_merge parse command
|
data/lib/symbolmatrix/version.rb
CHANGED
@@ -2,6 +2,11 @@ require 'complete_features_helper'
|
|
2
2
|
|
3
3
|
describe SymbolMatrix::Serialization do
|
4
4
|
describe '.parse' do
|
5
|
+
it 'should parse an empty string' do
|
6
|
+
sm = SymbolMatrix::Serialization.parse ""
|
7
|
+
sm.keys.should be_empty
|
8
|
+
end
|
9
|
+
|
5
10
|
it 'should parse a simple string aja:hola' do
|
6
11
|
sm = SymbolMatrix::Serialization.parse 'aja:hola'
|
7
12
|
sm.aja.should == 'hola'
|
@@ -105,5 +110,12 @@ describe SymbolMatrix do
|
|
105
110
|
a.of.making.it.should == "work"
|
106
111
|
end
|
107
112
|
end
|
113
|
+
|
114
|
+
context "an empty string is provided" do
|
115
|
+
it 'should load nothing into the SymbolMatrix' do
|
116
|
+
a = SymbolMatrix ""
|
117
|
+
a.keys.should be_empty
|
118
|
+
end
|
119
|
+
end
|
108
120
|
end
|
109
121
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: symbolmatrix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: discoverer
|