rugalytics 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.1.6. better fix for double quotes in csv causing fastercsv to fail
2
+
1
3
  v0.1.5. fixes for bad quotes in csv causing fastercsv to fail
2
4
 
3
5
  v0.1.4. now use fastercsv to parse table row data
data/lib/rugalytics.rb CHANGED
@@ -12,7 +12,7 @@ require 'fastercsv'
12
12
 
13
13
  # See README for usage documentation.
14
14
  module Rugalytics
15
- VERSION = "0.1.5"
15
+ VERSION = "0.1.6"
16
16
 
17
17
  FORMAT_PDF = '0' unless defined? FORMAT_PDF
18
18
  FORMAT_XML = '1' unless defined? FORMAT_XML
@@ -98,20 +98,9 @@ module Rugalytics
98
98
  begin
99
99
  values = FasterCSV.parse_line(values_line)
100
100
  rescue Exception => e
101
- # fix broken csv
102
- values_line.gsub!(/,""/,',"\"')
103
- values_line.gsub!(/"",/,'\"",')
104
- values_line.gsub!(/^""/,'"\"')
105
- values_line.gsub!(/""$/,'\""')
106
- values_line.gsub!(/([^\\])""/,'\1\"')
107
- values_line.gsub!(/\\"/,'""')
108
- begin
109
- values = FasterCSV.parse_line(values_line)
110
- rescue Exception => e
111
- values_line.gsub!(/\\"/,'')
112
- values_line.gsub!(/"/,'')
113
- values = FasterCSV.parse_line(values_line)
114
- end
101
+ values_line.gsub!(/""/,'$$')
102
+ values = FasterCSV.parse_line(values_line)
103
+ values.each {|v| v.gsub!('$$','"')}
115
104
  end
116
105
  items << Item.new(attributes, values, base_url)
117
106
  index = index.next
data/rugalytics.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{rugalytics}
5
- s.version = "0.1.5"
5
+ s.version = "0.1.6"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Rob McKinnon"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rugalytics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob McKinnon