armg 0.8.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87b091745ad8e4956f0fe1d82c5550d6c700feeb34541fef66e96309f3bcf09c
4
- data.tar.gz: 0a045f637a8914a492cf93579f85399a6510183e23425ea152e864a81d9f8d8d
3
+ metadata.gz: 799e9abfae32c77cb45dcba9d047b1993c0bd89c1c7991e6638ca57fe08df00c
4
+ data.tar.gz: 78872a397ba74eb08968f3c6e7e9173976501563304ed582d925b93ce085f920
5
5
  SHA512:
6
- metadata.gz: e448dc89ea4e86c696a06a7e16ea09634a729347592ddfe0372ee9dd18dbda6f243f5313f05b2f84872171c84585c69def8207cf4a8aa6f0d2b0ab9006a5a2ca
7
- data.tar.gz: 9f426744830c050aa10152aa062232dc1bf9758b819c768b600f582c07ae3099acbb4413d43f2180c1b1a76593636192c6d06817770540922aef14abb895b845
6
+ metadata.gz: f938016e888bf2d30cebc445c414205ea9543932b9c33c89dd2c0af6b0c2522997caee1503434cd2c6c22b635eaa496bddb5bec0b80e6b78634128e5b868259f
7
+ data.tar.gz: 18d735ba55d6504f0d784ec1b0d65527abb65d3cbf3ac7813e5a8ac05da90f2d72bd21a6928c26f1b059a43bce439896c0bad363835420497ba1a714a61a1cd2
@@ -0,0 +1,63 @@
1
+ name: test
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ ruby:
14
+ - 2.4
15
+ - 2.5
16
+ - 2.6
17
+ - 2.7
18
+ env:
19
+ - ARMG_TEST_MYSQL_PORT=10056 ARMG_TEST_MYSQL_ENGINE=MyISAM
20
+ - ARMG_TEST_MYSQL_PORT=10057 ARMG_TEST_MYSQL_ENGINE=MyISAM
21
+ - ARMG_TEST_MYSQL_PORT=10057 ARMG_TEST_MYSQL_ENGINE=InnoDB
22
+ gemfile:
23
+ - gemfiles/ar50.gemfile
24
+ - gemfiles/ar51.gemfile
25
+ - gemfiles/ar52.gemfile
26
+ - gemfiles/ar60.gemfile
27
+ - gemfiles/ar61.gemfile
28
+ exclude:
29
+ - ruby: 2.4
30
+ gemfile: gemfiles/ar60.gemfile
31
+ - ruby: 2.4
32
+ gemfile: gemfiles/ar61.gemfile
33
+
34
+ steps:
35
+ - uses: actions/checkout@v2
36
+ - uses: actions/setup-ruby@v1
37
+ with:
38
+ ruby-version: ${{ matrix.ruby }}
39
+ - uses: actions/cache@v2
40
+ with:
41
+ path: gemfiles/vendor/bundle
42
+ key: ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ matrix.gemfile }}-${{ hashFiles('ridgepole.gemspec', '**/Gemfile', '${{ matrix.gemfile }}') }}
43
+ restore-keys: |
44
+ ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ matrix.gemfile }}-
45
+
46
+ - name: Setup dependencies
47
+ run: |
48
+ for i in {1..60}; do docker-compose up -d && break; sleep 1; done
49
+
50
+ gem install bundler
51
+ bundle config path vendor/bundle
52
+ bundle install --jobs 4 --retry 3
53
+
54
+ # Wait until database servers start
55
+ function mysql_ping { mysqladmin -u root -h 127.0.0.1 -P $1 ping; }
56
+ for i in {1..60}; do mysql_ping 10056 && break; sleep 1; done
57
+ for i in {1..60}; do mysql_ping 10057 && break; sleep 1; done
58
+ env:
59
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
60
+
61
+ - run: ${{ matrix.env }} bundle exec rake
62
+ env:
63
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
@@ -3,6 +3,7 @@ AllCops:
3
3
  - gemfiles/**/*
4
4
  - test.rb
5
5
  TargetRubyVersion: 2.4
6
+ NewCops: enable
6
7
  Bundler/OrderedGems:
7
8
  Include:
8
9
  - "Appraisals"
@@ -22,3 +23,5 @@ Style/HashTransformKeys:
22
23
  Enabled: true
23
24
  Style/HashTransformValues:
24
25
  Enabled: true
26
+ Gemspec/RequiredRubyVersion:
27
+ Enabled: false
data/Appraisals CHANGED
@@ -15,3 +15,7 @@ end
15
15
  appraise 'ar60' do
16
16
  gem 'activerecord', '~> 6.0.0'
17
17
  end
18
+
19
+ appraise 'ar61' do
20
+ gem 'activerecord', '~> 6.1.0'
21
+ end
data/README.md CHANGED
@@ -3,7 +3,8 @@
3
3
  Add MySQL geometry type to Active Record.
4
4
 
5
5
  [![Gem Version](https://badge.fury.io/rb/armg.svg)](https://badge.fury.io/rb/armg)
6
- [![Build Status](https://travis-ci.org/winebarrel/armg.svg?branch=master)](https://travis-ci.org/winebarrel/armg)
6
+ [![Build Status](https://github.com/winebarrel/armg/workflows/test/badge.svg?branch=master)](https://github.com/winebarrel/armg/actions)
7
+
7
8
 
8
9
  ## Installation
9
10
 
@@ -119,17 +120,22 @@ You need to extend the TableDefinition class.
119
120
 
120
121
  ```ruby
121
122
  # ridgepole-geo.rb
122
- module Ridgepole
123
- class DSLParser
124
- class TableDefinition
125
- def geometry(*args)
126
- options = args.extract_options!
127
- column_names = args
128
- column_names.each { |name| column(name, :geometry, options) }
129
- end
130
- end
123
+ module TableDefinitionExtForGeometry
124
+ def geometry(*args)
125
+ options = args.extract_options!
126
+ column_names = args
127
+ column_names.each { |name| column(name, :geometry, options) }
128
+ end
129
+ end
130
+ Ridgepole::DSLParser::TableDefinition.prepend(TableDefinitionExtForGeometry)
131
+
132
+ module DiffExtForGeometry
133
+ def normalize_index_options!(opts)
134
+ super
135
+ opts.delete(:length) if opts[:type] == :spatial
131
136
  end
132
137
  end
138
+ Ridgepole::Diff.prepend(DiffExtForGeometry)
133
139
  ```
134
140
 
135
141
  ```sh
@@ -31,5 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.add_development_dependency 'rake'
32
32
  spec.add_development_dependency 'rspec', '~> 3.0'
33
33
  spec.add_development_dependency 'rspec-match_ruby', '>= 0.1.3'
34
- spec.add_development_dependency 'rubocop'
34
+ spec.add_development_dependency 'rubocop', '>= 1.7.0'
35
+ spec.add_development_dependency 'rubocop-rake'
36
+ spec.add_development_dependency 'rubocop-rspec'
35
37
  end
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 6.1.0"
6
+
7
+ gemspec path: "../"
@@ -5,12 +5,6 @@ module Armg
5
5
  @serializer = Armg::WkbSerializer.new
6
6
 
7
7
  class << self
8
- attr_reader :deserializer
9
-
10
- attr_writer :deserializer
11
-
12
- attr_reader :serializer
13
-
14
- attr_writer :serializer
8
+ attr_accessor :deserializer, :serializer
15
9
  end
16
10
  end
@@ -3,7 +3,7 @@
3
3
  module Armg
4
4
  module TableDefinitionExt
5
5
  def geometry(*args, **options)
6
- args.each { |name| column(name, :geometry, options) }
6
+ args.each { |name| column(name, :geometry, **options) }
7
7
  end
8
8
  end
9
9
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Armg
4
- VERSION = '0.8.1'
4
+ VERSION = '0.9.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: armg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-09 00:00:00.000000000 Z
11
+ date: 2020-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -144,6 +144,34 @@ dependencies:
144
144
  version: 0.1.3
145
145
  - !ruby/object:Gem::Dependency
146
146
  name: rubocop
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: 1.7.0
152
+ type: :development
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ version: 1.7.0
159
+ - !ruby/object:Gem::Dependency
160
+ name: rubocop-rake
161
+ requirement: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - ">="
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: '0'
173
+ - !ruby/object:Gem::Dependency
174
+ name: rubocop-rspec
147
175
  requirement: !ruby/object:Gem::Requirement
148
176
  requirements:
149
177
  - - ">="
@@ -163,10 +191,10 @@ executables: []
163
191
  extensions: []
164
192
  extra_rdoc_files: []
165
193
  files:
194
+ - ".github/workflows/test.yml"
166
195
  - ".gitignore"
167
196
  - ".rspec"
168
197
  - ".rubocop.yml"
169
- - ".travis.yml"
170
198
  - Appraisals
171
199
  - Gemfile
172
200
  - LICENSE.txt
@@ -181,6 +209,7 @@ files:
181
209
  - gemfiles/ar51.gemfile
182
210
  - gemfiles/ar52.gemfile
183
211
  - gemfiles/ar60.gemfile
212
+ - gemfiles/ar61.gemfile
184
213
  - lib/armg.rb
185
214
  - lib/armg/abstract_mysql_adapter_ext.rb
186
215
  - lib/armg/armg.rb
@@ -196,7 +225,7 @@ homepage: https://github.com/winebarrel/armg
196
225
  licenses:
197
226
  - MIT
198
227
  metadata: {}
199
- post_install_message:
228
+ post_install_message:
200
229
  rdoc_options: []
201
230
  require_paths:
202
231
  - lib
@@ -211,8 +240,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
211
240
  - !ruby/object:Gem::Version
212
241
  version: '0'
213
242
  requirements: []
214
- rubygems_version: 3.0.3
215
- signing_key:
243
+ rubygems_version: 3.1.2
244
+ signing_key:
216
245
  specification_version: 4
217
246
  summary: Add MySQL geometry type to Active Record.
218
247
  test_files: []
@@ -1,33 +0,0 @@
1
- dist: xenial
2
- sudo: required
3
- group: edge
4
- services:
5
- - docker
6
- language: ruby
7
- rvm:
8
- - 2.4.9
9
- - 2.5.7
10
- - 2.6.5
11
- gemfile:
12
- - gemfiles/ar50.gemfile
13
- - gemfiles/ar51.gemfile
14
- - gemfiles/ar52.gemfile
15
- - gemfiles/ar60.gemfile
16
- before_script:
17
- - sudo service mysql stop
18
- - docker-compose up -d
19
- - function mysql_ping { mysqladmin -u root -h 127.0.0.1 -P $1 ping; }
20
- - for i in {1..60}; do mysql_ping 10056 && break; sleep 1; done
21
- - for i in {1..60}; do mysql_ping 10057 && break; sleep 1; done
22
- cache:
23
- - bundler
24
- env:
25
- - ARMG_TEST_MYSQL_PORT=10056 ARMG_TEST_MYSQL_ENGINE=MyISAM
26
- - ARMG_TEST_MYSQL_PORT=10057 ARMG_TEST_MYSQL_ENGINE=MyISAM
27
- - ARMG_TEST_MYSQL_PORT=10057 ARMG_TEST_MYSQL_ENGINE=InnoDB
28
- script:
29
- - bundle exec rake
30
- matrix:
31
- exclude:
32
- - rvm: 2.4.9
33
- gemfile: gemfiles/ar60.gemfile