Skip to content

Commit

Permalink
Feature/5.2.2 (#15)
Browse files Browse the repository at this point in the history
* Update travis, add ruby 2.5

* Fix travis ruby 2.5

* Test pg 1.0 with ActiveRecord 5.2

* Fixes bug #280

* Improve .parse_sql_types

* Remove unnecessary `params.size` if/else
* Add type tests

* Update history

* Version 5.2.1

* Update appraisal

* Fix deprecated mocha require

* Update travis, fix 2.5

* Update cops

* Add frozen_string_literal comments

* Re-generate rubocop todo file

* [style] LineLength

* Use ENV to configure test database connection

Use the same defaults, but allow overriding with any of these:

PGHOST
PGDATABASE
PGPORT
PGUSER
PGPASSWORD

* Remove :nodoc: from test classes

* Improve spatial queries tests

* Ignore multipoint query for PG10 (for now)
* Add helpers to query database version

* Fix task tests for PG 10

* Use #assert_includes for better feedback

* Test with pg gem version 1.x

* Test with PG 10, PostGIS 2.4 on travis

* Version 5.2.2

* prepare for update

* rubocop

* Merge tag 'v5.2.2' into feature/5.2.2

Version 5.2.2

# Conflicts:
#	.rubocop.yml
#	.rubocop_todo.yml
#	.travis.yml
#	Gemfile
#	History.md
#	activerecord-postgis-adapter.gemspec
#	gemfiles/ar51.gemfile
#	gemfiles/ar52.gemfile
#	lib/active_record/connection_adapters/postgis/column_methods.rb
#	lib/active_record/connection_adapters/postgis/create_connection.rb
#	lib/active_record/connection_adapters/postgis/databases.rake
#	lib/active_record/connection_adapters/postgis/oid/spatial.rb
#	lib/active_record/connection_adapters/postgis/postgis_database_tasks.rb
#	lib/active_record/connection_adapters/postgis/railtie.rb
#	lib/active_record/connection_adapters/postgis/schema_statements.rb
#	lib/active_record/connection_adapters/postgis/setup.rb
#	lib/active_record/connection_adapters/postgis/spatial_column.rb
#	lib/active_record/connection_adapters/postgis/spatial_column_info.rb
#	lib/active_record/connection_adapters/postgis/spatial_table_definition.rb
#	lib/active_record/connection_adapters/postgis/version.rb
#	lib/active_record/connection_adapters/postgis_adapter.rb
#	lib/activerecord-postgis-adapter.rb
#	test/database.yml
#	test/setup_test.rb
#	test/spatial_queries_test.rb
#	test/tasks_test.rb
#	test/test_helper.rb
#	test/type_test.rb
  • Loading branch information
stadia authored Feb 25, 2019
1 parent fc79c0b commit e0476f5
Show file tree
Hide file tree
Showing 23 changed files with 274 additions and 304 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.envrc
.ruby-version
doc/
pkg/
Expand Down
126 changes: 64 additions & 62 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,87 +1,93 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2017-12-12 10:59:52 +0900 using RuboCop version 0.51.0.
# on 2019-02-25 13:38:06 +0900 using RuboCop version 0.65.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: 3
# Offense count: 9
# Cop supports --auto-correct.
# Configuration parameters: Include, TreatCommentsAsGroupSeparators.
# Include: **/Gemfile, **/gems.rb
# Configuration parameters: TreatCommentsAsGroupSeparators, Include.
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
Bundler/OrderedGems:
Exclude:
- 'Gemfile'
- 'gemfiles/ar51.gemfile'
- 'gemfiles/ar52.gemfile'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: Include, TreatCommentsAsGroupSeparators.
# Configuration parameters: TreatCommentsAsGroupSeparators, Include.
# Include: **/*.gemspec
Gemspec/OrderedDependencies:
Exclude:
- 'activerecord-mysql2rgeo-adapter.gemspec'

# Offense count: 12
# Offense count: 1
# Configuration parameters: Include.
# Include: **/*.gemspec
Gemspec/RequiredRubyVersion:
Exclude:
- 'activerecord-mysql2rgeo-adapter.gemspec'

# Offense count: 8
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
Layout/ExtraSpacing:
Exclude:
- 'lib/active_record/connection_adapters/mysql2rgeo/arel_tosql.rb'
- 'lib/active_record/connection_adapters/mysql2rgeo/spatial_table_definition.rb'
- 'test/basic_test.rb'
- 'test/ddl_test.rb'
- 'test/nested_class_test.rb'
- 'test/spatial_queries_test.rb'
- 'test/tasks_test.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleAlignWith, SupportedStylesAlignWith, AutoCorrect.
# SupportedStylesAlignWith: keyword, variable, start_of_line
Lint/EndAlignment:
# Configuration parameters: EnforcedStyle.
# SupportedStyles: symmetrical, new_line, same_line
Layout/MultilineMethodCallBraceLayout:
Exclude:
- 'lib/active_record/connection_adapters/mysql2rgeo/arel_tosql.rb'
- 'test/basic_test.rb'

# Offense count: 5
Lint/HandleExceptions:
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: final_newline, final_blank_line
Layout/TrailingBlankLines:
Exclude:
- 'test/spatial_types_test.rb'
- 'test/tasks_test.rb'
- 'test/test_helper.rb'
- 'lib/active_record/connection_adapters/mysql2rgeo/version.rb'

# Offense count: 3
Style/RescueStandardError:
Lint/HandleExceptions:
Exclude:
- 'lib/active_record/type/spatial.rb'
- 'test/tasks_test.rb'
- 'test/test_helper.rb'

# Offense count: 2
# Offense count: 1
Lint/UselessAssignment:
Exclude:
- 'lib/active_record/connection_adapters/mysql2rgeo/schema_statements.rb'
- 'lib/active_record/connection_adapters/mysql2rgeo/spatial_table_definition.rb'

# Offense count: 31
# Offense count: 27
Metrics/AbcSize:
Max: 54

# Offense count: 3
# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 244
Max: 252

# Offense count: 3
# Offense count: 1
Metrics/CyclomaticComplexity:
Max: 12

# Offense count: 72
# Offense count: 4
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 176
Max: 150

# Offense count: 24
# Configuration parameters: CountComments.
# Offense count: 22
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/MethodLength:
Max: 29

Expand All @@ -90,7 +96,7 @@ Metrics/MethodLength:
Metrics/ParameterLists:
Max: 8

# Offense count: 4
# Offense count: 2
Metrics/PerceivedComplexity:
Max: 12

Expand All @@ -99,11 +105,6 @@ Naming/AccessorMethodName:
Exclude:
- 'lib/active_record/connection_adapters/mysql2rgeo/spatial_column.rb'

# Offense count: 1
Naming/ConstantName:
Exclude:
- 'lib/active_record/connection_adapters/mysql2rgeo/arel_tosql.rb'

# Offense count: 1
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
Expand All @@ -112,7 +113,7 @@ Naming/FileName:
- 'lib/activerecord-mysql2rgeo-adapter.rb'

# Offense count: 2
# Configuration parameters: SupportedStyles.
# Configuration parameters: .
# SupportedStyles: snake_case, camelCase
Naming/MethodName:
EnforcedStyle: snake_case
Expand All @@ -129,25 +130,20 @@ Naming/PredicateName:
- 'lib/active_record/connection_adapters/mysql2rgeo/spatial_column.rb'

# Offense count: 1
Security/Eval:
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: io, id, to, by, on, in, at, ip, db
Naming/UncommunicativeMethodParamName:
Exclude:
- 'test/spatial_types_test.rb'
- 'lib/active_record/connection_adapters/mysql2rgeo/schema_statements.rb'

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: prefer_alias, prefer_alias_method
Style/Alias:
Exclude:
- 'lib/active_record/connection_adapters/mysql2rgeo/spatial_column.rb'

# Offense count: 1
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: nested, compact
Style/ClassAndModuleChildren:
Exclude:
- 'test/test_helper.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: Keywords.
Expand All @@ -167,18 +163,25 @@ Style/Documentation:
- 'lib/active_record/connection_adapters/mysql2rgeo/spatial_table_definition.rb'
- 'lib/active_record/connection_adapters/mysql2rgeo_adapter.rb'

# Offense count: 16
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: when_needed, always, never
Style/FrozenStringLiteralComment:
Enabled: false

# Offense count: 2
# Configuration parameters: MinBodyLength.
Style/GuardClause:
Exclude:
- 'lib/active_record/connection_adapters/mysql2rgeo/create_connection.rb'
- 'lib/active_record/connection_adapters/mysql2rgeo/spatial_column.rb'

# Offense count: 1
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: MaxLineLength.
Style/IfUnlessModifier:
Exclude:
- 'lib/active_record/connection_adapters/mysql2rgeo/arel_tosql.rb'
- 'lib/active_record/type/spatial.rb'

# Offense count: 1
Expand All @@ -188,18 +191,9 @@ Style/MultipleComparison:

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle, SupportedStyles.
# SupportedStyles: predicate, comparison
Style/NumericPredicate:
Exclude:
- 'spec/**/*'
- 'lib/active_record/connection_adapters/mysql2rgeo_adapter.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/ParallelAssignment:
Exclude:
- 'lib/active_record/type/spatial.rb'
- 'lib/active_record/connection_adapters/mysql2rgeo/schema_statements.rb'

# Offense count: 2
# Cop supports --auto-correct.
Expand All @@ -211,16 +205,24 @@ Style/PercentLiteralDelimiters:

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: implicit, explicit
Style/RescueStandardError:
Exclude:
- 'lib/active_record/type/spatial.rb'

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Exclude:
- 'lib/active_record/connection_adapters/mysql2rgeo/schema_statements.rb'
- 'lib/active_record/connection_adapters/mysql2rgeo/spatial_table_definition.rb'
- 'test/ddl_test.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: MinSize, SupportedStyles.
# Configuration parameters: MinSize.
# SupportedStyles: percent, brackets
Style/SymbolArray:
EnforcedStyle: brackets
2 changes: 1 addition & 1 deletion Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ appraise "ar51" do
end

appraise "ar52" do
gem "activerecord", "~> 5.2.0.beta2"
gem "activerecord", "~> 5.2.0"
end
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@ psql -U postgres -c "create database postgis_adapter_test"
psql -U postgres -d postgis_adapter_test -c "create extension postgis"
```

You may also set up environment variables to define the database connection.
See `test/database.yml` for which variables are used. All are optional.
For example:

```sh
export PGUSER=postgis_test
export PGPASSWORD=password123
export PGPORT=95432
export PGHOST=127.0.0.2
export PGDATABASE=postgis_adapter_test

psql -c "create database postgis_adapter_test"
psql -c "create extension postgis"
```

Install dependencies:

```sh
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ gemspec

gem "mysql2", "~> 0.4.4", platform: :ruby
gem "jdbc-mysql", platform: :jruby
gem "activerecord-jdbc-adapter", "~> 5.0.pre1", platform: :jruby
gem "activerecord-jdbc-adapter", "~> 5.0", platform: :jruby
gem "ffi-geos", platform: :jruby
gem "byebug", platform: :mri_24
43 changes: 0 additions & 43 deletions History.md

This file was deleted.

2 changes: 1 addition & 1 deletion gemfiles/ar51.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source "https://rubygems.org"
gem "mysql2", "~> 0.4", platform: :ruby
gem "activerecord-jdbcmysql-adapter", "~> 1.3", platform: :jruby
gem "ffi-geos", platform: :jruby
gem "byebug", platform: :mri_23
gem "byebug", platform: :mri_24
gem "activerecord", "~> 5.1.0"

gemspec path: "../"
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Arel # :nodoc:
module Visitors # :nodoc:
# Different super-class under JRuby JDBC adapter.
Expand Down
Loading

0 comments on commit e0476f5

Please sign in to comment.