icecream 0.0.7 → 0.0.8

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: 17bbd729d5cf132f0a2d2e62bee22e965b670106
4
- data.tar.gz: 4c0c16d3a2725a978111405b3356bb7f354d239d
3
+ metadata.gz: 1bedb97706090d4cbbf93db273ebe1b796a62f72
4
+ data.tar.gz: 5a4a066a380b91ffd6fa80aae3de0372e198824b
5
5
  SHA512:
6
- metadata.gz: fd0305bb15ac3ae2db8ac36fb99d5db4c31de16dc8b53453436a47e5a2bc7404a9c2f37c2d4253cd6e7cb7f74c49cf92627d28a0ed66a5b8ae5de89edbae0b94
7
- data.tar.gz: f6f9f239ac1a03c9535f63d88711f2a0bfce70488d80cb3c98d243e3a738a1e5a38b680f6350f760b72d09cacc314a58ebff5f6e2ac2b60d64736c831c28016a
6
+ metadata.gz: 19024fb8c6a7c931d12de64546da34ca01842192ec3075d69a54fdaceb63d1d4a4cb8a5d6a67a851fee126075653c02d9361a061c454831afca5e609f6a575a2
7
+ data.tar.gz: 53d6d91fd7946d339c5f1e2e7109b4d780fcc2e651dcb09a81e3e2bd4225fa4bd0ca6d92f75f52efb484faf059cccc99afbb65d0904b19932dcaf682226792c1
@@ -27,10 +27,14 @@ module IceCream
27
27
  end
28
28
 
29
29
  def self.fix_value value
30
- if value[0] == ":"
30
+ if (value[0] == "[") && (value[-1, 1] == "]")
31
+ final = value.gsub("[","") .gsub("]","").split(",").map {|element| fix_value element }
32
+ elsif value[0] == ":"
31
33
  final = value.gsub(":","").to_sym
32
34
  elsif !value.slice("\"").nil?
33
35
  final = value.gsub("\"","")
36
+ elsif (value[0] == "'") && (value[-1, 1] == "'")
37
+ final = value.gsub("'","")
34
38
  elsif !value.slice(".").nil?
35
39
  final = value.to_f if Float(value) rescue false
36
40
  elsif !((Integer(value) rescue nil) == nil)
@@ -1,3 +1,3 @@
1
1
  module IceCream
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
data/spec/parser_spec.rb CHANGED
@@ -22,6 +22,7 @@ describe "Parser" do
22
22
  # Strings
23
23
  IceCream::Parser.fix_value("\"chocolate\"").should == "chocolate"
24
24
  IceCream::Parser.fix_value("\"15\"").should == "15"
25
+ IceCream::Parser.fix_value("'15'").should == "15"
25
26
 
26
27
  # Symbles
27
28
  IceCream::Parser.fix_value(":i15").should == :i15
@@ -32,6 +33,9 @@ describe "Parser" do
32
33
  # Int
33
34
  IceCream::Parser.fix_value("15").should == 15
34
35
 
36
+ # array
37
+ IceCream::Parser.fix_value("['mimimi',:foo,15,20.5]").should == ["mimimi",:foo,15,20.5]
38
+
35
39
  # Invalid conversions
36
40
  IceCream::Parser.fix_value("15s").should == ""
37
41
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: icecream
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Camilo Ribeiro