Skip to content

Commit

Permalink
Fix travis build and update dependencies (#14)
Browse files Browse the repository at this point in the history
* fix and update travis build

* adjust travis.yml

* fix ruby 2.7 warnings

* fix rubygems deploy

* fix coveralls version
  • Loading branch information
tycooon authored Apr 7, 2020
1 parent 2bb4888 commit d80c7c8
Show file tree
Hide file tree
Showing 8 changed files with 163 additions and 15 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@
# rspec failure tracking
.rspec_status

Gemfile.lock

log
40 changes: 34 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,52 @@
language: ruby
matrix:

os: linux
dist: xenial

jobs:
fast_finish: true
include:
- rvm: 2.4
- rvm: 2.5
- rvm: 2.6
- rvm: 2.7
- rvm: ruby-head
allow_failures:
- rvm: ruby-head
sudo: false
cache: bundler

services:
- postgresql

addons:
postgresql: 9.6
before_install: gem install bundler
postgresql: 12
apt:
packages:
- postgresql-12
- postgresql-client-12
- postgresql-server-dev-12
- postgresql-client-common
- postgresql-common

env:
global:
- PGPORT=5433

cache: bundler

before_install:
- gem install bundler
- sudo cp /etc/postgresql/9.6/main/pg_hba.conf /etc/postgresql/12/main/pg_hba.conf
- sudo service postgresql restart 12
- sleep 1

install: bundle install --jobs=3 --retry=3 --path=${BUNDLE_PATH:-vendor/bundle}

before_script:
- psql -c 'create database sequel_plugins;' -U postgres

script:
- bundle exec rspec
- bundle exec rubocop

deploy:
provider: rubygems
api_key:
Expand All @@ -28,3 +55,4 @@ deploy:
on:
repo: umbrellio/umbrellio-sequel-plugins
branch: master
rvm: 2.7
117 changes: 117 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
PATH
remote: .
specs:
umbrellio-sequel-plugins (0.4.0)
sequel
symbiont-ruby (>= 0.6)

GEM
remote: https://rubygems.org/
specs:
activesupport (6.0.2.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2)
ast (2.4.0)
coderay (1.1.2)
concurrent-ruby (1.1.6)
coveralls (0.8.23)
json (>= 1.8, < 3)
simplecov (~> 0.16.1)
term-ansicolor (~> 1.3)
thor (>= 0.19.4, < 2.0)
tins (~> 1.6)
diff-lcs (1.3)
docile (1.3.2)
i18n (1.8.2)
concurrent-ruby (~> 1.0)
jaro_winkler (1.5.4)
json (2.3.0)
method_source (1.0.0)
minitest (5.14.0)
money (6.13.7)
i18n (>= 0.6.4, <= 2)
parallel (1.19.1)
parser (2.7.1.0)
ast (~> 2.4.0)
pg (1.2.3)
pry (0.13.0)
coderay (~> 1.1)
method_source (~> 1.0)
rack (2.2.2)
rainbow (3.0.0)
rake (13.0.1)
rexml (3.2.4)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-core (3.9.1)
rspec-support (~> 3.9.1)
rspec-expectations (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-support (3.9.2)
rubocop (0.81.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.7.0.1)
rainbow (>= 2.2.2, < 4.0)
rexml
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-config-umbrellio (0.81.0.78)
rubocop (= 0.81.0)
rubocop-performance (= 1.5.2)
rubocop-rails (= 2.5.0)
rubocop-rspec (= 1.38.1)
rubocop-performance (1.5.2)
rubocop (>= 0.71.0)
rubocop-rails (2.5.0)
activesupport
rack (>= 1.1)
rubocop (>= 0.72.0)
rubocop-rspec (1.38.1)
rubocop (>= 0.68.1)
ruby-progressbar (1.10.1)
sequel (5.31.0)
simplecov (0.16.1)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
symbiont-ruby (0.6.0)
sync (0.5.0)
term-ansicolor (1.7.1)
tins (~> 1.0)
thor (1.0.1)
thread_safe (0.3.6)
tins (1.24.1)
sync
tzinfo (1.2.7)
thread_safe (~> 0.1)
unicode-display_width (1.7.0)
zeitwerk (2.3.0)

PLATFORMS
ruby

DEPENDENCIES
bundler
coveralls (>= 0.8)
money
pg
pry
rake
rspec
rubocop-config-umbrellio
simplecov
umbrellio-sequel-plugins!

BUNDLED WITH
2.1.4
2 changes: 2 additions & 0 deletions lib/sequel/plugins/money_accessors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

require "money"

Money.rounding_mode = BigDecimal::ROUND_HALF_UP

# Creates accessors for money values
module Sequel::Plugins::MoneyAccessors
MoneyClassRequired = Class.new(StandardError)
Expand Down
2 changes: 1 addition & 1 deletion lib/sequel/plugins/upsert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def upsert(row, **options)
# @see #upsert_dataset
def multi_upsert(rows, **options)
rows = rows.map { |row| sequel_values(row) }
upsert_dataset(options).multi_insert(rows)
upsert_dataset(**options).multi_insert(rows)
end

# Returns formatted row values
Expand Down
8 changes: 4 additions & 4 deletions spec/extensions/currency_rates_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@

RSpec.describe "currency_rates" do
let(:items) do
DB[:items].with_rates(*args).select(Sequel[:price].in_usd.as(:price)).order(:price)
DB[:items].with_rates(**options).select(Sequel[:price].in_usd.as(:price)).order(:price)
end

let(:args) { [] }
let(:options) { Hash[] }

specify do
expect(items.first).to eq(price: 15)
expect(items.last).to eq(price: 26)
end

context "with symbol in time_column param" do
let(:args) { [time_column: :updated_at] }
let(:options) { Hash[time_column: :updated_at] }

specify do
expect(items.first).to eq(price: 15)
Expand All @@ -52,7 +52,7 @@
end

context "with expression in time_column param" do
let(:args) { [time_column: Sequel[:items][:updated_at]] }
let(:options) { Hash[time_column: Sequel[:items][:updated_at]] }

specify do
expect(items.first).to eq(price: 15)
Expand Down
5 changes: 4 additions & 1 deletion spec/plugins/with_lock_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ def locks_count

it "updates the field" do
count_before = locks_count

model.with_lock do
expect(locks_count).to eq(count_before + 1)
expect(locks_count).to eq(count_before + 2)
model.update(count: 1)
end

expect(locks_count).to eq(count_before)
expect(model.count).to eq(1)
end
end
2 changes: 1 addition & 1 deletion umbrellio-sequel-plugins.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency "symbiont-ruby", ">= 0.6"

spec.add_development_dependency "bundler"
spec.add_development_dependency "coveralls"
spec.add_development_dependency "coveralls", ">= 0.8"
spec.add_development_dependency "money"
spec.add_development_dependency "pg"
spec.add_development_dependency "pry"
Expand Down

0 comments on commit d80c7c8

Please sign in to comment.