icecream 0.0.14 → 0.0.15
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 +4 -4
- data/.travis.yml +0 -1
- data/Gemfile +0 -5
- data/README.md +1 -1
- data/icecream.gemspec +2 -1
- data/lib/icecream.rb +3 -0
- data/lib/icecream/parser.rb +3 -1
- data/lib/icecream/version.rb +1 -1
- data/spec/parser_spec.rb +3 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8628c13d9c63a053045f22295a0d323fd5a6bb4a
|
4
|
+
data.tar.gz: ac271a1eca3e608530d255188f2d17f9668f7930
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80a366b5d0d0ab5978984adac631b0a9a53ad765d71d207884c18c91543f5888322599a6b68280b4a9ef2fc2c347c8e146f19f2888b37cabcedf208651d0c42f
|
7
|
+
data.tar.gz: bfbb9fd3299a09d8e2a7f791e9eaf28ab83c4d1e54a4edb43e85a63e081ef0cbdef73cd603336dc4d322fc74f542d7b9f7d355e8f5c82d8467c0fb85a9678699
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -97,7 +97,7 @@ IceCream ASCII art from: http://ascii.co.uk/art/icecream
|
|
97
97
|
LICENCE
|
98
98
|
-------------
|
99
99
|
|
100
|
-
Copyright 2013 Camilo Ribeiro <camilo@camiloribeiro.com>
|
100
|
+
Copyright 2013 - 2015 Camilo Ribeiro <camilo@camiloribeiro.com>
|
101
101
|
|
102
102
|
This file is part of IceCream.
|
103
103
|
|
data/icecream.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
|
|
6
6
|
s.name = "icecream"
|
7
7
|
s.version = IceCream::VERSION
|
8
8
|
s.authors = ["Camilo Ribeiro"]
|
9
|
-
s.email = ["
|
9
|
+
s.email = ["camilo@camiloribeiro.com"]
|
10
10
|
s.homepage = "http://github.com/camiloribeiro/icecream"
|
11
11
|
s.license = "Apache 2.0"
|
12
12
|
s.summary = %q{Simple Factory to the ones who just wanna a factory}
|
@@ -25,4 +25,5 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.add_development_dependency 'cucumber'
|
26
26
|
s.add_development_dependency 'rake'
|
27
27
|
s.add_development_dependency 'rspec'
|
28
|
+
s.add_development_dependency 'coveralls'
|
28
29
|
end
|
data/lib/icecream.rb
CHANGED
data/lib/icecream/parser.rb
CHANGED
@@ -31,7 +31,9 @@ module IceCream
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def self.fix_value value
|
34
|
-
if (value[0] == "
|
34
|
+
if (value[0] == "{") && (value[-1, 1] == "}")
|
35
|
+
final = value
|
36
|
+
elsif (value[0] == "[") && (value[-1, 1] == "]")
|
35
37
|
final = value.gsub("[","") .gsub("]","").split(",").map {|element| fix_value element.strip }
|
36
38
|
elsif value[0] == ":"
|
37
39
|
final = value.gsub(":","").to_sym
|
data/lib/icecream/version.rb
CHANGED
data/spec/parser_spec.rb
CHANGED
@@ -18,6 +18,9 @@ describe "Parser" do
|
|
18
18
|
IceCream::Parser.get_flavor_name(@path).should == "chocolate"
|
19
19
|
end
|
20
20
|
it "Returns the right type of the value" do
|
21
|
+
|
22
|
+
# Json, should be treated as string
|
23
|
+
IceCream::Parser.fix_value('{"apiVersion":"2.0", "data":{ "updated":"2010-01-07T19:58:42.949Z", "totalItems":800, "startIndex":1, "itemsPerPage":1, "items":[ {"id":"hYB0mn5zh2c", "uploaded":"2007-06-05T22:07:03.000Z", "updated":"2010-01-07T13:26:50.000Z", "uploader":"GoogleDeveloperDay", "category":"News", "title":"Google Developers Day US - Maps API Introduction", "description":"Google Maps API Introduction ...", "tags":[ "GDD07","GDD07US","Maps" ], "thumbnail":{ "default":"http://i.ytimg.com/vi/hYB0mn5zh2c/default.jpg", "hqDefault":"http://i.ytimg.com/vi/hYB0mn5zh2c/hqdefault.jpg" }, "player":{ "default":"http://www.youtube.com/watch?vu003dhYB0mn5zh2c" }, "content":{ "1":"rtsp://v5.cache3.c.youtube.com/CiILENy.../0/0/0/video.3gp", "5":"http://www.youtube.com/v/hYB0mn5zh2c?f...", "6":"rtsp://v1.cache1.c.youtube.com/CiILENy.../0/0/0/video.3gp" }, "duration":2840, "aspectRatio":"widescreen", "rating":4.63, "ratingCount":68, "viewCount":220101, "favoriteCount":201, "commentCount":22, "status":{ "value":"restricted", "reason":"limitedSyndication" }, "accessControl":{ "syndicate":"allowed", "commentVote":"allowed", "rate":"allowed", "list":"allowed", "comment":"allowed", "embed":"allowed", "videoRespond":"moderated" } } ] } }').should == '{"apiVersion":"2.0", "data":{ "updated":"2010-01-07T19:58:42.949Z", "totalItems":800, "startIndex":1, "itemsPerPage":1, "items":[ {"id":"hYB0mn5zh2c", "uploaded":"2007-06-05T22:07:03.000Z", "updated":"2010-01-07T13:26:50.000Z", "uploader":"GoogleDeveloperDay", "category":"News", "title":"Google Developers Day US - Maps API Introduction", "description":"Google Maps API Introduction ...", "tags":[ "GDD07","GDD07US","Maps" ], "thumbnail":{ "default":"http://i.ytimg.com/vi/hYB0mn5zh2c/default.jpg", "hqDefault":"http://i.ytimg.com/vi/hYB0mn5zh2c/hqdefault.jpg" }, "player":{ "default":"http://www.youtube.com/watch?vu003dhYB0mn5zh2c" }, "content":{ "1":"rtsp://v5.cache3.c.youtube.com/CiILENy.../0/0/0/video.3gp", "5":"http://www.youtube.com/v/hYB0mn5zh2c?f...", "6":"rtsp://v1.cache1.c.youtube.com/CiILENy.../0/0/0/video.3gp" }, "duration":2840, "aspectRatio":"widescreen", "rating":4.63, "ratingCount":68, "viewCount":220101, "favoriteCount":201, "commentCount":22, "status":{ "value":"restricted", "reason":"limitedSyndication" }, "accessControl":{ "syndicate":"allowed", "commentVote":"allowed", "rate":"allowed", "list":"allowed", "comment":"allowed", "embed":"allowed", "videoRespond":"moderated" } } ] } }'
|
21
24
|
|
22
25
|
# Strings
|
23
26
|
IceCream::Parser.fix_value("\"chocolate\"").should == "chocolate"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: icecream
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Camilo Ribeiro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -66,10 +66,24 @@ dependencies:
|
|
66
66
|
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: coveralls
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
description: Simple factory without any active record or external library. Just gem
|
70
84
|
install and use!
|
71
85
|
email:
|
72
|
-
-
|
86
|
+
- camilo@camiloribeiro.com
|
73
87
|
executables: []
|
74
88
|
extensions: []
|
75
89
|
extra_rdoc_files: []
|