Skip to content

Commit

Permalink
Merge remote-tracking branch 'brianmario/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
manlon committed Jan 29, 2018
2 parents 64db783 + b2cfca1 commit c505ea5
Show file tree
Hide file tree
Showing 51 changed files with 1,715 additions and 1,278 deletions.
30 changes: 15 additions & 15 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
inherit_from: .rubocop_todo.yml

AllCops:
TargetRubyVersion: 2.0

DisplayCopNames: true
Exclude:
- 'pkg/**/*'
- 'tmp/**/*'
- 'vendor/**/*'

Lint/EndAlignment:
AlignWith: variable

Style/CaseIndentation:
IndentWhenRelativeTo: end
Layout/CaseIndentation:
EnforcedStyle: end

Style/IndentHash:
Layout/IndentHash:
EnforcedStyle: consistent

Style/TrailingComma:
EnforcedStyleForMultiline: consistent_comma
Layout/IndentHeredoc:
EnforcedStyle: powerpack

Style/TrivialAccessors:
AllowPredicates: true
Lint/EndAlignment:
EnforcedStyleAlignWith: variable

# TODO: remove when we end support for < 1.9.3
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: consistent_comma

Style/HashSyntax:
EnforcedStyle: hash_rockets
Style/TrailingCommaInLiteral:
EnforcedStyleForMultiline: consistent_comma

Style/Lambda:
Enabled: false
Style/TrivialAccessors:
AllowPredicates: true
53 changes: 32 additions & 21 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,86 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2015-09-06 13:16:09 -0400 using RuboCop version 0.34.0.
# on 2017-11-25 19:54:28 -0500 using RuboCop version 0.50.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 2
Metrics/AbcSize:
Max: 85
Max: 90

# Offense count: 31
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/BlockLength:
Max: 825

# Offense count: 1
# Configuration parameters: CountBlocks.
Metrics/BlockNesting:
Max: 5

# Offense count: 1
# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 125

# Offense count: 2
# Offense count: 3
Metrics/CyclomaticComplexity:
Max: 30

# Offense count: 290
# Configuration parameters: AllowURI, URISchemes.
# Offense count: 313
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 232

# Offense count: 5
# Offense count: 6
# Configuration parameters: CountComments.
Metrics/MethodLength:
Max: 60
Max: 57

# Offense count: 1
# Offense count: 2
Metrics/PerceivedComplexity:
Max: 26
Max: 27

# Offense count: 40
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods.
Style/BlockDelimiters:
Enabled: false
# Offense count: 3
# Configuration parameters: Blacklist.
# Blacklist: END, (?-mix:EO[A-Z]{1})
Naming/HeredocDelimiterNaming:
Exclude:
- 'tasks/compile.rake'

# Offense count: 12
# Offense count: 10
Style/Documentation:
Exclude:
- 'spec/**/*'
- 'test/**/*'
- 'benchmark/active_record.rb'
- 'benchmark/allocations.rb'
- 'benchmark/query_with_mysql_casting.rb'
- 'lib/mysql2.rb'
- 'lib/mysql2/client.rb'
- 'lib/mysql2/em.rb'
- 'lib/mysql2/error.rb'
- 'lib/mysql2/field.rb'
- 'lib/mysql2/result.rb'
- 'lib/mysql2/statement.rb'
- 'lib/mysql2/version.rb'

# Offense count: 9
# Offense count: 14
# Configuration parameters: AllowedVariables.
Style/GlobalVars:
Exclude:
- 'ext/mysql2/extconf.rb'

# Offense count: 14
# Offense count: 17
# Cop supports --auto-correct.
# Configuration parameters: Strict.
Style/NumericLiterals:
MinDigits: 20

# Offense count: 680
# Offense count: 726
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Enabled: false
62 changes: 17 additions & 45 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ bundler_args: --without benchmarks development
# Pin Rubygems to a working version. Sometimes it breaks upstream. Update now and then.
before_install:
- gem --version
- gem update --system 2.6.7
- gem update --system 2.7.3
- gem update bundler
- gem --version
- bash .travis_setup.sh
Expand All @@ -18,85 +18,57 @@ addons:
- mysql-client-core-5.6
- mysql-client-5.6
rvm:
- 2.5
- 2.4
- 2.3
- 2.2
- 2.1
- 2.0.0
- 1.9.3
- ruby-head
matrix:
include:
- rvm: 1.8.7
dist: precise
env: SPEC_OPTS="--order rand:11"
addons:
hosts:
- mysql2gem.example.com
apt:
packages:
- mysql-server-5.5
- mysql-client-core-5.5
- mysql-client-5.5
- rvm: ree
dist: precise
env: SPEC_OPTS="--order rand:11"
addons:
hosts:
- mysql2gem.example.com
apt:
packages:
- mysql-server-5.5
- mysql-client-core-5.5
- mysql-client-5.5
- rvm: 2.0.0
env: DB=mariadb55
addons:
mariadb: 5.5
hosts:
- mysql2gem.example.com
- rvm: 2.0.0
- rvm: 2.4
env: DB=mariadb10.0
addons:
mariadb: 10.0
hosts:
- mysql2gem.example.com
- rvm: 2.0.0
- rvm: 2.4
env: DB=mariadb10.1
addons:
mariadb: 10.1
hosts:
- mysql2gem.example.com
- rvm: 2.0.0
- rvm: 2.4
env: DB=mariadb10.2
addons:
mariadb: 10.2
hosts:
- mysql2gem.example.com
- rvm: 2.4
env: DB=mysql55
dist: precise
addons:
hosts:
- mysql2gem.example.com
apt:
packages:
- mysql-server-5.5
- mysql-client-core-5.5
- mysql-client-5.5
- rvm: 2.0.0
- rvm: 2.4
env: DB=mysql57
addons:
hosts:
- mysql2gem.example.com
- rvm: 2.0.0
- rvm: 2.4
env: DB=mysql80
addons:
hosts:
- mysql2gem.example.com
- rvm: 2.0.0
- os: osx
rvm: 2.4
env: DB=mysql56
os: osx
addons:
hosts:
- mysql2gem.example.com
fast_finish: true
allow_failures:
- rvm: ruby-head
- rvm: 2.0.0
- os: osx
rvm: 2.4
env: DB=mysql56
os: osx
8 changes: 8 additions & 0 deletions .travis_mysql55.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -eux

