columns-matcher 0.0.2.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -15,3 +15,6 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+
19
+ .DS_Store
20
+ lib/.DS_Store
data/README.md CHANGED
@@ -86,6 +86,8 @@ gem "columns-matcher"
86
86
 
87
87
  ```ruby
88
88
 
89
+ require "columns-matcher"
90
+
89
91
  @matcher = ColumnsMatcher::Matcher.new
90
92
 
91
93
  # the column that contains the name can be lebeled with "NAME", "NOME" or "NOMBRE"
@@ -105,6 +107,8 @@ First try is as exact match. If does not work it try with different case:
105
107
 
106
108
  ```ruby
107
109
 
110
+ require "columns-matcher"
111
+
108
112
  @matcher = ColumnsMatcher::Matcher.new
109
113
 
110
114
  # the column that contains the name can be lebeled with "NAME", "NOME" or "NOMBRE"
@@ -120,6 +124,8 @@ If I can't find the column with exact match or different case match i can also u
120
124
 
121
125
  ```ruby
122
126
 
127
+ require "columns-matcher"
128
+
123
129
  @matcher = ColumnsMatcher::Matcher.new
124
130
 
125
131
  # the column that contains the name can be lebeled with "NAME", "NOME" or "NOMBRE"
@@ -1,3 +1,3 @@
1
1
  module ColumnsMatcher
2
- VERSION = "0.0.2.2"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -17,6 +17,12 @@ describe ColumnsMatcher do
17
17
  @matcher.set_header(["NOME"])
18
18
  @matcher.column_of("name").should be(0)
19
19
  end
20
+
21
+ it "should recognize single column with a single description including spaces" do
22
+ @matcher.add_column("coupon_code", ["Codigo coupon"])
23
+ @matcher.set_header(["Codigo coupon"])
24
+ @matcher.column_of("coupon_code").should be(0)
25
+ end
20
26
 
21
27
  it "should recognize single column with multiple descriptions" do
22
28
  @matcher.add_column("name", ["NAME", "NOME", "NOMBRE"])
@@ -79,6 +85,12 @@ describe ColumnsMatcher do
79
85
  @matcher.set_header(["Emails"])
80
86
  @matcher.column_of("email").should be(0)
81
87
  end
88
+
89
+ it "should not find single column with a reg exp and spaces" do
90
+ @matcher.add_column("coupon_code", ["Codigo cupon[^\"]*"])
91
+ @matcher.set_header(["Codigo cupon (pedido #)"])
92
+ @matcher.column_of("coupon_code").should be(0)
93
+ end
82
94
 
83
95
  end
84
96
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: columns-matcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2.2
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-03 00:00:00.000000000Z
12
+ date: 2012-07-10 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70306346828580 !ruby/object:Gem::Requirement
16
+ requirement: &70243489941860 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 2.6.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70306346828580
24
+ version_requirements: *70243489941860
25
25
  description: Given an hash of possibles header label find the correct position of
26
26
  a column in the real header. Useful when you don't know the structure of a spreadsheet.
27
27
  email:
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  version: '0'
61
61
  requirements: []
62
62
  rubyforge_project:
63
- rubygems_version: 1.8.6
63
+ rubygems_version: 1.8.10
64
64
  signing_key:
65
65
  specification_version: 3
66
66
  summary: Column header label matcher