Skip to content

Commit

Permalink
Merge pull request #1 from alfa-jpn/features/ci
Browse files Browse the repository at this point in the history
Add CI settings.
  • Loading branch information
alfa-jpn committed Jan 15, 2019
2 parents cd4e3d3 + 4fe0163 commit 0bce503
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 7 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
sudo: false
language: ruby
script: ./bin/test
cache: bundler
rvm:
- 2.5.0
- 2.6.0
before_install:
- gem install bundler
env:
- TEST_DB_HOST='127.0.0.1' TEST_DB_USER='root' TEST_DB_PASS=''
services:
- mysql
22 changes: 22 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright (c) 2019 alfa-jpn

MIT License

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Mysql2::Aurora
mysql2 plugin supporting aurora failover.

[![Build Status](https://travis-ci.org/alfa-jpn/mysql2-aurora.svg?branch=master)](https://travis-ci.org/alfa-jpn/mysql2-aurora)
[![Coverage Status](https://coveralls.io/repos/github/alfa-jpn/mysql2-aurora/badge.svg?branch=master)](https://coveralls.io/github/alfa-jpn/mysql2-aurora?branch=master)
[![Maintainability](https://api.codeclimate.com/v1/badges/57d8ee7b6f30d413314b/maintainability)](https://codeclimate.com/github/alfa-jpn/mysql2-aurora/maintainability)

## Installation

Add this line to your application's Gemfile:
Expand Down
4 changes: 2 additions & 2 deletions lib/mysql2/aurora.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Client
attr_reader :client

# Initialize class
# @override with reconnect options
# @note [Override] with reconnect options
# @param [Hash] opts Options
# @option opts [Integer] aurora_max_retry Max retry count, when failover. (Default: 5)
def initialize(opts)
Expand All @@ -22,7 +22,7 @@ def initialize(opts)
end

# Execute query with reconnect
# @override with reconnect.
# @note [Override] with reconnect.
def query(*args)
try_count = 0

Expand Down
2 changes: 1 addition & 1 deletion mysql2-aurora.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Gem::Specification.new do |spec|

spec.add_dependency 'mysql2', '~> 0.5.2'

spec.add_development_dependency 'bundler', '~> 1.17'
spec.add_development_dependency 'bundler', '>= 1.16'
spec.add_development_dependency 'coveralls', '~> 0.8'
spec.add_development_dependency 'pry', '~> 0.12'
spec.add_development_dependency 'rake', '~> 10.0'
Expand Down
3 changes: 2 additions & 1 deletion spec/mysql2/aurora_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@

it 'Return result' do
expect(subject).to be_instance_of(Mysql2::Result)
expect(subject.to_a).to eq([{ 'user' => 'root@%' }])
expect(subject.to_a.size).to eq(1)
expect(subject.to_a.first['user']).to match(/^root@.+$/)
end

it 'Call original query' do
Expand Down

0 comments on commit 0bce503

Please sign in to comment.