icecream 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES +3 -0
- data/lib/icecream/parser.rb +18 -7
- data/lib/icecream/version.rb +1 -1
- data/spec/flavors/acai.flavor +4 -0
- data/spec/spec_helper.rb +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74b0b83ca5e429ee4328b2fe850dd66f6ba4e6ea
|
4
|
+
data.tar.gz: 72a67f8571beb33164d00e171286ed6986872999
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c034884e29d9259275923ba818133fc18134e9c087c07b131717c7a638c4848a9a477a8348d6c3a190147e245273322b4634b8455de39cef29c662a90b8c918
|
7
|
+
data.tar.gz: 3d8d850769d722caad9848386a7f0831b2c39e92bfdae8f6842c37fb6b43d814604d1eeaf6991f3cee0ce09feec3fcd032733fa28c498f8d2fa00ba415d0fb3f
|
data/CHANGES
CHANGED
data/lib/icecream/parser.rb
CHANGED
@@ -13,13 +13,17 @@ module IceCream
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def self.parse_variables particularity
|
16
|
-
particularity
|
16
|
+
if particularity_is_valid? particularity
|
17
|
+
particularity.split("=").first.strip.to_s
|
18
|
+
end
|
17
19
|
end
|
18
20
|
|
19
21
|
def self.parse_values particularity
|
20
|
-
particularity
|
22
|
+
if particularity_is_valid? particularity
|
23
|
+
particularity.split("=").last.strip
|
24
|
+
end
|
21
25
|
end
|
22
|
-
|
26
|
+
|
23
27
|
def self.slice_between_strings(string, str_start, str_end)
|
24
28
|
start_at = string.index(str_start).to_i + str_start.size
|
25
29
|
end_at = string.index(str_end)
|
@@ -45,7 +49,7 @@ module IceCream
|
|
45
49
|
final
|
46
50
|
|
47
51
|
end
|
48
|
-
|
52
|
+
|
49
53
|
def self.objectify flavor, all_particularities
|
50
54
|
class_name = flavor.capitalize
|
51
55
|
|
@@ -56,9 +60,9 @@ module IceCream
|
|
56
60
|
|
57
61
|
$VERBOSE = original_verbosity
|
58
62
|
|
59
|
-
variables = all_particularities.each { | particularity | parse_variables particularity }
|
60
|
-
values = all_particularities.each { | particularity | parse_values particularity }
|
61
|
-
|
63
|
+
variables = all_particularities.each { | particularity | parse_variables particularity }.compact
|
64
|
+
values = all_particularities.each { | particularity | parse_values particularity }.compact
|
65
|
+
|
62
66
|
klass.class_eval do
|
63
67
|
attr_accessor *variables
|
64
68
|
|
@@ -70,5 +74,12 @@ module IceCream
|
|
70
74
|
end
|
71
75
|
obj = klass.new
|
72
76
|
end
|
77
|
+
def self.particularity_is_valid? particularity
|
78
|
+
if (particularity.nil? || particularity.empty? || particularity.index("#"))
|
79
|
+
false
|
80
|
+
else
|
81
|
+
true
|
82
|
+
end
|
83
|
+
end
|
73
84
|
end
|
74
85
|
end
|
data/lib/icecream/version.rb
CHANGED
data/spec/flavors/acai.flavor
CHANGED
data/spec/spec_helper.rb
CHANGED
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.14
|
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-02-
|
11
|
+
date: 2015-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|