shinq 1.0.2 → 1.2.0
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 +4 -4
- data/.github/workflows/test.yml +47 -0
- data/README.md +2 -1
- data/lib/shinq/client.rb +1 -1
- data/shinq.gemspec +3 -3
- data/spec/config/database.yml +2 -1
- data/spec/db/{structure.sql.erb → structure.sql} +5 -2
- data/spec/integration_spec.rb +1 -1
- data/spec/spec_helper.rb +7 -6
- metadata +10 -10
- data/.travis.yml +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1a98bea1ff59d4ac82c52fe23e23bd70605ff985dacb6a8771b2581304a69b2
|
4
|
+
data.tar.gz: a595be8097e59bc3ddebdb247e6a9e3f9e37421f1fbbf96462a54dee2b3c60fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b9d15ab2e0c053ad30d3508661536159a3bff7635780ff2379245e1a852f3c686804b5b98a73f53400526ef3035398311108b1eb4fd3ec8c1c281de77a80b37
|
7
|
+
data.tar.gz: 0c6b367b9667cf79495642883dcfcc96d9e651d5d6ea49887453e59ca8e010f46a462b0ce7fde9e4c3c3ba06d513b73026229da3c923867b923c612e73b2a194
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: test
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches:
|
13
|
+
- master
|
14
|
+
pull_request:
|
15
|
+
branches:
|
16
|
+
- master
|
17
|
+
workflow_dispatch:
|
18
|
+
|
19
|
+
jobs:
|
20
|
+
test:
|
21
|
+
|
22
|
+
runs-on: ubuntu-latest
|
23
|
+
|
24
|
+
strategy:
|
25
|
+
max-parallel: 4
|
26
|
+
fail-fast: true
|
27
|
+
matrix:
|
28
|
+
ruby: [2.4, 2.5, 2.6, 2.7]
|
29
|
+
services:
|
30
|
+
mysql:
|
31
|
+
image: iwata/centos6-mysql56-q4m-hs
|
32
|
+
ports:
|
33
|
+
- 3306:3306
|
34
|
+
steps:
|
35
|
+
- uses: actions/checkout@v2
|
36
|
+
- name: Set up Ruby
|
37
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
38
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
39
|
+
# uses: ruby/setup-ruby@v1
|
40
|
+
uses: ruby/setup-ruby@v1
|
41
|
+
with:
|
42
|
+
bundler-cache: true
|
43
|
+
ruby-version: ${{ matrix.ruby }}
|
44
|
+
- name: Install dependencies
|
45
|
+
run: bundle install
|
46
|
+
- name: Run tests
|
47
|
+
run: bundle exec rspec
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# Shinq
|
2
|
-
|
2
|
+
|
3
|
+
[](https://github.com/ryopeko/shinq/actions?query=workflow%3Atest+event%3Apush)
|
3
4
|
|
4
5
|
Worker and enqueuer for Q4M using the interface of ActiveJob.
|
5
6
|
|
data/lib/shinq/client.rb
CHANGED
@@ -69,7 +69,7 @@ module Shinq
|
|
69
69
|
@column_names_by_table_name[table_name.to_sym] ||= begin
|
70
70
|
quoted = SQL::Maker::Quoting.quote(table_name)
|
71
71
|
column = Shinq.connection.query(<<-EOS).map { |record| record['column_name'] }
|
72
|
-
select column_name from information_schema.columns where table_schema = database() and table_name = #{quoted}
|
72
|
+
select column_name as column_name from information_schema.columns where table_schema = database() and table_name = #{quoted}
|
73
73
|
EOS
|
74
74
|
end
|
75
75
|
end
|
data/shinq.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "shinq"
|
7
|
-
spec.version = '1.0
|
7
|
+
spec.version = '1.2.0'
|
8
8
|
spec.authors = ["Ryoichi SEKIGUCHI"]
|
9
9
|
spec.email = ["ryopeko@gmail.com"]
|
10
10
|
spec.summary = %q{Worker and enqueuer for Q4M using the interface of ActiveJob.}
|
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
|
28
28
|
spec.add_dependency "mysql2", ">= 0.3.16", "< 0.6"
|
29
29
|
spec.add_dependency "sql-maker", "~> 0.0.4"
|
30
|
-
spec.add_dependency "activesupport", ">= 4.2.0", "< 6"
|
31
|
-
spec.add_dependency "activejob", ">= 4.2.0", "< 6"
|
30
|
+
spec.add_dependency "activesupport", ">= 4.2.0", "< 6.1"
|
31
|
+
spec.add_dependency "activejob", ">= 4.2.0", "< 6.1"
|
32
32
|
spec.add_dependency 'serverengine', '~> 1.5.9'
|
33
33
|
end
|
data/spec/config/database.yml
CHANGED
@@ -1,10 +1,13 @@
|
|
1
|
+
CREATE DATABASE IF NOT EXISTS shinq_test;
|
2
|
+
USE shinq_test;
|
3
|
+
|
1
4
|
DROP TABLE IF EXISTS `queue_test`;
|
2
5
|
CREATE TABLE `queue_test` (
|
3
6
|
`job_id` varchar(255) NOT NULL,
|
4
7
|
`title` varchar(255),
|
5
8
|
`scheduled_at` bigint(20) NOT NULL DEFAULT '0',
|
6
9
|
`enqueued_at` datetime NOT NULL
|
7
|
-
) ENGINE
|
10
|
+
) ENGINE=QUEUE;
|
8
11
|
|
9
12
|
DROP TABLE IF EXISTS `queue_test_without_scheduled_at`;
|
10
13
|
|
@@ -12,4 +15,4 @@ CREATE TABLE `queue_test_without_scheduled_at` (
|
|
12
15
|
`job_id` varchar(255) NOT NULL,
|
13
16
|
`title` varchar(255),
|
14
17
|
`enqueued_at` datetime NOT NULL
|
15
|
-
) ENGINE
|
18
|
+
) ENGINE=QUEUE;
|
data/spec/integration_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -10,7 +10,7 @@ require 'mysql2'
|
|
10
10
|
require 'timecop'
|
11
11
|
|
12
12
|
def load_database_config
|
13
|
-
db_config = YAML.load_file(File.expand_path('./config/database.yml', __dir__)).
|
13
|
+
db_config = YAML.load_file(File.expand_path('./config/database.yml', __dir__)).deep_symbolize_keys
|
14
14
|
end
|
15
15
|
|
16
16
|
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
|
@@ -31,12 +31,13 @@ RSpec.configure do |config|
|
|
31
31
|
end
|
32
32
|
|
33
33
|
config.before(:suite) do
|
34
|
-
|
35
|
-
# We use QUEUE engine and run Q4M specific spec (integration_spec) only when ENV['TRAVIS'] is nil.
|
36
|
-
engine = ENV['TRAVIS'] ? 'InnoDB' : 'QUEUE' # Travis MySQL does not have Q4M plugins.
|
37
|
-
sql = ERB.new(File.read(File.expand_path('./db/structure.sql.erb', __dir__))).result(binding)
|
34
|
+
sql = Pathname('./db/structure.sql').expand_path(__dir__).read
|
38
35
|
|
39
|
-
|
36
|
+
config_for_setup = load_database_config[:test]
|
37
|
+
.except(:database) # To create database
|
38
|
+
.merge(flags: Mysql2::Client::MULTI_STATEMENTS)
|
39
|
+
|
40
|
+
connection = Mysql2::Client.new(config_for_setup)
|
40
41
|
result = connection.query(sql)
|
41
42
|
|
42
43
|
while connection.next_result
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shinq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryoichi SEKIGUCHI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -165,7 +165,7 @@ dependencies:
|
|
165
165
|
version: 4.2.0
|
166
166
|
- - "<"
|
167
167
|
- !ruby/object:Gem::Version
|
168
|
-
version: '6'
|
168
|
+
version: '6.1'
|
169
169
|
type: :runtime
|
170
170
|
prerelease: false
|
171
171
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -175,7 +175,7 @@ dependencies:
|
|
175
175
|
version: 4.2.0
|
176
176
|
- - "<"
|
177
177
|
- !ruby/object:Gem::Version
|
178
|
-
version: '6'
|
178
|
+
version: '6.1'
|
179
179
|
- !ruby/object:Gem::Dependency
|
180
180
|
name: activejob
|
181
181
|
requirement: !ruby/object:Gem::Requirement
|
@@ -185,7 +185,7 @@ dependencies:
|
|
185
185
|
version: 4.2.0
|
186
186
|
- - "<"
|
187
187
|
- !ruby/object:Gem::Version
|
188
|
-
version: '6'
|
188
|
+
version: '6.1'
|
189
189
|
type: :runtime
|
190
190
|
prerelease: false
|
191
191
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -195,7 +195,7 @@ dependencies:
|
|
195
195
|
version: 4.2.0
|
196
196
|
- - "<"
|
197
197
|
- !ruby/object:Gem::Version
|
198
|
-
version: '6'
|
198
|
+
version: '6.1'
|
199
199
|
- !ruby/object:Gem::Dependency
|
200
200
|
name: serverengine
|
201
201
|
requirement: !ruby/object:Gem::Requirement
|
@@ -218,9 +218,9 @@ executables:
|
|
218
218
|
extensions: []
|
219
219
|
extra_rdoc_files: []
|
220
220
|
files:
|
221
|
+
- ".github/workflows/test.yml"
|
221
222
|
- ".gitignore"
|
222
223
|
- ".rspec"
|
223
|
-
- ".travis.yml"
|
224
224
|
- Gemfile
|
225
225
|
- LICENSE.txt
|
226
226
|
- README.md
|
@@ -240,7 +240,7 @@ files:
|
|
240
240
|
- lib/shinq/statistics.rb
|
241
241
|
- shinq.gemspec
|
242
242
|
- spec/config/database.yml
|
243
|
-
- spec/db/structure.sql
|
243
|
+
- spec/db/structure.sql
|
244
244
|
- spec/helpers/my_worker.rb
|
245
245
|
- spec/integration_spec.rb
|
246
246
|
- spec/shinq/cli_spec.rb
|
@@ -267,13 +267,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
267
267
|
- !ruby/object:Gem::Version
|
268
268
|
version: '0'
|
269
269
|
requirements: []
|
270
|
-
rubygems_version: 3.0
|
270
|
+
rubygems_version: 3.2.0
|
271
271
|
signing_key:
|
272
272
|
specification_version: 4
|
273
273
|
summary: Worker and enqueuer for Q4M using the interface of ActiveJob.
|
274
274
|
test_files:
|
275
275
|
- spec/config/database.yml
|
276
|
-
- spec/db/structure.sql
|
276
|
+
- spec/db/structure.sql
|
277
277
|
- spec/helpers/my_worker.rb
|
278
278
|
- spec/integration_spec.rb
|
279
279
|
- spec/shinq/cli_spec.rb
|
data/.travis.yml
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
sudo: false
|
3
|
-
cache: bundler
|
4
|
-
rvm:
|
5
|
-
- 2.1
|
6
|
-
- 2.2
|
7
|
-
- 2.3
|
8
|
-
- 2.4
|
9
|
-
- 2.6
|
10
|
-
- 2.7
|
11
|
-
gemfile:
|
12
|
-
- Gemfile
|
13
|
-
before_install:
|
14
|
-
- gem update bundler
|
15
|
-
- mysql -e "create database IF NOT EXISTS shinq_test;" -uroot
|
16
|
-
script: bundle exec rspec
|