tnetstring 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY.rdoc +6 -0
- data/lib/tnetstring.rb +5 -0
- data/lib/tnetstring/version.rb +1 -1
- metadata +3 -3
data/HISTORY.rdoc
CHANGED
data/lib/tnetstring.rb
CHANGED
@@ -22,6 +22,8 @@ module TNetstring
|
|
22
22
|
value = case payload_type
|
23
23
|
when '#'
|
24
24
|
payload.to_i
|
25
|
+
when '^'
|
26
|
+
payload.to_f
|
25
27
|
when ','
|
26
28
|
payload
|
27
29
|
when ']'
|
@@ -145,6 +147,9 @@ module TNetstring
|
|
145
147
|
if obj.kind_of?(Integer)
|
146
148
|
int_str = obj.to_s
|
147
149
|
"#{int_str.length}:#{int_str}#"
|
150
|
+
elsif obj.kind_of?(Float)
|
151
|
+
float_str = obj.to_s
|
152
|
+
"#{float_str.length}:#{float_str}^"
|
148
153
|
elsif obj.kind_of?(String) || obj.kind_of?(Symbol)
|
149
154
|
"#{obj.length}:#{obj},"
|
150
155
|
elsif obj.is_a?(TrueClass)
|
data/lib/tnetstring/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 4
|
9
|
+
version: 0.3.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Matt Yoho
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-06-
|
17
|
+
date: 2011-06-22 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|