umbrellio-sequel-plugins 0.4.0.152 → 0.5.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c457e432fd30ccbc7eea5a66e94ce828c179dc25e45f403ee8a7cc78d23d8f1
4
- data.tar.gz: 3fee2f7af3fedb7ed161964ce6a1bdd4b115b88d8d4faa67bc14f9d0317c74b8
3
+ metadata.gz: b433c0b5ab8bdc3dc317e9d1594c2d287cc21c6e5682bca5a95644c806fdaa11
4
+ data.tar.gz: 9a6fb69d06d7a37ad66ff8c8300314e4606a4f9255c2dda95dc573f64cb40fbe
5
5
  SHA512:
6
- metadata.gz: '093103fc7ae3108cc818312319d63ef2229073bfa48453a71d764de9f498bc597b09c5148219c12b930a334824ed6ef828c44b4a814470a90739bf41cca3e12e'
7
- data.tar.gz: 416ed5d8f41e6d947fc8b82d4752e8caf55dd985f639d8b347b15e3e523fc067c133c14f4d21838c0b3221eb847ba3fe2433907d0349f4b42dfe865545511dee
6
+ metadata.gz: b71e1e91f8aecb45295299ab187d67a11e975c0def4d46b0009e7b3087eac407f9a8f384d189181825d13d18277d8dacc1b7f7b3f448bd3e0ec060e595302c60
7
+ data.tar.gz: 2bb8287741768030db1703a2fab97c9204d57e454306c8fa5da145d0bf360d87519a011d7b2e986f7f5136a51ca34e4fcbb3f59b38b04aad4b1b39417941c605
@@ -0,0 +1,65 @@
1
+ name: CI
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ test:
7
+ runs-on: ubuntu-latest
8
+
9
+ # We want to run on external PRs, but not on our own internal PRs as they'll be run on push event
10
+ if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'umbrellio/umbrellio-sequel-plugins'
11
+
12
+ services:
13
+ postgres:
14
+ image: postgres:12
15
+ env:
16
+ POSTGRES_USER: root
17
+ POSTGRES_HOST_AUTH_METHOD: trust
18
+ options: >-
19
+ --health-cmd pg_isready
20
+ --health-interval 10s
21
+ --health-timeout 5s
22
+ --health-retries 5
23
+ ports:
24
+ - 5432:5432
25
+
26
+ env:
27
+ PGHOST: localhost
28
+ PGUSER: root
29
+
30
+ strategy:
31
+ fail-fast: false
32
+ matrix:
33
+ ruby: ["2.5", "2.6", "2.7", "3.0"]
34
+
35
+ name: ${{ matrix.ruby }}
36
+
37
+ steps:
38
+ - uses: actions/checkout@v2
39
+
40
+ - uses: ruby/setup-ruby@v1
41
+ with:
42
+ ruby-version: ${{ matrix.ruby }}
43
+ bundler-cache: true
44
+
45
+ - run: psql -c 'CREATE DATABASE sequel_plugins'
46
+ - run: bundle exec rake
47
+
48
+ - uses: coverallsapp/github-action@v1.1.2
49
+ with:
50
+ github-token: ${{ secrets.GITHUB_TOKEN }}
51
+
52
+ deploy:
53
+ runs-on: ubuntu-latest
54
+
55
+ environment: Deploy
56
+
57
+ # Run on push to master branch
58
+ if: github.event_name == 'push' && github.ref == 'refs/heads/master'
59
+
60
+ steps:
61
+ - uses: actions/checkout@v1
62
+
63
+ - uses: umbrellio/publish-ruby-gem-action@v1
64
+ with:
65
+ api-key: ${{secrets.RUBYGEMS_API_KEY}}
data/.travis.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  language: ruby
2
2
 
3
3
  os: linux
4
+
4
5
  dist: xenial
5
6
 
6
7
  jobs:
@@ -43,10 +44,6 @@ install: bundle install --jobs=3 --retry=3 --path=${BUNDLE_PATH:-vendor/bundle}
43
44
  before_script:
44
45
  - psql -c 'create database sequel_plugins;' -U postgres
45
46
 
46
- script:
47
- - bundle exec rspec
48
- - bundle exec rubocop
49
-
50
47
  deploy:
51
48
  provider: rubygems
52
49
  api_key:
data/Gemfile.lock CHANGED
@@ -1,109 +1,107 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- umbrellio-sequel-plugins (0.4.0)
4
+ umbrellio-sequel-plugins (0.5.1)
5
5
  sequel
6
- symbiont-ruby (>= 0.6)
6
+ symbiont-ruby
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (6.0.2.2)
11
+ activesupport (6.1.3)
12
12
  concurrent-ruby (~> 1.0, >= 1.0.2)
13
- i18n (>= 0.7, < 2)
14
- minitest (~> 5.1)
15
- tzinfo (~> 1.1)
16
- zeitwerk (~> 2.2)
17
- ast (2.4.0)
18
- coderay (1.1.2)
19
- concurrent-ruby (1.1.6)
20
- coveralls (0.8.23)
21
- json (>= 1.8, < 3)
22
- simplecov (~> 0.16.1)
23
- term-ansicolor (~> 1.3)
24
- thor (>= 0.19.4, < 2.0)
25
- tins (~> 1.6)
26
- diff-lcs (1.3)
27
- docile (1.3.2)
28
- i18n (1.8.2)
13
+ i18n (>= 1.6, < 2)
14
+ minitest (>= 5.1)
15
+ tzinfo (~> 2.0)
16
+ zeitwerk (~> 2.3)
17
+ ast (2.4.2)
18
+ coderay (1.1.3)
19
+ concurrent-ruby (1.1.8)
20
+ diff-lcs (1.4.4)
21
+ docile (1.3.5)
22
+ i18n (1.8.9)
29
23
  concurrent-ruby (~> 1.0)
30
- jaro_winkler (1.5.4)
31
- json (2.3.0)
32
24
  method_source (1.0.0)
33
- minitest (5.14.0)
34
- money (6.13.7)
25
+ minitest (5.14.4)
26
+ money (6.14.1)
35
27
  i18n (>= 0.6.4, <= 2)
36
- parallel (1.19.1)
37
- parser (2.7.1.0)
38
- ast (~> 2.4.0)
28
+ parallel (1.20.1)
29
+ parser (3.0.0.0)
30
+ ast (~> 2.4.1)
39
31
  pg (1.2.3)
40
- pry (0.13.0)
32
+ pry (0.14.0)
41
33
  coderay (~> 1.1)
42
34
  method_source (~> 1.0)
43
- rack (2.2.2)
35
+ rack (2.2.3)
44
36
  rainbow (3.0.0)
45
- rake (13.0.1)
37
+ rake (13.0.3)
38
+ regexp_parser (2.1.1)
46
39
  rexml (3.2.4)
47
- rspec (3.9.0)
48
- rspec-core (~> 3.9.0)
49
- rspec-expectations (~> 3.9.0)
50
- rspec-mocks (~> 3.9.0)
51
- rspec-core (3.9.1)
52
- rspec-support (~> 3.9.1)
53
- rspec-expectations (3.9.1)
40
+ rspec (3.10.0)
41
+ rspec-core (~> 3.10.0)
42
+ rspec-expectations (~> 3.10.0)
43
+ rspec-mocks (~> 3.10.0)
44
+ rspec-core (3.10.1)
45
+ rspec-support (~> 3.10.0)
46
+ rspec-expectations (3.10.1)
54
47
  diff-lcs (>= 1.2.0, < 2.0)
55
- rspec-support (~> 3.9.0)
56
- rspec-mocks (3.9.1)
48
+ rspec-support (~> 3.10.0)
49
+ rspec-mocks (3.10.2)
57
50
  diff-lcs (>= 1.2.0, < 2.0)
58
- rspec-support (~> 3.9.0)
59
- rspec-support (3.9.2)
60
- rubocop (0.81.0)
61
- jaro_winkler (~> 1.5.1)
51
+ rspec-support (~> 3.10.0)
52
+ rspec-support (3.10.2)
53
+ rubocop (1.11.0)
62
54
  parallel (~> 1.10)
63
- parser (>= 2.7.0.1)
55
+ parser (>= 3.0.0.0)
64
56
  rainbow (>= 2.2.2, < 4.0)
57
+ regexp_parser (>= 1.8, < 3.0)
65
58
  rexml
59
+ rubocop-ast (>= 1.2.0, < 2.0)
66
60
  ruby-progressbar (~> 1.7)
67
- unicode-display_width (>= 1.4.0, < 2.0)
68
- rubocop-config-umbrellio (0.81.0.78)
69
- rubocop (= 0.81.0)
70
- rubocop-performance (= 1.5.2)
71
- rubocop-rails (= 2.5.0)
72
- rubocop-rspec (= 1.38.1)
73
- rubocop-performance (1.5.2)
74
- rubocop (>= 0.71.0)
75
- rubocop-rails (2.5.0)
76
- activesupport
61
+ unicode-display_width (>= 1.4.0, < 3.0)
62
+ rubocop-ast (1.4.1)
63
+ parser (>= 2.7.1.5)
64
+ rubocop-config-umbrellio (1.11.0.40)
65
+ rubocop (= 1.11.0)
66
+ rubocop-performance (= 1.10.0)
67
+ rubocop-rails (= 2.9.1)
68
+ rubocop-rake (= 0.5.1)
69
+ rubocop-rspec (= 2.2.0)
70
+ rubocop-sequel (= 0.2.0)
71
+ rubocop-performance (1.10.0)
72
+ rubocop (>= 0.90.0, < 2.0)
73
+ rubocop-ast (>= 0.4.0)
74
+ rubocop-rails (2.9.1)
75
+ activesupport (>= 4.2.0)
77
76
  rack (>= 1.1)
78
- rubocop (>= 0.72.0)
79
- rubocop-rspec (1.38.1)
80
- rubocop (>= 0.68.1)
81
- ruby-progressbar (1.10.1)
82
- sequel (5.31.0)
83
- simplecov (0.16.1)
77
+ rubocop (>= 0.90.0, < 2.0)
78
+ rubocop-rake (0.5.1)
79
+ rubocop
80
+ rubocop-rspec (2.2.0)
81
+ rubocop (~> 1.0)
82
+ rubocop-ast (>= 1.1.0)
83
+ rubocop-sequel (0.2.0)
84
+ rubocop (~> 1.0)
85
+ ruby-progressbar (1.11.0)
86
+ sequel (5.45.0)
87
+ simplecov (0.21.2)
84
88
  docile (~> 1.1)
85
- json (>= 1.8, < 3)
86
- simplecov-html (~> 0.10.0)
87
- simplecov-html (0.10.2)
89
+ simplecov-html (~> 0.11)
90
+ simplecov_json_formatter (~> 0.1)
91
+ simplecov-html (0.12.3)
92
+ simplecov-lcov (0.8.0)
93
+ simplecov_json_formatter (0.1.2)
88
94
  symbiont-ruby (0.6.0)
89
- sync (0.5.0)
90
- term-ansicolor (1.7.1)
91
- tins (~> 1.0)
92
- thor (1.0.1)
93
- thread_safe (0.3.6)
94
- tins (1.24.1)
95
- sync
96
- tzinfo (1.2.7)
97
- thread_safe (~> 0.1)
98
- unicode-display_width (1.7.0)
99
- zeitwerk (2.3.0)
95
+ tzinfo (2.0.4)
96
+ concurrent-ruby (~> 1.0)
97
+ unicode-display_width (2.0.0)
98
+ zeitwerk (2.4.2)
100
99
 
101
100
  PLATFORMS
102
101
  ruby
103
102
 
104
103
  DEPENDENCIES
105
104
  bundler
106
- coveralls (>= 0.8)
107
105
  money
108
106
  pg
109
107
  pry
@@ -111,7 +109,8 @@ DEPENDENCIES
111
109
  rspec
112
110
  rubocop-config-umbrellio
113
111
  simplecov
112
+ simplecov-lcov
114
113
  umbrellio-sequel-plugins!
115
114
 
116
115
  BUNDLED WITH
117
- 2.1.4
116
+ 2.2.17
data/Rakefile CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  require "bundler/gem_tasks"
4
4
  require "rspec/core/rake_task"
5
+ require "rubocop/rake_task"
5
6
 
6
7
  RSpec::Core::RakeTask.new(:spec)
8
+ RuboCop::RakeTask.new(:lint)
7
9
 
8
- task default: :spec
10
+ task default: %i[lint spec]
@@ -62,7 +62,7 @@ module Sequel::Plugins::AttrEncrypted
62
62
  instance_variable_get("@#{attr}") || begin
63
63
  decrypted = SimpleCrypt.decrypt(send("encrypted_#{attr}"), key)
64
64
 
65
- result = !decrypted.nil? ? JSON.parse(decrypted) : decrypted
65
+ result = decrypted.nil? ? decrypted : JSON.parse(decrypted)
66
66
  instance_variable_set("@#{attr}", result)
67
67
  end
68
68
  end
@@ -30,7 +30,7 @@ module Sequel::Plugins::AttrEncrypted::SimpleCrypt
30
30
  private
31
31
 
32
32
  def new_cipher(key)
33
- result = OpenSSL::Cipher::AES256.new(:gcm)
33
+ result = OpenSSL::Cipher.new("aes-256-gcm")
34
34
  yield(result)
35
35
  result.key = key
36
36
  result
@@ -41,6 +41,6 @@ module Sequel::Plugins::AttrEncrypted::SimpleCrypt
41
41
  end
42
42
 
43
43
  def dump(*values)
44
- [*values].map { |x| Base64.strict_encode64(x) }.join(SEPARATOR)
44
+ Array(values).map { |x| Base64.strict_encode64(x) }.join(SEPARATOR)
45
45
  end
46
46
  end
@@ -5,12 +5,12 @@ module Sequel::Plugins::WithLock
5
5
  # Execute block with lock
6
6
  #
7
7
  # @yield
8
- def with_lock
8
+ def with_lock(savepoint: true)
9
9
  return yield if @__locked
10
10
  @__locked = true
11
11
 
12
12
  begin
13
- db.transaction do
13
+ db.transaction(savepoint: savepoint) do
14
14
  lock!
15
15
  yield
16
16
  end
@@ -8,10 +8,10 @@ module Sequel
8
8
  # Rollback a migration
9
9
  def undo(version)
10
10
  path = files.find { |file| migration_version_from_file(get_filename(file)) == version }
11
- raise "Migration #{version} does not exist in the filesystem" unless path
11
+ error!("Migration #{version} does not exist in the filesystem") unless path
12
12
 
13
13
  filename = get_filename(path)
14
- raise "Migration #{version} is not applied" unless applied_migrations.include?(filename)
14
+ error!("Migration #{version} is not applied") unless applied_migrations.include?(filename)
15
15
 
16
16
  migration = get_migration(path)
17
17
 
@@ -41,7 +41,7 @@ module Sequel
41
41
  end
42
42
  end
43
43
 
44
- Sequel::TimestampMigrator.prepend TimestampMigratorLogger
44
+ Sequel::TimestampMigrator.prepend(TimestampMigratorLogger)
45
45
 
46
46
  private
47
47
 
@@ -57,6 +57,10 @@ module Sequel
57
57
  def get_filename(path)
58
58
  File.basename(path).downcase
59
59
  end
60
+
61
+ def error!(message)
62
+ raise Sequel::Migrator::Error, message
63
+ end
60
64
  end
61
65
  end
62
66
  # rubocop:enable Layout/ClassStructure
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "umbrellio_sequel_plugins.rb"
3
+ require_relative "umbrellio_sequel_plugins"
@@ -4,11 +4,11 @@ lib = File.expand_path("lib", __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- gem_version = "0.4.0"
8
- release_version = ENV["TRAVIS"] ? "#{gem_version}.#{ENV["TRAVIS_BUILD_NUMBER"]}" : gem_version
7
+ gem_version = "0.5.1"
8
+ release_version = "#{gem_version}.#{ENV["GITHUB_RUN_NUMBER"]}" if ENV["GITHUB_ACTIONS"]
9
9
 
10
10
  spec.name = "umbrellio-sequel-plugins"
11
- spec.version = release_version
11
+ spec.version = release_version || gem_version
12
12
  spec.required_ruby_version = ">= 2.4"
13
13
 
14
14
  spec.authors = ["nulldef"]
@@ -16,16 +16,15 @@ Gem::Specification.new do |spec|
16
16
  spec.homepage = "https://github.com/umbrellio/umbrellio-sequel-plugins"
17
17
  spec.licenses = ["MIT"]
18
18
  spec.summary = "Sequel plugins"
19
- spec.description = "Sequel plugins"
19
+ spec.description = "A colletion of sequel plugins by Umbrellio"
20
20
 
21
21
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
22
  spec.require_paths = ["lib"]
23
23
 
24
24
  spec.add_runtime_dependency "sequel"
25
- spec.add_runtime_dependency "symbiont-ruby", ">= 0.6"
25
+ spec.add_runtime_dependency "symbiont-ruby"
26
26
 
27
27
  spec.add_development_dependency "bundler"
28
- spec.add_development_dependency "coveralls", ">= 0.8"
29
28
  spec.add_development_dependency "money"
30
29
  spec.add_development_dependency "pg"
31
30
  spec.add_development_dependency "pry"
@@ -33,4 +32,5 @@ Gem::Specification.new do |spec|
33
32
  spec.add_development_dependency "rspec"
34
33
  spec.add_development_dependency "rubocop-config-umbrellio"
35
34
  spec.add_development_dependency "simplecov"
35
+ spec.add_development_dependency "simplecov-lcov"
36
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: umbrellio-sequel-plugins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0.152
4
+ version: 0.5.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - nulldef
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-13 00:00:00.000000000 Z
11
+ date: 2021-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '0.6'
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
39
  - !ruby/object:Gem::Version
40
- version: '0.6'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -53,21 +53,21 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: coveralls
56
+ name: money
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '0.8'
61
+ version: '0'
62
62
  type: :development
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.8'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: money
70
+ name: pg
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: pg
84
+ name: pry
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -95,7 +95,7 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: pry
98
+ name: rake
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ">="
@@ -109,7 +109,7 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: rake
112
+ name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
@@ -123,7 +123,7 @@ dependencies:
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
- name: rspec
126
+ name: rubocop-config-umbrellio
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
@@ -137,7 +137,7 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
- name: rubocop-config-umbrellio
140
+ name: simplecov
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - ">="
@@ -151,7 +151,7 @@ dependencies:
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
- name: simplecov
154
+ name: simplecov-lcov
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - ">="
@@ -164,7 +164,7 @@ dependencies:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
- description: Sequel plugins
167
+ description: A colletion of sequel plugins by Umbrellio
168
168
  email:
169
169
  - nulldefiner@gmail.com
170
170
  - oss@umbrellio.biz
@@ -172,6 +172,7 @@ executables: []
172
172
  extensions: []
173
173
  extra_rdoc_files: []
174
174
  files:
175
+ - ".github/workflows/ci.yml"
175
176
  - ".gitignore"
176
177
  - ".rspec"
177
178
  - ".rubocop.yml"
@@ -226,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
226
227
  - !ruby/object:Gem::Version
227
228
  version: '0'
228
229
  requirements: []
229
- rubygems_version: 3.0.8
230
+ rubygems_version: 3.1.2
230
231
  signing_key:
231
232
  specification_version: 4
232
233
  summary: Sequel plugins