csv_lazy 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -8,9 +8,9 @@ GEM
8
8
  git (>= 1.2.5)
9
9
  rake
10
10
  rdoc
11
- json (1.7.4)
12
- rake (0.9.2.2)
13
- rdoc (3.12)
11
+ json (1.7.7)
12
+ rake (10.0.3)
13
+ rdoc (3.12.2)
14
14
  json (~> 1.4)
15
15
  rspec (2.8.0)
16
16
  rspec-core (~> 2.8.0)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
data/csv_lazy.gemspec CHANGED
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{csv_lazy}
8
- s.version = "0.0.2"
7
+ s.name = "csv_lazy"
8
+ s.version = "0.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kasper Johansen"]
12
- s.date = %q{2012-08-09}
13
- s.description = %q{A small CSV lib that skips whitespace-format-bugs and more.}
14
- s.email = %q{k@spernj.org}
12
+ s.date = "2013-03-22"
13
+ s.description = "A small CSV lib that skips whitespace-format-bugs and more."
14
+ s.email = "k@spernj.org"
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.txt",
17
17
  "README.rdoc"
@@ -31,11 +31,11 @@ Gem::Specification.new do |s|
31
31
  "spec/spec_helper.rb",
32
32
  "spec/test1.csv.gz"
33
33
  ]
34
- s.homepage = %q{http://github.com/kaspernj/csv_lazy}
34
+ s.homepage = "http://github.com/kaspernj/csv_lazy"
35
35
  s.licenses = ["MIT"]
36
36
  s.require_paths = ["lib"]
37
- s.rubygems_version = %q{1.6.2}
38
- s.summary = %q{A small CSV lib that skips whitespace-format-bugs and more.}
37
+ s.rubygems_version = "1.8.25"
38
+ s.summary = "A small CSV lib that skips whitespace-format-bugs and more."
39
39
 
40
40
  if s.respond_to? :specification_version then
41
41
  s.specification_version = 3
data/lib/csv_lazy.rb CHANGED
@@ -31,7 +31,7 @@ class Csv_lazy
31
31
  end
32
32
 
33
33
  raise "No ':quote_char' was given." if @args[:quote_char].to_s.strip.empty?
34
- raise "No ':col_sep' was given." if @args[:col_sep].to_s.strip.empty?
34
+ raise "No ':col_sep' was given." if @args[:col_sep].to_s.empty?
35
35
  raise "No ':row_sep' was given." if @args[:row_sep].to_s.empty?
36
36
  raise "No ':io' was given." if !@args[:io]
37
37
 
@@ -53,6 +53,8 @@ describe "CsvLazy" do
53
53
  end
54
54
 
55
55
  it "should read sample 1" do
56
+ require "zlib"
57
+
56
58
  count = 0
57
59
  Zlib::GzipReader.open("#{File.dirname(__FILE__)}/test1.csv.gz") do |gz|
58
60
  Csv_lazy.new(:io => gz, :col_sep => ",", :row_sep => "\r\n") do |row|
@@ -64,4 +66,21 @@ describe "CsvLazy" do
64
66
 
65
67
  raise "Expected 23 rows but got #{count}" if count != 23
66
68
  end
69
+
70
+ it "should be able to use a whitespace as col-sep" do
71
+ cont = "1\t2\t\"3\"\t4\n"
72
+
73
+ expect = 0
74
+ lines_found = 0
75
+ Csv_lazy.new(:col_sep => "\t", :io => StringIO.new(cont)) do |csv|
76
+ lines_found += 1
77
+
78
+ csv.each do |key|
79
+ expect += 1
80
+ key.should eql(expect.to_s)
81
+ end
82
+ end
83
+
84
+ lines_found.should eql(1)
85
+ end
67
86
  end
metadata CHANGED
@@ -1,72 +1,88 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: csv_lazy
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
4
5
  prerelease:
5
- version: 0.0.2
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Kasper Johansen
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2012-08-09 00:00:00 +02:00
14
- default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
12
+ date: 2013-03-22 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
17
15
  name: rspec
18
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
19
17
  none: false
20
- requirements:
18
+ requirements:
21
19
  - - ~>
22
- - !ruby/object:Gem::Version
20
+ - !ruby/object:Gem::Version
23
21
  version: 2.8.0
24
22
  type: :development
25
23
  prerelease: false
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 2.8.0
30
+ - !ruby/object:Gem::Dependency
28
31
  name: rdoc
29
- requirement: &id002 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
30
33
  none: false
31
- requirements:
34
+ requirements:
32
35
  - - ~>
33
- - !ruby/object:Gem::Version
34
- version: "3.12"
36
+ - !ruby/object:Gem::Version
37
+ version: '3.12'
35
38
  type: :development
36
39
  prerelease: false
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '3.12'
46
+ - !ruby/object:Gem::Dependency
39
47
  name: bundler
40
- requirement: &id003 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
41
49
  none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
45
53
  version: 1.0.0
46
54
  type: :development
47
55
  prerelease: false
48
- version_requirements: *id003
49
- - !ruby/object:Gem::Dependency
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 1.0.0
62
+ - !ruby/object:Gem::Dependency
50
63
  name: jeweler
51
- requirement: &id004 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
52
65
  none: false
53
- requirements:
66
+ requirements:
54
67
  - - ~>
55
- - !ruby/object:Gem::Version
68
+ - !ruby/object:Gem::Version
56
69
  version: 1.8.4
57
70
  type: :development
58
71
  prerelease: false
59
- version_requirements: *id004
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 1.8.4
60
78
  description: A small CSV lib that skips whitespace-format-bugs and more.
61
79
  email: k@spernj.org
62
80
  executables: []
63
-
64
81
  extensions: []
65
-
66
- extra_rdoc_files:
82
+ extra_rdoc_files:
67
83
  - LICENSE.txt
68
84
  - README.rdoc
69
- files:
85
+ files:
70
86
  - .document
71
87
  - .rspec
72
88
  - Gemfile
@@ -80,36 +96,32 @@ files:
80
96
  - spec/csv_lazy_spec.rb
81
97
  - spec/spec_helper.rb
82
98
  - spec/test1.csv.gz
83
- has_rdoc: true
84
99
  homepage: http://github.com/kaspernj/csv_lazy
85
- licenses:
100
+ licenses:
86
101
  - MIT
87
102
  post_install_message:
88
103
  rdoc_options: []
89
-
90
- require_paths:
104
+ require_paths:
91
105
  - lib
92
- required_ruby_version: !ruby/object:Gem::Requirement
106
+ required_ruby_version: !ruby/object:Gem::Requirement
93
107
  none: false
94
- requirements:
95
- - - ">="
96
- - !ruby/object:Gem::Version
97
- hash: 3942871141761432194
98
- segments:
108
+ requirements:
109
+ - - ! '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ segments:
99
113
  - 0
100
- version: "0"
101
- required_rubygems_version: !ruby/object:Gem::Requirement
114
+ hash: -779445160721638785
115
+ required_rubygems_version: !ruby/object:Gem::Requirement
102
116
  none: false
103
- requirements:
104
- - - ">="
105
- - !ruby/object:Gem::Version
106
- version: "0"
117
+ requirements:
118
+ - - ! '>='
119
+ - !ruby/object:Gem::Version
120
+ version: '0'
107
121
  requirements: []
108
-
109
122
  rubyforge_project:
110
- rubygems_version: 1.6.2
123
+ rubygems_version: 1.8.25
111
124
  signing_key:
112
125
  specification_version: 3
113
126
  summary: A small CSV lib that skips whitespace-format-bugs and more.
114
127
  test_files: []
115
-