apt-get purge -qq '^mysql*' '^libmysql*'
rm -fr /etc/mysql
rm -fr /var/lib/mysql
apt-get install -qq mysql-server-5.5 mysql-client-core-5.5 mysql-client-5.5 libmysqlclient-dev
2 changes: 1 addition & 1 deletion .travis_mysql57.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -eux
apt-get purge -qq '^mysql*' '^libmysql*'
rm -fr /etc/mysql
rm -fr /var/lib/mysql
apt-key adv --keyserver pgp.mit.edu --recv-keys 5072E1F5
apt-key add - < support/5072E1F5.asc
add-apt-repository 'deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7'
apt-get update -qq
apt-get install -qq mysql-server libmysqlclient-dev
Expand Down
2 changes: 1 addition & 1 deletion .travis_mysql80.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -eux
apt-get purge -qq '^mysql*' '^libmysql*'
rm -fr /etc/mysql
rm -fr /var/lib/mysql
apt-key adv --keyserver pgp.mit.edu --recv-keys 5072E1F5
apt-key add - < support/5072E1F5.asc
add-apt-repository 'deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-8.0'
apt-get update -qq
apt-get install -qq mysql-server libmysqlclient-dev
Expand Down
23 changes: 22 additions & 1 deletion .travis_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

set -eux

# Install MySQL 5.5 if DB=mysql55
if [[ -n ${DB-} && x$DB =~ ^xmysql55 ]]; then
sudo bash .travis_mysql55.sh
fi

# Install MySQL 5.7 if DB=mysql57
if [[ -n ${DB-} && x$DB =~ ^xmysql57 ]]; then
sudo bash .travis_mysql57.sh
Expand All @@ -12,10 +17,26 @@ if [[ -n ${DB-} && x$DB =~ ^xmysql80 ]]; then
sudo bash .travis_mysql80.sh
fi

# Install MariaDB client headers after Travis CI fix for MariaDB 10.2 broke earlier 10.x
if [[ -n ${DB-} && x$DB =~ ^xmariadb10.0 ]]; then
sudo apt-get install -y -o Dpkg::Options::='--force-confnew' libmariadbclient-dev
fi

# Install MariaDB client headers after Travis CI fix for MariaDB 10.2 broke earlier 10.x
if [[ -n ${DB-} && x$DB =~ ^xmariadb10.1 ]]; then
sudo apt-get install -y -o Dpkg::Options::='--force-confnew' libmariadbclient-dev
fi

# Install MariaDB 10.2 if DB=mariadb10.2
# NOTE this is a workaround until Travis CI merges a fix to its mariadb addon.
if [[ -n ${DB-} && x$DB =~ ^xmariadb10.2 ]]; then
sudo apt-get install -y -o Dpkg::Options::='--force-confnew' mariadb-server mariadb-server-10.2 libmariadbclient18
fi

# Install MySQL if OS=darwin
if [[ x$OSTYPE =~ ^xdarwin ]]; then
brew update
brew install "$DB"
brew install "$DB" mariadb-connector-c
$(brew --prefix "$DB")/bin/mysql.server start
fi

Expand Down
7 changes: 4 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ source 'https://rubygems.org'
gemspec

gem 'rake', '~> 10.4.2'
gem 'rake-compiler', '~> 0.9.5'
gem 'rake-compiler', '~> 1.0'

group :test do
gem 'eventmachine' unless RUBY_PLATFORM =~ /mswin|mingw/
gem 'rspec', '~> 3.2'
gem 'rubocop', '~> 0.34.0' unless RUBY_VERSION =~ /1.8/
# https://github.com/bbatsov/rubocop/pull/4789
gem 'rubocop', '~> 0.50.0'
end

group :benchmarks do
Expand All @@ -22,7 +23,7 @@ end

group :development do
gem 'pry'
gem 'rake-compiler-dock', '~> 0.5.1'
gem 'rake-compiler-dock', '~> 0.6.0'
end

platforms :rbx do
Expand Down
Loading

0 comments on commit c505ea5

Please sign in to comment.