hippie_csv 0.0.4 → 0.0.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d4c36e47f1db88a3f9f30eafc8eef194becb8ab7
4
- data.tar.gz: 25f0273e07e06902e369a767b66afc149e554156
3
+ metadata.gz: 25ff6543c2223eed975723e6b5718081b2f03e33
4
+ data.tar.gz: 5f62a6c390164ade3e7880ed59171f56f6d608fe
5
5
  SHA512:
6
- metadata.gz: 23010d852b216afe652be53e65acb917ebfa020b118dd70cceeb48e13ef1831665bacad3fa17e89a87d1027ee66fc3e7394b16be57739492b468af0c9af600df
7
- data.tar.gz: ce66e8cc0823906bb89dd04a111f53a17f92fa998156a4cdafb5a71534be0752f25e61c0a61186c9f1bb6c3815169e909da87b9a8266248edeb594dffdfb735a
6
+ metadata.gz: 43c0883650a3091512b8c60e55c882a22ea60fe0f946a9e74280739e0765306296fc53b8807189f9aecf71b76f41c7d23758056e025281d73e83639a301a4147
7
+ data.tar.gz: 8318a4e154ddce8ef9d5d835faf30b5ae08a94a252350380d59538a34e01a7de7c07ee968e521c1efd34d53a15720f21372beda179d0ca3513c2a02a644abc35
@@ -26,7 +26,7 @@ module HippieCSV
26
26
  def maybe_parse(string)
27
27
  QUOTE_CHARACTERS.find do |quote_character|
28
28
  Support.rescuing_malformed do
29
- return Support.parse_csv(string, quote_character)
29
+ return Support.parse_csv(string.strip, quote_character)
30
30
  end
31
31
  end
32
32
  end
@@ -1,3 +1,3 @@
1
1
  module HippieCSV
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -0,0 +1,20 @@
1
+
2
+
3
+ id,email,name,country,city,created_at,admin
4
+ 102,patrick@intercom.io,Patrick O'Doherty,United States,San Francisco,2014-04-28 23:57:08 UTC,true
5
+ 103,ben@intercom.io,Ben McRedmond,United States,San Francisco,2014-04-27 23:57:08 UTC,false
6
+ 104,ciaran@intercom.io,Ciaran Lee,Ireland,Dublin,2014-04-26 23:57:08 UTC,true
7
+ 105,eoghan@intercom.io,Eoghan McCabe,United States,San Francisco,2014-04-25 23:57:08 UTC,true
8
+ 106,des@intercom.io,Des Traynor,Ireland,Dublin,2014-04-24 23:57:08 UTC,true
9
+ 107,darragh@intercom.io,Darragh Curran,Ireland,Dublin,2014-04-23 23:57:08 UTC,true
10
+ 108,jeff@intercom.io,Jeff Gardner,Italy,Prata Camportaccio,2014-04-22 23:57:08 UTC,true
11
+ 109,macey@intercom.io,Macey Baker,United States,San Francisco,2014-04-21 23:57:08 UTC,true
12
+ 110,adam@intercom.io,Adam McCarthy,Dublin,Ireland,2014-04-20 23:57:08 UTC,true
13
+ 111,declan@intercom.io,Declan McGrath,Dublin,Ireland,2014-04-19 23:57:08 UTC,false
14
+ 112,peter@intercom.io,Peter McKenna,Dublin,Ireland,2014-04-18 23:57:08 UTC,false
15
+ 113,david@intercom.io,David Barett,Dublin,Ireland,2014-04-17 23:57:08 UTC,true
16
+ 114,eoin@intercom.io,Eoin Hennessy,Dublin,Ireland,2014-04-16 23:57:08 UTC,false
17
+
18
+
19
+
20
+
@@ -3,7 +3,7 @@ require "spec_helper"
3
3
  describe HippieCSV do
4
4
 
5
5
  it "defines a version" do
6
- expect(HippieCSV::VERSION).to eq("0.0.4")
6
+ expect(HippieCSV::VERSION).to eq("0.0.5")
7
7
  end
8
8
 
9
9
  end
@@ -101,7 +101,7 @@ describe HippieCSV do
101
101
  import = subject.read(path)
102
102
  expect(import[0].count).to eq(9)
103
103
  end
104
-
104
+
105
105
  it "works for a hard case" do
106
106
  path = fixture_path(:accents_semicolon_windows_1252)
107
107
 
@@ -109,5 +109,13 @@ describe HippieCSV do
109
109
  expect(import[0][1]).to eq("Jérome")
110
110
  expect(import[1][0]).to eq("Héloise")
111
111
  end
112
+
113
+ it "strips leading/trailing blank lines" do
114
+ path = fixture_path(:trailing_leading_lines)
115
+
116
+ import = subject.read(path)
117
+ expect(import.first).not_to be_empty
118
+ expect(import.last).not_to be_empty
119
+ end
112
120
  end
113
121
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hippie_csv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen O'Brien
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-30 00:00:00.000000000 Z
11
+ date: 2015-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -107,6 +107,7 @@ files:
107
107
  - spec/fixtures/excel.csv
108
108
  - spec/fixtures/malformed.csv
109
109
  - spec/fixtures/normal.csv
110
+ - spec/fixtures/trailing_leading_lines.csv
110
111
  - spec/fixtures/with_byte_order_mark.csv
111
112
  - spec/hippie_csv/constants_spec.rb
112
113
  - spec/hippie_csv/support_spec.rb
@@ -146,6 +147,7 @@ test_files:
146
147
  - spec/fixtures/excel.csv
147
148
  - spec/fixtures/malformed.csv
148
149
  - spec/fixtures/normal.csv
150
+ - spec/fixtures/trailing_leading_lines.csv
149
151
  - spec/fixtures/with_byte_order_mark.csv
150
152
  - spec/hippie_csv/constants_spec.rb
151
153
  - spec/hippie_csv/support_spec.rb