table_sync 2.2.0 → 2.3.0

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
  SHA256:
3
- metadata.gz: fd4c73054274dd89d2a58f98fb0974a4202a78aad3512a9d85e50219ab4dc7b0
4
- data.tar.gz: 50f863a5e00336c03c58d19733354d7287db2a66e5c415ff784c23501642331d
3
+ metadata.gz: f0b124973e82ee0bf943d61fb64b4ef0eb2798d1bca0b9c6396a597b2bf00ca5
4
+ data.tar.gz: d119902d368a1af85d954f586036b4f2e12b727f82bf4901b1f852b86e047627
5
5
  SHA512:
6
- metadata.gz: 8bd844b57952aa85a32324832660b73270a28bce1c3b3a16e8a12bf02d6858531da2d1475f19865e13378b9c355639a17cf37c6f35a0b8067118d423cd9d9825
7
- data.tar.gz: 9e5911d3ed2050128d3b7ec63c9e8d3fe1ec8c464026f531cc16a6ad183e739fdd730f1a4890176a2c3194c894f07ffd7a39b12d0e69a54c643aeac6ac021ec8
6
+ metadata.gz: 653ffcb319c370378c8e861b0dd0c3468970dc10c8736a570c9f6fabbb1af05ade6a0506a744617bb9b9c2b07f218405ab17ecf969c9e7fd584ef96468d8e990
7
+ data.tar.gz: 0d080baf2462565addf4cfada754a5ba1ef67772a5e155d3958a354b938e190a99eb2d961dc56c70f26fa903cdc1ee76d0f4761999a13caf05c7e93c351ac22c
data/.gitignore CHANGED
@@ -9,5 +9,4 @@
9
9
  /spec/reports/
10
10
  /tmp/
11
11
  .ruby-version
12
- Gemfile.lock
13
12
  *.gem
@@ -2,7 +2,7 @@ inherit_gem:
2
2
  rubocop-config-umbrellio: lib/rubocop.yml
3
3
 
4
4
  AllCops:
5
- TargetRubyVersion: 2.3
5
+ TargetRubyVersion: 2.5
6
6
  Include:
7
7
  - bin/*
8
8
  - lib/**/*.rb
@@ -1,13 +1,13 @@
1
1
  language: ruby
2
2
 
3
+ rvm:
4
+ - 2.5
5
+ - 2.6
6
+ - 2.7
7
+ - ruby-head
8
+
3
9
  matrix:
4
10
  fast_finish: true
5
- include:
6
- - rvm: 2.3
7
- - rvm: 2.4
8
- - rvm: 2.5
9
- - rvm: 2.6
10
- - rvm: ruby-head
11
11
  allow_failures:
12
12
  - rvm: ruby-head
13
13
 
@@ -1,6 +1,19 @@
1
1
  # Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [2.3.0] - 2020-07-22
5
+ ### Added
6
+ - ruby 2.7 in Travis
7
+ - Gemfile.lock
8
+
9
+ ### Changed
10
+ - some fixes to get rid of warnings for ruby 2.7 (implicit conversion of hashes into kwargs will be dropped)
11
+ - TableSync.sync now explicitly expects klass and kwargs (it converts them into hash)
12
+ - TableSync::Instrument.notify now explicitly expects kwargs and delegates them further as kwargs
13
+
14
+ ### Removed
15
+ - ruby 2.3, 2.4 from Travis
16
+
4
17
  ## [2.2.0] - 2020-04-12
5
18
  ### Added
6
19
  - Introduce Plugin ecosystem (**TableSync::Plugins**);
@@ -0,0 +1,257 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ table_sync (2.2.0)
5
+ memery
6
+ rabbit_messaging (~> 0.3)
7
+ rails
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ actioncable (6.0.3.2)
13
+ actionpack (= 6.0.3.2)
14
+ nio4r (~> 2.0)
15
+ websocket-driver (>= 0.6.1)
16
+ actionmailbox (6.0.3.2)
17
+ actionpack (= 6.0.3.2)
18
+ activejob (= 6.0.3.2)
19
+ activerecord (= 6.0.3.2)
20
+ activestorage (= 6.0.3.2)
21
+ activesupport (= 6.0.3.2)
22
+ mail (>= 2.7.1)
23
+ actionmailer (6.0.3.2)
24
+ actionpack (= 6.0.3.2)
25
+ actionview (= 6.0.3.2)
26
+ activejob (= 6.0.3.2)
27
+ mail (~> 2.5, >= 2.5.4)
28
+ rails-dom-testing (~> 2.0)
29
+ actionpack (6.0.3.2)
30
+ actionview (= 6.0.3.2)
31
+ activesupport (= 6.0.3.2)
32
+ rack (~> 2.0, >= 2.0.8)
33
+ rack-test (>= 0.6.3)
34
+ rails-dom-testing (~> 2.0)
35
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
36
+ actiontext (6.0.3.2)
37
+ actionpack (= 6.0.3.2)
38
+ activerecord (= 6.0.3.2)
39
+ activestorage (= 6.0.3.2)
40
+ activesupport (= 6.0.3.2)
41
+ nokogiri (>= 1.8.5)
42
+ actionview (6.0.3.2)
43
+ activesupport (= 6.0.3.2)
44
+ builder (~> 3.1)
45
+ erubi (~> 1.4)
46
+ rails-dom-testing (~> 2.0)
47
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
48
+ activejob (6.0.3.2)
49
+ activesupport (= 6.0.3.2)
50
+ globalid (>= 0.3.6)
51
+ activemodel (6.0.3.2)
52
+ activesupport (= 6.0.3.2)
53
+ activerecord (6.0.3.2)
54
+ activemodel (= 6.0.3.2)
55
+ activesupport (= 6.0.3.2)
56
+ activestorage (6.0.3.2)
57
+ actionpack (= 6.0.3.2)
58
+ activejob (= 6.0.3.2)
59
+ activerecord (= 6.0.3.2)
60
+ marcel (~> 0.3.1)
61
+ activesupport (6.0.3.2)
62
+ concurrent-ruby (~> 1.0, >= 1.0.2)
63
+ i18n (>= 0.7, < 2)
64
+ minitest (~> 5.1)
65
+ tzinfo (~> 1.1)
66
+ zeitwerk (~> 2.2, >= 2.2.2)
67
+ amq-protocol (2.3.2)
68
+ ast (2.4.1)
69
+ builder (3.2.4)
70
+ bundler-audit (0.7.0.1)
71
+ bundler (>= 1.2.0, < 3)
72
+ thor (>= 0.18, < 2)
73
+ bunny (2.15.0)
74
+ amq-protocol (~> 2.3, >= 2.3.1)
75
+ coderay (1.1.3)
76
+ concurrent-ruby (1.1.6)
77
+ coveralls (0.8.23)
78
+ json (>= 1.8, < 3)
79
+ simplecov (~> 0.16.1)
80
+ term-ansicolor (~> 1.3)
81
+ thor (>= 0.19.4, < 2.0)
82
+ tins (~> 1.6)
83
+ crass (1.0.6)
84
+ diff-lcs (1.4.4)
85
+ docile (1.3.2)
86
+ erubi (1.9.0)
87
+ exception_notification (4.4.3)
88
+ actionmailer (>= 4.0, < 7)
89
+ activesupport (>= 4.0, < 7)
90
+ globalid (0.4.2)
91
+ activesupport (>= 4.2.0)
92
+ i18n (1.8.4)
93
+ concurrent-ruby (~> 1.0)
94
+ jaro_winkler (1.5.4)
95
+ json (2.3.1)
96
+ lamian (1.2.0)
97
+ rails (>= 4.2)
98
+ loofah (2.6.0)
99
+ crass (~> 1.0.2)
100
+ nokogiri (>= 1.5.9)
101
+ mail (2.7.1)
102
+ mini_mime (>= 0.1.1)
103
+ marcel (0.3.3)
104
+ mimemagic (~> 0.3.2)
105
+ memery (1.3.0)
106
+ ruby2_keywords (~> 0.0.2)
107
+ method_source (1.0.0)
108
+ mimemagic (0.3.5)
109
+ mini_mime (1.0.2)
110
+ mini_portile2 (2.4.0)
111
+ minitest (5.14.1)
112
+ nio4r (2.5.2)
113
+ nokogiri (1.10.10)
114
+ mini_portile2 (~> 2.4.0)
115
+ parallel (1.19.2)
116
+ parser (2.7.1.4)
117
+ ast (~> 2.4.1)
118
+ pg (0.21.0)
119
+ pry (0.13.1)
120
+ coderay (~> 1.1)
121
+ method_source (~> 1.0)
122
+ rabbit_messaging (0.7.1)
123
+ bunny (~> 2.0)
124
+ exception_notification
125
+ lamian
126
+ rails
127
+ sneakers (~> 2.0)
128
+ tainbox
129
+ rack (2.2.3)
130
+ rack-test (1.1.0)
131
+ rack (>= 1.0, < 3)
132
+ rails (6.0.3.2)
133
+ actioncable (= 6.0.3.2)
134
+ actionmailbox (= 6.0.3.2)
135
+ actionmailer (= 6.0.3.2)
136
+ actionpack (= 6.0.3.2)
137
+ actiontext (= 6.0.3.2)
138
+ actionview (= 6.0.3.2)
139
+ activejob (= 6.0.3.2)
140
+ activemodel (= 6.0.3.2)
141
+ activerecord (= 6.0.3.2)
142
+ activestorage (= 6.0.3.2)
143
+ activesupport (= 6.0.3.2)
144
+ bundler (>= 1.3.0)
145
+ railties (= 6.0.3.2)
146
+ sprockets-rails (>= 2.0.0)
147
+ rails-dom-testing (2.0.3)
148
+ activesupport (>= 4.2.0)
149
+ nokogiri (>= 1.6)
150
+ rails-html-sanitizer (1.3.0)
151
+ loofah (~> 2.3)
152
+ railties (6.0.3.2)
153
+ actionpack (= 6.0.3.2)
154
+ activesupport (= 6.0.3.2)
155
+ method_source
156
+ rake (>= 0.8.7)
157
+ thor (>= 0.20.3, < 2.0)
158
+ rainbow (3.0.0)
159
+ rake (13.0.1)
160
+ rexml (3.2.4)
161
+ rspec (3.9.0)
162
+ rspec-core (~> 3.9.0)
163
+ rspec-expectations (~> 3.9.0)
164
+ rspec-mocks (~> 3.9.0)
165
+ rspec-core (3.9.2)
166
+ rspec-support (~> 3.9.3)
167
+ rspec-expectations (3.9.2)
168
+ diff-lcs (>= 1.2.0, < 2.0)
169
+ rspec-support (~> 3.9.0)
170
+ rspec-mocks (3.9.1)
171
+ diff-lcs (>= 1.2.0, < 2.0)
172
+ rspec-support (~> 3.9.0)
173
+ rspec-support (3.9.3)
174
+ rubocop (0.81.0)
175
+ jaro_winkler (~> 1.5.1)
176
+ parallel (~> 1.10)
177
+ parser (>= 2.7.0.1)
178
+ rainbow (>= 2.2.2, < 4.0)
179
+ rexml
180
+ ruby-progressbar (~> 1.7)
181
+ unicode-display_width (>= 1.4.0, < 2.0)
182
+ rubocop-config-umbrellio (0.81.0.78)
183
+ rubocop (= 0.81.0)
184
+ rubocop-performance (= 1.5.2)
185
+ rubocop-rails (= 2.5.0)
186
+ rubocop-rspec (= 1.38.1)
187
+ rubocop-performance (1.5.2)
188
+ rubocop (>= 0.71.0)
189
+ rubocop-rails (2.5.0)
190
+ activesupport
191
+ rack (>= 1.1)
192
+ rubocop (>= 0.72.0)
193
+ rubocop-rspec (1.38.1)
194
+ rubocop (>= 0.68.1)
195
+ ruby-progressbar (1.10.1)
196
+ ruby2_keywords (0.0.2)
197
+ sequel (5.34.0)
198
+ serverengine (2.0.7)
199
+ sigdump (~> 0.2.2)
200
+ sigdump (0.2.4)
201
+ simplecov (0.16.1)
202
+ docile (~> 1.1)
203
+ json (>= 1.8, < 3)
204
+ simplecov-html (~> 0.10.0)
205
+ simplecov-html (0.10.2)
206
+ sneakers (2.11.0)
207
+ bunny (~> 2.12)
208
+ concurrent-ruby (~> 1.0)
209
+ rake
210
+ serverengine (~> 2.0.5)
211
+ thor
212
+ sprockets (4.0.2)
213
+ concurrent-ruby (~> 1.0)
214
+ rack (> 1, < 3)
215
+ sprockets-rails (3.2.1)
216
+ actionpack (>= 4.0)
217
+ activesupport (>= 4.0)
218
+ sprockets (>= 3.0.0)
219
+ sync (0.5.0)
220
+ tainbox (2.1.2)
221
+ activesupport
222
+ term-ansicolor (1.7.1)
223
+ tins (~> 1.0)
224
+ thor (1.0.1)
225
+ thread_safe (0.3.6)
226
+ timecop (0.9.1)
227
+ tins (1.25.0)
228
+ sync
229
+ tzinfo (1.2.7)
230
+ thread_safe (~> 0.1)
231
+ unicode-display_width (1.7.0)
232
+ websocket-driver (0.7.3)
233
+ websocket-extensions (>= 0.1.0)
234
+ websocket-extensions (0.1.5)
235
+ zeitwerk (2.4.0)
236
+
237
+ PLATFORMS
238
+ ruby
239
+
240
+ DEPENDENCIES
241
+ activejob (>= 6.0)
242
+ activerecord (>= 6.0)
243
+ bundler
244
+ bundler-audit
245
+ coveralls (~> 0.8)
246
+ pg (~> 0.18)
247
+ pry
248
+ rake
249
+ rspec (~> 3.8)
250
+ rubocop-config-umbrellio (~> 0.81)
251
+ sequel
252
+ simplecov (~> 0.16)
253
+ table_sync!
254
+ timecop
255
+
256
+ BUNDLED WITH
257
+ 2.1.4
data/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2019 Umbrellio
3
+ Copyright (c) 2019-2020 Umbrellio
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -43,8 +43,8 @@ module TableSync
43
43
  attr_accessor :routing_metadata_callable
44
44
  attr_accessor :notifier
45
45
 
46
- def sync(*args)
47
- orm.setup_sync(*args)
46
+ def sync(klass, **opts)
47
+ orm.setup_sync(klass, opts)
48
48
  end
49
49
 
50
50
  def orm=(val)
@@ -44,7 +44,7 @@ module TableSync
44
44
 
45
45
  # wrapper for proc-value, this wrapper receives all params (model, version, project_id...)
46
46
  # and filters them for proc-value
47
- unified_block = proc { |hash = {}| block.call(hash.slice(*params)) }
47
+ unified_block = proc { |hash = {}| block.call(**hash.slice(*params)) }
48
48
 
49
49
  # set wrapped proc-value as ivar value
50
50
  instance_variable_set(ivar, unified_block)
@@ -3,7 +3,7 @@
3
3
  module TableSync::Instrument
4
4
  module_function
5
5
 
6
- def notify(*args)
7
- TableSync.notifier&.notify(*args)
6
+ def notify(**args)
7
+ TableSync.notifier&.notify(**args)
8
8
  end
9
9
  end
@@ -115,7 +115,7 @@ module TableSync::Model
115
115
  end
116
116
 
117
117
  def row_to_hash(row)
118
- row.attributes.each_with_object({}) { |(k, v), o| o[k.to_sym] = v }
118
+ row.attributes.transform_keys(&:to_sym)
119
119
  end
120
120
  end
121
121
  end
@@ -20,7 +20,7 @@ module TableSync::ORMAdapter
20
20
  object.attributes
21
21
  end
22
22
 
23
- def setup_sync(klass, **opts)
23
+ def setup_sync(klass, opts)
24
24
  debounce_time = opts.delete(:debounce_time)
25
25
 
26
26
  klass.instance_exec do
@@ -20,7 +20,7 @@ module TableSync::ORMAdapter
20
20
  object.values
21
21
  end
22
22
 
23
- def setup_sync(klass, **opts)
23
+ def setup_sync(klass, opts)
24
24
  if_predicate = to_predicate(opts.delete(:if), true)
25
25
  unless_predicate = to_predicate(opts.delete(:unless), false)
26
26
  debounce_time = opts.delete(:debounce_time)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TableSync
4
- VERSION = "2.2.0"
4
+ VERSION = "2.3.0"
5
5
  end
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  require "table_sync/version"
6
6
 
7
7
  Gem::Specification.new do |spec|
8
- spec.required_ruby_version = ">= 2.3.8"
8
+ spec.required_ruby_version = ">= 2.5.6"
9
9
 
10
10
  spec.name = "table_sync"
11
11
  spec.version = TableSync::VERSION
@@ -35,8 +35,8 @@ Gem::Specification.new do |spec|
35
35
  spec.add_development_dependency "rubocop-config-umbrellio", "~> 0.81"
36
36
  spec.add_development_dependency "simplecov", "~> 0.16"
37
37
 
38
- spec.add_development_dependency "activejob", ">= 4.2.11"
39
- spec.add_development_dependency "activerecord"
38
+ spec.add_development_dependency "activejob", ">= 6.0"
39
+ spec.add_development_dependency "activerecord", ">= 6.0"
40
40
  spec.add_development_dependency "pg", "~> 0.18"
41
41
  spec.add_development_dependency "sequel"
42
42
  spec.add_development_dependency "timecop"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: table_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Umbrellio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-12 00:00:00.000000000 Z
11
+ date: 2020-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: memery
@@ -114,28 +114,28 @@ dependencies:
114
114
  requirements:
115
115
  - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: 4.2.11
117
+ version: '6.0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: 4.2.11
124
+ version: '6.0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: activerecord
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: '0'
131
+ version: '6.0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
- version: '0'
138
+ version: '6.0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: pg
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -248,6 +248,7 @@ files:
248
248
  - ".travis.yml"
249
249
  - CHANGELOG.md
250
250
  - Gemfile
251
+ - Gemfile.lock
251
252
  - LICENSE.md
252
253
  - README.md
253
254
  - Rakefile
@@ -297,7 +298,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
297
298
  requirements:
298
299
  - - ">="
299
300
  - !ruby/object:Gem::Version
300
- version: 2.3.8
301
+ version: 2.5.6
301
302
  required_rubygems_version: !ruby/object:Gem::Requirement
302
303
  requirements:
303
304
  - - ">="