directory_diff 0.4.9 → 0.4.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa326af22cd07dc2ab6819d6f1221b030c98a849
4
- data.tar.gz: f46469c536c45a3cbcea3b26932bcaac0a0280e9
3
+ metadata.gz: 9acbd5bf09de7513e092a97a9f023e1365ce5cdc
4
+ data.tar.gz: 9af762d9aa44ef637ef71b3984e7d64518426607
5
5
  SHA512:
6
- metadata.gz: 0b539659c810d9bd19472074663bfda1c1ee2937349eafb44fca14503251860caa80743ddd3a3d11e9e902af4668f02380603f88990bc3ca3e53854f32f5077f
7
- data.tar.gz: dd56c2f064b7a4e2e708c59bbdbb962bd72483bf2dbe490bb703bedaa42b4bc4ed37a5a6fca2596a42e66e441ca7e9b8304cf40d6276b4aa475b2a88661b4549
6
+ metadata.gz: c3fdb9eaa12a867d21cd42919069f54451ce28a67f46898cbab1401ddbdc09dede9c4608d1cb86c634d59c45dec716f822bfec022994c153b18bccb734f0b0df
7
+ data.tar.gz: 9c23a147e8d137516cac4d49308f38a5c6aa046448bae6222e9efa7fe54b0eba03252d5439dd07005192cde081bbd33ab327509dc726497622b6942e49b6d45d
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ gemfiles/*.gemfile.lock
@@ -1,23 +1,13 @@
1
1
  language: ruby
2
2
  dist: xenial
3
- matrix:
4
- include:
5
- - name: "Run Ruby 2.4.4 against pg 9"
6
- rvm: 2.4.4
7
- addons:
8
- postgresql: 9.6
9
- - name: "Run Ruby 2.4.4 against pg 10"
10
- rvm: 2.4.4
11
- addons:
12
- postgresql: 10
13
- - name: "Run Ruby 2.5.1 against pg 9"
14
- rvm: 2.5.1
15
- addons:
16
- postgresql: 9.6
17
- - name: "Run Ruby 2.5.1 against pg 10"
18
- rvm: 2.5.1
19
- addons:
20
- postgresql: 10
3
+ addons:
4
+ postgresql: 9.6
5
+ rvm:
6
+ - 2.4.4
7
+ - 2.5.1
8
+ gemfile:
9
+ - gemfiles/activerecord_5.1.gemfile
10
+ - gemfiles/activerecord_5.2.gemfile
21
11
  before_install: gem install bundler -v 1.11.2
22
12
  script:
23
13
  - bundle exec rake db:create
@@ -0,0 +1,7 @@
1
+ appraise "activerecord-5.1" do
2
+ gem "activerecord", "~> 5.1.6"
3
+ end
4
+
5
+ appraise "activerecord-5.2" do
6
+ gem "activerecord", "~> 5.2.1"
7
+ end
@@ -22,9 +22,10 @@ Gem::Specification.new do |spec|
22
22
  spec.add_dependency "activerecord", ">= 5.1.4"
23
23
  spec.add_dependency "pg", "~> 1.1.3"
24
24
  spec.add_dependency "temping", "~> 3.10.0"
25
- spec.add_dependency "activerecord_pg_stuff", "~> 0.2.0"
25
+ spec.add_dependency "envoy-activerecord_pg_stuff", "~> 0.3.0"
26
26
 
27
27
  spec.add_development_dependency "bundler", "~> 1.11"
28
28
  spec.add_development_dependency "rake", "~> 10.0"
29
29
  spec.add_development_dependency "rspec", "~> 3.0"
30
+ spec.add_development_dependency "appraisal"
30
31
  end
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_RETRY: "1"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 5.1.6"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 5.2.1"
6
+
7
+ gemspec path: "../"
@@ -25,7 +25,7 @@ module DirectoryDiff
25
25
  # @param new_directory a table containing only the new records to compare
26
26
  # against, most likely a temp table.
27
27
  def into(new_directory, options = {})
28
- temp_table(current_directory_relation) do |temp_current_directory|
28
+ current_directory_temp_table do |temp_current_directory|
29
29
  new_directory_temp_table(new_directory) do |deduped_csv|
30
30
  # Get Arel tables for referencing fields, table names
31
31
  employees = temp_current_directory.table
@@ -106,8 +106,12 @@ module DirectoryDiff
106
106
 
107
107
  private
108
108
 
109
- def current_directory_relation(&block)
110
- current_directory.select(SQL.current_directory_projection)
109
+ def current_directory_temp_table(&block)
110
+ # outer temp table is required so that the projection does not run into
111
+ # ambiguous column issues
112
+ temp_table(current_directory) do |rel|
113
+ temp_table(rel.select(SQL.current_directory_projection), &block)
114
+ end
111
115
  end
112
116
 
113
117
  def new_directory_temp_table(source, &block)
@@ -162,7 +166,11 @@ module DirectoryDiff
162
166
  create_temp_table(source) do |name|
163
167
  klass = current_directory.klass
164
168
  dec = ActiveRecordPgStuff::Relation::TemporaryTable::Decorator.new(klass, name)
165
- rel = ActiveRecord::Relation.new(dec, table: dec.arel_table)
169
+ if activerecord52?
170
+ rel = ActiveRecord::Relation.new(dec)
171
+ else
172
+ rel = ActiveRecord::Relation.new(dec, dec.arel_table, dec.predicate_builder, {})
173
+ end
166
174
  rel.readonly!
167
175
  block.call(rel)
168
176
  end
@@ -238,6 +246,10 @@ module DirectoryDiff
238
246
  def connection
239
247
  current_directory.connection
240
248
  end
249
+
250
+ def activerecord52?
251
+ ActiveRecord.gem_version >= Gem::Version.new("5.2.x")
252
+ end
241
253
  end
242
254
 
243
255
  module SQL
@@ -1,3 +1,3 @@
1
1
  module DirectoryDiff
2
- VERSION = "0.4.9"
2
+ VERSION = "0.4.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: directory_diff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.4.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kamal Mahyuddin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-09 00:00:00.000000000 Z
11
+ date: 2018-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -53,19 +53,19 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: 3.10.0
55
55
  - !ruby/object:Gem::Dependency
56
- name: activerecord_pg_stuff
56
+ name: envoy-activerecord_pg_stuff
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.2.0
61
+ version: 0.3.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.2.0
68
+ version: 0.3.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '3.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: appraisal
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
111
125
  description: This microlibrary implements employee directory diffing between two versions.
112
126
  email:
113
127
  - kamal@envoy.com
@@ -120,6 +134,7 @@ files:
120
134
  - ".rspec"
121
135
  - ".rubocop.yml"
122
136
  - ".travis.yml"
137
+ - Appraisals
123
138
  - CODE_OF_CONDUCT.md
124
139
  - Gemfile
125
140
  - LICENSE.txt
@@ -128,6 +143,9 @@ files:
128
143
  - bin/console
129
144
  - bin/setup
130
145
  - directory_diff.gemspec
146
+ - gemfiles/.bundle/config
147
+ - gemfiles/activerecord_5.1.gemfile
148
+ - gemfiles/activerecord_5.2.gemfile
131
149
  - lib/directory_diff.rb
132
150
  - lib/directory_diff/transform.rb
133
151
  - lib/directory_diff/transformer/in_memory.rb