cvg 0.1.3 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +5 -13
  2. data/CHANGELOG +21 -0
  3. data/bin/cvg +13 -4
  4. data/cvg.gemspec +1 -0
  5. data/lib/cvg/version.rb +1 -1
  6. metadata +38 -25
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YTI1NWZhNjg4YzY2ZDAwZGU3NTk1YTIxMGQyNTQ1ZjFlMjc1ZTY5MQ==
5
- data.tar.gz: !binary |-
6
- MjQ5NDE2Mzk4OGI2ZWNlZWIyYzU5MDI5ZmQ4N2M2YjkwMjg1N2E3MQ==
2
+ SHA1:
3
+ metadata.gz: b0ce58bb750f80bab8a43e12f89ce6f793ddbb1a
4
+ data.tar.gz: 24674fffa48caede3c99e5d4adbb99ab4939b906
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ODU5NTBiMTE3NzE0OTVlODk2MjliNDc4ZjVhZjk2NmJmMjNkYjQ0MjEzM2Yz
10
- YzQ1OWMxOWM3Mjk1MTBjOTBhZTFkMDJmMTg5YzcyYTlkYjBjMGJhZWU0NTJl
11
- ZDliYmY3MDhkMTM0NmVlYTgwZGYzYjU3OGIxNTVjNTJmOTZjZjU=
12
- data.tar.gz: !binary |-
13
- N2FhY2QyZTAwMzkyY2YwMGQ0MDMwYzQwZmQ0ZmRjY2Q0MTdlNDQ0NzgwOWVl
14
- ZjA2YTdlZTJkNDQ0MjFmOTUyNTA3MDJhY2UyMGMyYTgyZDhkZGE0YTVkYjU0
15
- NzNlNTNiNmUxN2Q2MTgxYzZmYzczNjU2NWM3ZmE4NzFiYzM5M2Q=
6
+ metadata.gz: 91b318d4c10b2bbed129084091661435e054a136ede8d19020a7a31cc81cfdd4285647df6531e16956bb8f58301a974d5df1f46600f1724de41c9ac9f916376f
7
+ data.tar.gz: 8ff44eb888b5df7471b85214dfa7edaae653e9a92d2ae18287dc60e2e426003c120fde1438b80c2d20eb5e5a2a0f2a5f2605f1a3e8cfec635300a380dcf443c3
data/CHANGELOG CHANGED
@@ -1,3 +1,24 @@
1
+ 0.2.1 / 2014-03-07
2
+
3
+ * Bug fixes
4
+
5
+ * Reverted to stdlib's (slow) CSV parser because it is more correct that fastest-csv, which silently fails on Excel CSVs
6
+
7
+ 0.2.0 / 2014-02-28 [yanked]
8
+
9
+ * Breaking changes
10
+
11
+ * Faster CSV parsing using fastest-csv (should work on MRI and JRuby, but YMMV)
12
+
13
+ * Bug fixes
14
+
15
+ * Safer deduping using a real digest function
16
+
17
+ * Enhancements
18
+
19
+ * Faster deduping using a Set instead of an Array
20
+ * --version command line option
21
+
1
22
  0.1.3 / 2013-11-14
2
23
 
3
24
  * Bug fixes
data/bin/cvg CHANGED
@@ -1,8 +1,17 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ require 'cvg/version'
4
+
5
+ if ARGV[0] == '--version'
6
+ puts Cvg::VERSION
7
+ exit
8
+ end
9
+
10
+ require 'set'
3
11
  require 'csv'
4
12
  require 'to_regexp'
5
13
  require 'active_support/core_ext'
14
+ require 'hash_digest'
6
15
 
7
16
  class Cvg
8
17
  class << self
@@ -154,14 +163,14 @@ class Cvg
154
163
  end
155
164
  end
156
165
  def registry
157
- @registry ||= []
166
+ @registry ||= Set.new
158
167
  end
159
168
  def pass?(row)
160
- hash = row.values_at(*cols).hash
161
- if registry.include?(hash)
169
+ digest = HashDigest.digest3 row.values_at(*cols)
170
+ if registry.include?(digest)
162
171
  false
