awesome-cheeba 1.0.3 → 1.0.4

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.
data/README.txt CHANGED
@@ -3,6 +3,8 @@
3
3
  * http://github.com/awesome/cheeba/tree/master
4
4
  * http://wiki.github.com/awesome/cheeba
5
5
  * http://awesomelicense.com
6
+ * http://seattlerb.org
7
+ * http://awesome.lighthouseapp.com/projects/23787-cheeba/
6
8
 
7
9
  == DESCRIPTION:
8
10
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{cheeba}
5
- s.version = "1.0.3"
5
+ s.version = "1.0.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["So Awesome Man"]
@@ -119,7 +119,7 @@ module Cheeba
119
119
  # returns int if string is convertable
120
120
  #
121
121
  def self.string_to_int(string)
122
- if string.to_i.to_s == string
122
+ if string.to_i.to_s == string.gsub(/^0+/, "")
123
123
  string.to_i
124
124
  else
125
125
  string
@@ -1,3 +1,3 @@
1
1
  module Cheeba
2
- VERSION = '1.0.3'
2
+ VERSION = '1.0.4'
3
3
  end
@@ -164,4 +164,22 @@ FEKJA
164
164
  def test_read_raise_on_empty_string
165
165
  assert_raises(Cheeba::Reader::EmptyInputError) {Cheeba.read("")}
166
166
  end
167
+
168
+ def test_format_sym_str_nested_2009cash
169
+ file = "#{File.dirname(__FILE__)}/files/2009.cash"
170
+ raise file.inspect unless File.exist?(file)
171
+ act = Cheeba.read(file, {:sym_str => true})
172
+ exp = {:content=>{1=>:"200901.cash", 2=>:"200902.cash"}}
173
+ assert_equal exp, act
174
+ end
175
+
176
+ # this is what was happening! because the "01".to_i # => 1
177
+ # {:content=>{"01"=>:"200901.cash", "02"=>:"200902.cash"}}
178
+ def test_format_sym_str_nested
179
+ file = "#{File.dirname(__FILE__)}/files/nested.cash"
180
+ raise file.inspect unless File.exist?(file)
181
+ act = Cheeba.read(file)
182
+ exp = {1 => "awesome", 2 => "dude", 3 => {1 => "niceone", 2 => "bro", "fekja" => "bacon", 3 => {1 => "beer", 2 => "camaro"}}}
183
+ assert_equal exp, act
184
+ end
167
185
  end
@@ -54,6 +54,10 @@ class TestReaderFormat < MiniTest::Unit::TestCase
54
54
  assert_equal exp2, act2[:key]
55
55
  end
56
56
 
57
+ def test_format_sym_str_nested
58
+
59
+ end
60
+
57
61
  def test_format_sym_str
58
62
  opt1 = @opt.merge({:sym_str => true})
59
63
  opt2 = @opt.merge({:int => true, :sym_str => true})
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awesome-cheeba
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - So Awesome Man
@@ -14,6 +14,7 @@ default_executable: cheeba
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: hoe
17
+ type: :development
17
18
  version_requirement:
18
19
  version_requirements: !ruby/object:Gem::Requirement
19
20
  requirements: