conformist 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.markdown +10 -0
- data/conformist.gemspec +2 -2
- data/lib/conformist/column.rb +1 -1
- data/lib/conformist/version.rb +1 -1
- data/test/conformist/column_test.rb +2 -2
- metadata +26 -3
data/CHANGELOG.markdown
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
# CHANGELOG
|
2
|
+
|
3
|
+
## 0.0.2
|
4
|
+
|
5
|
+
* Column#values_in will be nil if the index is out of range rather than an empty string. This is consistent with CSV
|
6
|
+
* Fixed 1.8.7 and JRuby dependancies. Gemspec will not let you specify dependancies based on the version of Ruby. Everyone gets it
|
7
|
+
|
8
|
+
## 0.0.1 / 2011-04-27
|
9
|
+
|
10
|
+
* Initial release
|
data/conformist.gemspec
CHANGED
@@ -17,8 +17,8 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.required_ruby_version = '>= 1.8.7'
|
18
18
|
|
19
19
|
s.add_development_dependency 'rake', '~> 0.8.7'
|
20
|
-
s.add_development_dependency 'minitest', '~> 2.1.0'
|
21
|
-
s.add_dependency 'fastercsv', "~> 1.5.4"
|
20
|
+
s.add_development_dependency 'minitest', '~> 2.1.0'
|
21
|
+
s.add_dependency 'fastercsv', "~> 1.5.4"
|
22
22
|
|
23
23
|
s.files = `git ls-files`.split("\n")
|
24
24
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
data/lib/conformist/column.rb
CHANGED
@@ -18,7 +18,7 @@ module Conformist
|
|
18
18
|
#
|
19
19
|
# Returns preprocessed value.
|
20
20
|
def values_in row
|
21
|
-
values = indexes.map { |index|
|
21
|
+
values = indexes.map { |index| row[index] ? row[index].strip : nil }
|
22
22
|
values = values.first if values.size == 1
|
23
23
|
if preprocessor.respond_to? :call
|
24
24
|
preprocessor.call values
|
data/lib/conformist/version.rb
CHANGED
@@ -36,8 +36,8 @@ class ColumnTest < MiniTest::Unit::TestCase
|
|
36
36
|
assert_equal 'a', column.values_in([' a '])
|
37
37
|
end
|
38
38
|
|
39
|
-
def
|
39
|
+
def test_nil
|
40
40
|
column = Conformist::Column.new(:foo, 0)
|
41
|
-
|
41
|
+
assert_nil column.values_in([])
|
42
42
|
end
|
43
43
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: conformist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Tate Johnson
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-04-
|
13
|
+
date: 2011-04-28 00:00:00 +10:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -24,6 +24,28 @@ dependencies:
|
|
24
24
|
type: :development
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: *id001
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: minitest
|
29
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
|
+
none: false
|
31
|
+
requirements:
|
32
|
+
- - ~>
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 2.1.0
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: *id002
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: fastercsv
|
40
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.5.4
|
46
|
+
type: :runtime
|
47
|
+
prerelease: false
|
48
|
+
version_requirements: *id003
|
27
49
|
description: Conformist lets you bend CSVs to your will. Let multiple, different input files conform to a single interface without rewriting your parser each time.
|
28
50
|
email:
|
29
51
|
- tate@tatey.com
|
@@ -35,6 +57,7 @@ extra_rdoc_files: []
|
|
35
57
|
|
36
58
|
files:
|
37
59
|
- .gitignore
|
60
|
+
- CHANGELOG.markdown
|
38
61
|
- Gemfile
|
39
62
|
- LICENSE
|
40
63
|
- README.markdown
|
@@ -74,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
97
|
requirements:
|
75
98
|
- - ">="
|
76
99
|
- !ruby/object:Gem::Version
|
77
|
-
hash: -
|
100
|
+
hash: -1209245458572220166
|
78
101
|
segments:
|
79
102
|
- 0
|
80
103
|
version: "0"
|