shinq 1.0.1 → 1.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: aecce95cddb0d008c214ae89763a3747ab98db0f
4
- data.tar.gz: 32a2e126b9b45e25c452fcaecdcb9542a9ac2ea1
2
+ SHA256:
3
+ metadata.gz: f4ead10d8b4695ee2caa3163fe46c858a3aa39b91c9b4259513103f8eb69f071
4
+ data.tar.gz: e05ed573b31c277ed87045cba29c847cd500ca2f4953e3aba062b583ce9caee4
5
5
  SHA512:
6
- metadata.gz: d88808963ddc7099bc8cce9cccacf71a9455949b3e2b06a069e093b0e0df86210f5f4782679974edb16b68f5740c1c4a2747fdf068cb7f7a639d4e5cbae332c2
7
- data.tar.gz: 794108886e577c20625e9e9fc07edaef5f15ed9c29140713ffeea5ba784e97fd6ce81d1286561adfa61fc8c376dde8b3408d64cc50e1c6efd81920586facd762
6
+ metadata.gz: 559ffb5cd25d1afee723c5d508cb2c1c83cc7cc37c4716b293d10570fc1aef9a64e6ad12ca953a650cf1adbf6b66fc2fcb2afaa90aeb85a51c7bef98c63a1978
7
+ data.tar.gz: 701093a1975e29e0030d5512242da512ace75bf38d0db16f6d3d41ed24f2f39484de18f28528cd6bf7c54ec5297dbf3484259d87064804a27bb91410b9fb9a6d
@@ -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
- [![Build Status](https://travis-ci.org/ryopeko/shinq.svg)](https://travis-ci.org/ryopeko/shinq)
2
+
3
+ [![CI](https://github.com/ryopeko/shinq/workflows/test/badge.svg?event=push)](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.1'
7
+ spec.version = '1.1.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.}
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
17
  spec.require_paths = ["lib"]
18
18
 
19
- spec.add_development_dependency "bundler", "~> 1.7"
19
+ spec.add_development_dependency "bundler"
20
20
  spec.add_development_dependency "rake", "~> 10.0"
21
21
  spec.add_development_dependency "pry"
22
22
  spec.add_development_dependency "tapp"
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency "simplecov"
26
26
  spec.add_development_dependency "timecop"
27
27
 
28
- spec.add_dependency "mysql2", ">= 0.3.16", "< 0.5"
28
+ spec.add_dependency "mysql2", ">= 0.3.16", "< 0.6"
29
29
  spec.add_dependency "sql-maker", "~> 0.0.4"
30
30
  spec.add_dependency "activesupport", ">= 4.2.0", "< 6"
31
31
  spec.add_dependency "activejob", ">= 4.2.0", "< 6"
@@ -1,5 +1,6 @@
1
1
  test:
2
2
  encoding: utf8
3
3
  username: root
4
- host: localhost
4
+ host: 127.0.0.1
5
+ port: 3306
5
6
  database: shinq_test
@@ -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=<%= 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=<%= engine %>;
18
+ ) ENGINE=QUEUE;
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
  require 'shinq'
3
3
  require 'shinq/client'
4
4
 
5
- describe "Integration", skip: ENV['TRAVIS'] do
5
+ describe "Integration" do
6
6
 
7
7
  before do
8
8
  Shinq.configuration = {
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__)).symbolize_keys
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
- # MySQL on Travis does not have Q4M plugins.
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
- connection = Mysql2::Client.new(load_database_config[:test].merge(flags: Mysql2::Client::MULTI_STATEMENTS))
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,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shinq
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.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: 2018-12-07 00:00:00.000000000 Z
11
+ date: 2022-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.7'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.7'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -131,7 +131,7 @@ dependencies:
131
131
  version: 0.3.16
132
132
  - - "<"
133
133
  - !ruby/object:Gem::Version
134
- version: '0.5'
134
+ version: '0.6'
135
135
  type: :runtime
136
136
  prerelease: false
137
137
  version_requirements: !ruby/object:Gem::Requirement
@@ -141,7 +141,7 @@ dependencies:
141
141
  version: 0.3.16
142
142
  - - "<"
143
143
  - !ruby/object:Gem::Version
144
- version: '0.5'
144
+ version: '0.6'
145
145
  - !ruby/object:Gem::Dependency
146
146
  name: sql-maker
147
147
  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.erb
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,14 +267,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
267
267
  - !ruby/object:Gem::Version
268
268
  version: '0'
269
269
  requirements: []
270
- rubyforge_project:
271
- rubygems_version: 2.6.8
270
+ rubygems_version: 3.2.0
272
271
  signing_key:
273
272
  specification_version: 4
274
273
  summary: Worker and enqueuer for Q4M using the interface of ActiveJob.
275
274
  test_files:
276
275
  - spec/config/database.yml
277
- - spec/db/structure.sql.erb
276
+ - spec/db/structure.sql
278
277
  - spec/helpers/my_worker.rb
279
278
  - spec/integration_spec.rb
280
279
  - spec/shinq/cli_spec.rb
data/.travis.yml DELETED
@@ -1,17 +0,0 @@
1
- language: ruby
2
- sudo: false
3
- cache: bundler
4
- rvm:
5
- - 2.1
6
- - 2.2.0
7
- - 2.2.1
8
- - 2.2.2
9
- - 2.2.7
10
- - 2.3.4
11
- - 2.4.1
12
- gemfile:
13
- - Gemfile
14
- before_install:
15
- - gem update bundler
16
- - mysql -e "create database IF NOT EXISTS shinq_test;" -uroot
17
- script: bundle exec rspec