Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into issue/1102
Browse files Browse the repository at this point in the history
  • Loading branch information
StefSchenkelaars committed Jun 10, 2019
2 parents 7021cb4 + c47e6db commit cceb712
Show file tree
Hide file tree
Showing 55 changed files with 3,299 additions and 738 deletions.
28 changes: 23 additions & 5 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
require: rubocop-rails
AllCops:
TargetRubyVersion: 2.4
Layout/AlignArguments:
EnforcedStyle: with_fixed_indentation
Layout/AlignParameters:
EnforcedStyle: with_fixed_indentation
Layout/CommentIndentation:
Enabled: false
Layout/ConditionPosition:
Enabled: false
Layout/DotPosition:
EnforcedStyle: trailing
Layout/EmptyLineBetweenDefs:
AllowAdjacentOneLineDefs: true
Layout/IndentHeredoc:
Enabled: false
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/SpaceInLambdaLiteral:
EnforcedStyle: require_space
Lint/AmbiguousOperator:
Enabled: false
Lint/AmbiguousRegexpLiteral:
Expand All @@ -18,9 +29,9 @@ Lint/DeprecatedClassMethods:
Enabled: false
Lint/ElseLayout:
Enabled: false
Lint/HandleExceptions:
Lint/FlipFlop:
Enabled: false
Lint/IndentHeredoc:
Lint/HandleExceptions:
Enabled: false
Lint/LiteralInInterpolation:
Enabled: false
Expand All @@ -34,22 +45,28 @@ Lint/UnderscorePrefixedVariableName:
Enabled: false
Lint/Void:
Enabled: false
Metrics/AbcSize:
Max: 25
Metrics/BlockLength:
Enabled: false
Metrics/ClassLength:
Enabled: false
Metrics/LineLength:
IgnoredPatterns:
- "^[ ]*#.+$"
- "^[ ]*describe.+$"
- "^[ ]*context.+$"
- "^[ ]*shared_context.+$"
- "^[ ]*shared_examples_for.+$"
- "^[ ]*it.+$"
- "^[ ]*'.+?' => '.+?',?$"
- "^[ ]*\".+?\" => \".+?\",?$"
- "^[ ]*.+?: .+?$"
Metrics/MethodLength:
Max: 30
Metrics/ParameterLists:
CountKeywordArgs: false
Metrics/PerceivedComplexity:
Max: 10
Naming/AccessorMethodName:
Enabled: false
Naming/AsciiIdentifiers:
Expand All @@ -60,6 +77,8 @@ Naming/MemoizedInstanceVariableName:
EnforcedStyleForLeadingUnderscores: required
Naming/PredicateName:
Enabled: false
Style/BlockDelimiters:
Enabled: false
Style/ClassVars:
Enabled: false
Style/ColonMethodCall:
Expand Down Expand Up @@ -87,6 +106,7 @@ Style/CharacterLiteral:
Style/ClassAndModuleChildren:
Enabled: false
Style/CollectionMethods:
Enabled: true
PreferredMethods:
find: detect
reduce: inject
Expand All @@ -106,8 +126,6 @@ Style/Encoding:
Enabled: false
Style/EvenOdd:
Enabled: false
Style/FlipFlop:
Enabled: false
Style/FormatString:
Enabled: false
Style/FrozenStringLiteralComment:
Expand Down
25 changes: 18 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
language: ruby
sudo: false
addons:
postgresql: "10"
apt:
packages:
- postgresql-10
- postgresql-client-10
env:
- DATABASE_ADAPTER=sqlite3
- DATABASE_ADAPTER=postgresql
global:
- PGPORT=5433
matrix:
- DATABASE_ADAPTER=sqlite3
- DATABASE_ADAPTER=postgresql
rvm:
- 2.4.4
- 2.5.4
- 2.6.2
- 2.4.6
- 2.5.5
- 2.6.3
gemfile:
- gemfiles/rails_4_2.gemfile
- gemfiles/rails_5_0.gemfile
- gemfiles/rails_5_1.gemfile
- gemfiles/rails_5_2.gemfile
- gemfiles/rails_6_0.gemfile
matrix:
exclude:
- rvm: 2.6.2
- rvm: 2.4.6
gemfile: gemfiles/rails_6_0.gemfile
- rvm: 2.6.3
gemfile: gemfiles/rails_4_2.gemfile
cache: bundler
# Source: <https://docs.travis-ci.com/user/languages/ruby/#bundler-20>
Expand Down
40 changes: 36 additions & 4 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ shared_jruby_dependencies = proc do
end

shared_rails_dependencies = proc do
gem 'sqlite3', platform: :ruby
gem 'pg', platform: :ruby
gem 'sqlite3', '~> 1.3.6', platform: :ruby
end

shared_spring_dependencies = proc do
Expand All @@ -23,7 +22,6 @@ end

shared_test_dependencies = proc do
gem 'minitest-reporters'
# gem 'nokogiri', '~> 1.8'
gem 'rspec-rails', '~> 3.6'
gem 'shoulda-context', '~> 1.2.0'
end
Expand All @@ -48,10 +46,11 @@ appraise 'rails_4_2' do
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'bcrypt', '~> 3.1.7'

# Other dependencies we use
# Other dependencies
gem 'activeresource', '4.0.0'
gem 'json', '~> 1.4'
gem 'protected_attributes', '~> 1.0.6'
gem 'pg', '~> 0.15', platform: :ruby
end

