csv_lazy 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/csv_lazy.gemspec +1 -1
  3. data/lib/csv_lazy.rb +8 -1
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
data/csv_lazy.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{csv_lazy}
8
- s.version = "0.0.1"
8
+ s.version = "0.0.2"
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"]
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.1
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: 2827273816324907749
97
+ hash: 3942871141761432194
98
98
  segments:
99
99
  - 0
100
100
  version: "0"