rgarner-csv-mapper 0.8.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.0
1
+ 1.0.0
@@ -9,6 +9,7 @@ module CsvMapper
9
9
  instance_methods.each { |m| undef_method m unless m =~ /^__||instance_eval/ }
10
10
 
11
11
  Infinity = 1.0/0
12
+ attr_reader :context
12
13
  attr_reader :mapped_attributes
13
14
 
14
15
  # Create a new instance with access to an evaluation context
@@ -15,12 +15,18 @@ describe CsvMapper::RowMap do
15
15
  row[0] = :changed_name
16
16
  end
17
17
  end
18
-
18
+
19
+ let(:test_context) { TestMapContext.new }
20
+
19
21
  before(:each) do
20
- @row_map = CsvMapper::RowMap.new(TestMapContext.new)
22
+ @row_map = CsvMapper::RowMap.new(test_context)
21
23
  @csv_row = ['first_name', 'last_name']
22
24
  end
23
25
 
26
+ it "should provide access to the context" do
27
+ @row_map.context.should == test_context
28
+ end
29
+
24
30
  it "should parse a CSV row" do
25
31
  @row_map.parse(@csv_row).should_not be_nil
26
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rgarner-csv-mapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 1.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ date: 2012-11-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
17
- requirement: &2155992480 !ruby/object:Gem::Requirement
17
+ requirement: &2168531460 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 2.0.0
23
23
  type: :development
24
24
  prerelease: false
25
- version_requirements: *2155992480
25
+ version_requirements: *2168531460
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: fastercsv
28
- requirement: &2156007300 !ruby/object:Gem::Requirement
28
+ requirement: &2168529780 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *2156007300
36
+ version_requirements: *2168529780
37
37
  description: CSV Mapper makes it easy to import data from CSV files directly to a
38
38
  collection of any type of Ruby object. The simplest way to create mappings is declare
39
39
  the names of the attributes in the order corresponding to the CSV file column order.