icecream 0.0.13 → 0.0.14

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: 7c41a810b949595862274851fd9227d389701e47
4
- data.tar.gz: 850649e15642ca4b892f43f4dd4e9593716b539d
3
+ metadata.gz: 74b0b83ca5e429ee4328b2fe850dd66f6ba4e6ea
4
+ data.tar.gz: 72a67f8571beb33164d00e171286ed6986872999
5
5
  SHA512:
6
- metadata.gz: 3a32901512cd2bc2d1046168285b3673a016b6abcb78edd609ae2362faaa206c64b905fae7011013048704df585c21b172c6738da3a564c010b202110d8311ba
7
- data.tar.gz: 42e1b80b43b4641874d30177ee94925587e390e4cc3f2470ff4f9cf9f6cbefa2d0246e8414aeca7a4c6747473f77490c580a704e4b469d7d26d06c41f2383856
6
+ metadata.gz: 9c034884e29d9259275923ba818133fc18134e9c087c07b131717c7a638c4848a9a477a8348d6c3a190147e245273322b4634b8455de39cef29c662a90b8c918
7
+ data.tar.gz: 3d8d850769d722caad9848386a7f0831b2c39e92bfdae8f6842c37fb6b43d814604d1eeaf6991f3cee0ce09feec3fcd032733fa28c498f8d2fa00ba415d0fb3f
data/CHANGES CHANGED
@@ -1,4 +1,7 @@
1
1
 
2
+ ** 0.0.14
3
+ - Adding feature to ignore empty lines and to ignore lines with comments
4
+
2
5
  ** 0.0.13
3
6
  - Adding more tests
4
7
  - Adding change log
@@ -13,13 +13,17 @@ module IceCream
13
13
  end
14
14
 
15
15
  def self.parse_variables particularity
16
- particularity.split("=").first.strip.to_s
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.split("=").last.strip
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
@@ -1,3 +1,3 @@
1
1
  module IceCream
2
- VERSION = "0.0.13"
2
+ VERSION = "0.0.14"
3
3
  end
@@ -1,5 +1,9 @@
1
1
  name = "Açaí-the best flavor-ever"
2
2
  calories = 10
3
+
4
+
5
+
6
+ # Should be a comment
3
7
  color = nil
4
8
  price = 20.5
5
9
  extra_description = "Brazilian!"
@@ -5,5 +5,4 @@ Coveralls.wear!
5
5
 
6
6
  RSpec.configure do |config|
7
7
  config.color = true
8
- config.formatter = 'documentation'
9
8
  end
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.13
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-14 00:00:00.000000000 Z
11
+ date: 2015-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry