spring_onion 0.2.5 → 1.0.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: b40885dd3b876b902fa6670cde6f312362239a5d65da300297f9240cee05afbc
4
- data.tar.gz: 3193d9ab4417169c380bb9fe1bf788752b4f347d9c0bdb34b5237a9f5e2c674f
3
+ metadata.gz: d3d2f2a889573516f94fa1f5fb4a3276a26c31de830a9dabc56785e35c715c57
4
+ data.tar.gz: de4ca5c79ffdf0455552f54fb95d0316cf5eb075bb281c975e1db3bd0d6a3655
5
5
  SHA512:
6
- metadata.gz: e1f37308e5b4dbc00112b4cc7e12a1060fe4c39a8dbb379bb5d10bf3c689151d590095a39e4f732c236993f19efccd8b624bd5baf7f162c3422646f49a377728
7
- data.tar.gz: 73aafec72dad64c8e54daa129dd65bbd419f7dc013b94da830228825211a2e3693627185c5e9f50f02b4217f24a244feec7a324a14267c32f0e063c7149febb2
6
+ metadata.gz: 247a3d06f4f82854f0fa3a395a5f5ba224362772c3f3c40273029009db5f10babaf5a70de589d1ce08b2c242ec4d1072ab038d0dfb92196262c2527094f879ea
7
+ data.tar.gz: 6754099ea2ffb1d6ce713d665954dfb7ebce6f74a51141f85006ff06e4b0bc32083ea155e2c116d22a59552a97d69efa62655935f79337d5736e1883fb448c8d
data/.rspec CHANGED
@@ -1,3 +1,2 @@
1
- --format documentation
2
1
  --color
3
2
  --require spec_helper
@@ -4,6 +4,8 @@ AllCops:
4
4
  TargetRubyVersion: 2.5
5
5
  Style/Documentation:
6
6
  Enabled: false
7
+ Style/TrailingCommaInArrayLiteral:
8
+ EnforcedStyleForMultiline: consistent_comma
7
9
  Style/TrailingCommaInHashLiteral:
8
10
  EnforcedStyleForMultiline: consistent_comma
9
11
  Metrics/AbcSize:
@@ -12,6 +14,8 @@ Metrics/CyclomaticComplexity:
12
14
  Enabled: false
13
15
  Metrics/MethodLength:
14
16
  Enabled: false
17
+ Metrics/BlockLength:
18
+ Enabled: false
15
19
  Layout/LineLength:
16
20
  Enabled: false
17
21
 
@@ -2,5 +2,21 @@
2
2
  language: ruby
3
3
  cache: bundler
4
4
  rvm:
5
+ - 2.5.8
5
6
  - 2.6.6
6
- before_install: gem install bundler -v 2.1.2
7
+ - 2.7.1
8
+ gemfile:
9
+ - gemfiles/ar52.gemfile
10
+ - gemfiles/ar60.gemfile
11
+ services:
12
+ - mysql
13
+ env:
14
+ - DATABASE_URL=mysql2://travis@localhost/sakila
15
+ before_install:
16
+ - gem install bundler -v 2.1.2
17
+ - curl -sSfL https://downloads.mysql.com/docs/sakila-db.tar.gz -o - | tar zxf -
18
+ - cd sakila-db
19
+ - mysql < sakila-schema.sql
20
+ - mysql < sakila-data.sql
21
+ script:
22
+ - bundle exec rake
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ appraise 'ar52' do
4
+ gem 'activerecord', '~> 5.2.1'
5
+ end
6
+
7
+ appraise 'ar60' do
8
+ gem 'activerecord', '~> 5.2.1'
9
+ end
@@ -0,0 +1,14 @@
1
+ FROM rubylang/ruby:2.5-bionic
2
+
3
+ RUN apt-get update && \
4
+ apt-get install -y \
5
+ mysql-client \
6
+ libmysqlclient-dev \
7
+ rubygems \
8
+ curl
9
+
10
+ COPY ./ /mnt/
11
+ WORKDIR /mnt
12
+ RUN gem update bundler -f && \
13
+ bundle install && \
14
+ bundle exec appraisal install
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spring_onion (0.2.5)
4
+ spring_onion (1.0.0)
5
5
  activerecord
6
6
  coderay
7
7
  mysql2
@@ -83,4 +83,4 @@ DEPENDENCIES
83
83
  spring_onion!
84
84
 
85
85
  BUNDLED WITH
86
- 2.1.2
86
+ 2.1.4
data/README.md CHANGED
@@ -1,8 +1,11 @@
1
1
  # SpringOnion
2
2
 
3
3
  Log MySQL queries with EXPLAIN that may be slow.
4
+
4
5
  Inspired by [MySQLCasualLog.pm](https://gist.github.com/kamipo/839e8a5b6d12bddba539).
5
6
 
7
+ [![Build Status](https://travis-ci.org/winebarrel/spring_onion.svg?branch=master)](https://travis-ci.org/winebarrel/spring_onion)
8
+
6
9
  ## Installation
7
10
 
8
11
  Add this line to your application's Gemfile:
@@ -75,3 +78,10 @@ p Employee.all.to_a.count
75
78
  ]
76
79
  }
77
80
  ```
81
+
82
+ ## Test
83
+
84
+ ```sh
85
+ docker-compose build
86
+ docker-compose run client bundle exec appraisal ar60 rake
87
+ ```
data/Rakefile CHANGED
@@ -2,7 +2,12 @@
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)
7
8
 
8
- task default: :spec
9
+ RuboCop::RakeTask.new do |task|
10
+ task.options = %w[-c .rubocop.yml]
11
+ end
12
+
13
+ task default: %i[rubocop spec]
@@ -0,0 +1,15 @@
1
+ version: "3.8"
2
+ services:
3
+ client:
4
+ build: .
5
+ environment:
6
+ MYSQL_PING_ATTEMPTS: "10"
7
+ DATABASE_URL: mysql2://root@db/sakila
8
+ volumes:
9
+ - ./:/mnt
10
+ depends_on:
11
+ - db
12
+ db:
13
+ image: budougumi0617/mysql-sakila:5.7
14
+ environment:
15
+ MYSQL_ALLOW_EMPTY_PASSWORD: "1"
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rake", "~> 12.0"
6
+ gem "rspec", "~> 3.0"
7
+ gem "activerecord", "~> 5.2.1"
8
+
9
+ gemspec path: "../"
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rake", "~> 12.0"
6
+ gem "rspec", "~> 3.0"
7
+ gem "activerecord", "~> 5.2.1"
8
+
9
+ gemspec path: "../"
@@ -24,6 +24,8 @@ module SpringOnion
24
24
  _validate_explain(sql: sql, exp: exp, trace: trace)
25
25
  end
26
26
  end
27
+ rescue SpringOnion::Error
28
+ raise
27
29
  rescue StandardError => e
28
30
  SpringOnion.logger.error(e)
29
31
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SpringOnion
4
- VERSION = '0.2.5'
4
+ VERSION = '1.0.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spring_onion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - winebarrel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-18 00:00:00.000000000 Z
11
+ date: 2020-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -133,11 +133,16 @@ files:
133
133
  - ".rspec"
134
134
  - ".rubocop.yml"
135
135
  - ".travis.yml"
136
+ - Appraisals
137
+ - Dockerfile
136
138
  - Gemfile
137
139
  - Gemfile.lock
138
140
  - LICENSE.txt
139
141
  - README.md
140
142
  - Rakefile
143
+ - docker-compose.yml
144
+ - gemfiles/ar52.gemfile
145
+ - gemfiles/ar60.gemfile
141
146
  - lib/spring_onion.rb
142
147
  - lib/spring_onion/config.rb
143
148
  - lib/spring_onion/error.rb