flexible_csv 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +7 -1
- data/lib/flexible_csv.rb +1 -1
- data/lib/hacks.rb +1 -1
- data/test/flexible_csv.rspec +2 -0
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -1,9 +1,15 @@
|
|
1
1
|
= FlexibleCsv
|
2
2
|
|
3
|
-
<em>Chris Powers
|
3
|
+
<em>Created by Chris Powers</em>
|
4
4
|
|
5
5
|
The FlexibleCsv gem uses the FasterCSV gem to parse user created CSV files that may not have standard headers. For example, you know there's an email address column somewhere in there, but it may be called "Email" or "Email Address" or "email-address", and it might be in the first column, but it might be in the third.
|
6
6
|
|
7
|
+
== Install
|
8
|
+
|
9
|
+
This gem is hosted by gemcutter.org, so just:
|
10
|
+
|
11
|
+
gem install flexible_csv
|
12
|
+
|
7
13
|
== Examples
|
8
14
|
|
9
15
|
These CSV data snippets have the same data but are formatted much differently. Using FlexibleCsv to map possible column names to data nodes, these differences become negligible.
|
data/lib/flexible_csv.rb
CHANGED
data/lib/hacks.rb
CHANGED
data/test/flexible_csv.rspec
CHANGED
@@ -21,7 +21,9 @@ describe FlexibleCsv do
|
|
21
21
|
it "should work with example 1" do
|
22
22
|
@parser.parse(@csv_data1).each do |row|
|
23
23
|
row["full_name"].should_not be_blank
|
24
|
+
row.full_name.should_not be_blank
|
24
25
|
row["email"].should_not be_blank
|
26
|
+
row.email.should_not be_blank
|
25
27
|
end
|
26
28
|
end
|
27
29
|
|