163
172
  else
164
- registry << hash
173
+ registry << digest
165
174
  end
166
175
  end
167
176
  end
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_runtime_dependency "activesupport"
22
22
  spec.add_runtime_dependency "to_regexp"
23
+ spec.add_runtime_dependency 'hash_digest'
23
24
 
24
25
  spec.add_development_dependency "bundler", "~> 1.3"
25
26
  spec.add_development_dependency "rake"
@@ -1,3 +1,3 @@
1
1
  class Cvg
2
- VERSION = "0.1.3"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,125 +1,139 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cvg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seamus Abshere
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-14 00:00:00.000000000 Z
11
+ date: 2014-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: to_regexp
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: hash_digest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
39
53
  - !ruby/object:Gem::Version
40
54
  version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: bundler
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - ~>
59
+ - - "~>"
46
60
  - !ruby/object:Gem::Version
47
61
  version: '1.3'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - ~>
66
+ - - "~>"
53
67
  - !ruby/object:Gem::Version
54
68
  version: '1.3'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rake
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - ! '>='
73
+ - - ">="
60
74
  - !ruby/object:Gem::Version
61
75
  version: '0'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - ! '>='
80
+ - - ">="
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rspec
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
- - - ! '>='
87
+ - - ">="
74
88
  - !ruby/object:Gem::Version
75
89
  version: '0'
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
- - - ! '>='
94
+ - - ">="
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: rspec-expectations
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
- - - ! '>='
101
+ - - ">="
88
102
  - !ruby/object:Gem::Version
89
103
  version: '0'
90
104
  type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
- - - ! '>='
108
+ - - ">="
95
109
  - !ruby/object:Gem::Version
96
110
  version: '0'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: posix-spawn
99
113
  requirement: !ruby/object:Gem::Requirement
100
114
  requirements:
101
- - - ! '>='
115
+ - - ">="
102
116
  - !ruby/object:Gem::Version
103
117
  version: '0'
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
107
121
  requirements:
108
- - - ! '>='
122
+ - - ">="
109
123
  - !ruby/object:Gem::Version
110
124
  version: '0'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: pry
113
127
  requirement: !ruby/object:Gem::Requirement
114
128
  requirements:
115
- - - ! '>='
129
+ - - ">="
116
130
  - !ruby/object:Gem::Version
117
131
  version: '0'
118
132
  type: :development
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
121
135
  requirements:
122
- - - ! '>='
136
+ - - ">="
123
137
  - !ruby/object:Gem::Version
124
138
  version: '0'
125
139
  description: Like jq or grep for csv. Combine one or more CSVs while filtering on
@@ -131,9 +145,9 @@ executables:
131
145
  extensions: []
132
146
  extra_rdoc_files: []
133
147
  files:
134
- - .gitignore
135
- - .rspec
136
- - .travis.yml
148
+ - ".gitignore"
149
+ - ".rspec"
150
+ - ".travis.yml"
137
151
  - CHANGELOG
138
152
  - Gemfile
139
153
  - LICENSE.txt
@@ -160,17 +174,17 @@ require_paths:
160
174
  - lib
161
175
  required_ruby_version: !ruby/object:Gem::Requirement
162
176
  requirements:
163
- - - ! '>='
177
+ - - ">="
164
178
  - !ruby/object:Gem::Version
165
179
  version: '0'
166
180
  required_rubygems_version: !ruby/object:Gem::Requirement
167
181
  requirements:
168
- - - ! '>='
182
+ - - ">="
169
183
  - !ruby/object:Gem::Version
170
184
  version: '0'
171
185
  requirements: []
172
186
  rubyforge_project:
173
- rubygems_version: 2.1.5
187
+ rubygems_version: 2.2.2
174
188
  signing_key:
175
189
  specification_version: 4
176
190
  summary: Like jq or grep for csv. Combine one or more CSVs while filtering on fields
@@ -183,4 +197,3 @@ test_files:
183
197
  - features/support/env.rb
184
198
  - spec/cvg_spec.rb
185
199
  - spec/spec_helper.rb
186
- has_rdoc: