csv_lazy 0.0.1 → 0.0.2
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/VERSION +1 -1
- data/csv_lazy.gemspec +1 -1
- data/lib/csv_lazy.rb +8 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/csv_lazy.gemspec
CHANGED
data/lib/csv_lazy.rb
CHANGED
@@ -1,6 +1,13 @@
|
|
1
|
+
#A simple library for parsing CSV-files through IO's. Solves corrupt file formats automatically like when files contains several spaces after a column and more.
|
1
2
|
class Csv_lazy
|
2
3
|
include Enumerable
|
3
4
|
|
5
|
+
#===Examples
|
6
|
+
# File.open("csvfile.csv", "r") do |fp|
|
7
|
+
# Csv_lazy.new(:io => fp, :quote_char => '"', :col_sep => ";", :row_sep => "\n", :encode => "utf-8") do |row_array|
|
8
|
+
# puts "Row: #{row_array}"
|
9
|
+
# end
|
10
|
+
# end
|
4
11
|
def initialize(args = {}, &blk)
|
5
12
|
@args = {
|
6
13
|
:quote_char => '"',
|
@@ -16,7 +23,7 @@ class Csv_lazy
|
|
16
23
|
@mutex = Mutex.new
|
17
24
|
#@debug = true
|
18
25
|
|
19
|
-
accepted = [:encode, :quote_char, :row_sep, :col_sep, :io]
|
26
|
+
accepted = [:encode, :quote_char, :row_sep, :col_sep, :io, :debug]
|
20
27
|
@args.each do |key, val|
|
21
28
|
if accepted.index(key) == nil
|
22
29
|
raise "Unknown argument: '#{key}'."
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: csv_lazy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Kasper Johansen
|
@@ -94,7 +94,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
94
94
|
requirements:
|
95
95
|
- - ">="
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
hash:
|
97
|
+
hash: 3942871141761432194
|
98
98
|
segments:
|
99
99
|
- 0
|
100
100
|
version: "0"
|