appraise 'rails_5_0' do
Expand All @@ -67,6 +66,9 @@ appraise 'rails_5_0' do
gem 'bcrypt', '~> 3.1.7'
gem 'listen', '~> 3.0.5'
gem 'spring-watcher-listen', '~> 2.0.0'

# Other dependencies
gem 'pg', '~> 1.1', platform: :ruby
end

appraise 'rails_5_1' do
Expand All @@ -83,6 +85,9 @@ appraise 'rails_5_1' do
gem 'selenium-webdriver'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'spring-watcher-listen', '~> 2.0.0'

# Other dependencies
gem 'pg', '~> 1.1', platform: :ruby
end

appraise 'rails_5_2' do
Expand All @@ -101,4 +106,31 @@ appraise 'rails_5_2' do
gem 'chromedriver-helper'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'spring-watcher-listen', '~> 2.0.0'

# Other dependencies
gem 'pg', '~> 1.1', platform: :ruby
end

if Gem::Requirement.new('>= 2.5.0').satisfied_by?(Gem::Version.new(RUBY_VERSION))
appraise 'rails_6_0' do
instance_eval(&shared_dependencies)

gem 'rails', '~> 6.0.0.beta3'
gem 'puma', '~> 3.11'
gem 'bootsnap', '>= 1.4.1', require: false
gem 'sass-rails', '~> 5.0'
gem 'webpacker', '>= 4.0.0.rc3'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'bcrypt', '~> 3.1.7'
gem 'capybara', '>= 2.15'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'spring-watcher-listen', '~> 2.0.0'
gem 'selenium-webdriver'
gem 'chromedriver-helper'

# Other dependencies
gem 'rails-controller-testing', '>= 1.0.1'
gem 'pg', '~> 1.1', platform: :ruby
end
end
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ gem 'pry-byebug'
gem 'rake', '12.3.2'
gem 'rspec', '~> 3.6'
gem 'rubocop', require: false
gem 'rubocop-rails', require: false
gem 'zeus', require: false

# YARD
Expand Down
25 changes: 14 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ GEM
coderay (1.1.2)
diff-lcs (1.3)
fssm (0.2.10)
jaro_winkler (1.5.1)
jaro_winkler (1.5.2)
method_source (0.9.0)
multi_json (1.12.1)
parallel (1.12.1)
parser (2.5.1.2)
parallel (1.17.0)
parser (2.6.3.0)
ast (~> 2.4.0)
powerpack (0.1.2)
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
Expand All @@ -25,6 +24,7 @@ GEM
pry (~> 0.10)
pygments.rb (1.1.1)
multi_json (>= 1.0.0)
rack (2.0.7)
rainbow (3.0.0)
rake (12.3.2)
redcarpet (3.4.0)
Expand All @@ -41,17 +41,19 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.6.0)
rspec-support (3.6.0)
rubocop (0.59.0)
rubocop (0.71.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.5, != 2.5.1.1)
powerpack (~> 0.1)
parser (>= 2.6)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.10.0)
unicode-display_width (>= 1.4.0, < 1.7)
rubocop-rails (2.0.0)
rack (>= 2.0)
rubocop (>= 0.70.0)
ruby-progressbar (1.10.1)
thor (0.20.0)
unicode-display_width (1.4.0)
unicode-display_width (1.6.0)
yard (0.9.12)
zeus (0.15.14)
method_source (>= 0.6.7)
Expand All @@ -70,8 +72,9 @@ DEPENDENCIES
redcarpet
rspec (~> 3.6)
rubocop
rubocop-rails
yard
zeus

BUNDLED WITH
1.16.5
1.17.2
40 changes: 40 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
# 4.1.0

### Bug fixes

* Fix `validate_uniqueness_of` so that it works when a scope is defined as a
string instead of a symbol on the model. ([#1176])
* Fix `have_db_index` so that it can be used against multiple models that are
connected to different databases. ([#1200])

[#1176]: https://github.com/thoughtbot/shoulda-matchers/pull/1176
[#1200]: https://github.com/thoughtbot/shoulda-matchers/pull/1200

### Features

* Add support for Rails 6. No new Rails 6 features are supported, but only
existing features that broke with the upgrade. ([#1193])
* Add support for expression indexes (Rails 5, Postgres only) to
`have_db_index`. ([#1211])
* Add `allow_nil` to the `validate_presence_of` matcher. ([834d8d0], [#1100])

[#1193]: https://github.com/thoughtbot/shoulda-matchers/pull/1193
[#1211]: https://github.com/thoughtbot/shoulda-matchers/pull/1211
[834d8d0]: https://github.com/thoughtbot/shoulda-matchers/commit/834d8d0356573b9f47e63a1b910cfa8f3d815e51
[#1100]: https://github.com/thoughtbot/shoulda-matchers/pull/1100

### Improvements

* Update `validate_presence_of` so that if it is being used against an
association which is `required: true` or `optional: false`, or it is not
configured as such but ActiveRecord defaults `belong_to` associations to
`optional: false`, and the matcher fails, the developer is reminded in the
failure message that the `belong_to` matcher can be used instead. ([#1214],
[8697b01])
* Update `define_enum_for` so that it produces a more helpful message on
failure. ([#1216])

[#1214]: https://github.com/thoughtbot/shoulda-matchers/pull/1214
[8697b01]: https://github.com/thoughtbot/shoulda-matchers/commit/8697b015ed88fdbbbcf5d31bf98670f17c3df9e1
[#1216]: https://github.com/thoughtbot/shoulda-matchers/pull/1216

# 4.0.1

### Bug fixes
Expand Down
Loading

0 comments on commit cceb712

Please sign in to comment.