slonik_migration 1.1.3 → 1.2.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: ebdc314418aa72db86e8e700cdf940f4c35899610ad91a43fbc374740e5d6886
4
- data.tar.gz: 166c7b12ee29d8634410da3898c2c7c95ab032c3d4205ce9f1fde2dea2b6d80f
3
+ metadata.gz: 3caa52c10f2bf3e46027dbb8c0ff309e8dad46d9f5efc45694d31af21c2ba9f7
4
+ data.tar.gz: 5f430959a86ff8b3bcb71e911eba4115bb8e4f2acb69c03554a19e66cc9b19d6
5
5
  SHA512:
6
- metadata.gz: c40b3d8247d8d27d01a7afdc517d41fdbc38c2be035083ef9f98fe29be8eee87623e527ee2b487cb1bc6f67d8e5e335f248a6527c1ac63a8bc8798f8c33226b2
7
- data.tar.gz: ce38616d04d30060ddf887752cb2ace1ddf16fd8fefbc7e562c9d2d505805a65ecb445e93c2aa7076ff655a63709c3f87a9348d73d441674275bc1bf765f4157
6
+ metadata.gz: a06fdbe3f87891a5c456ad5da721a064044db89ab66059dcb1a0f4ce3c5a84601f785a3f37de2d8ac9a15e118b5855e8b1e71f550774c54f714497e7eb8f7674
7
+ data.tar.gz: 8a9ff1a400a121b4759251733892dd49bcecb21e1bcf0e47b4718c039743f6102879f51cb44c790c88038b99d6739440b1a4786d0595b4a10e6ccc92032451d7
@@ -0,0 +1,62 @@
1
+ name: CI
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ test:
7
+ runs-on: ubuntu-20.04
8
+ services:
9
+ postgres:
10
+ image: postgres:9.5
11
+ env:
12
+ POSTGRES_USER: postgres
13
+ POSTGRES_PASSWORD: postgres
14
+ ports:
15
+ - 5432:5432
16
+ options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
17
+ strategy:
18
+ fail-fast: false
19
+ matrix:
20
+ ruby: [2.4, 2.5, 2.6, 2.7, '3.0', 3.1]
21
+ gemfile: ['rails50', 'rails51', 'rails52', 'rails60', 'rails61', 'rails70']
22
+ exclude:
23
+ - ruby: 2.4
24
+ gemfile: rails60
25
+ - ruby: 2.4
26
+ gemfile: rails61
27
+ - ruby: 2.4
28
+ gemfile: rails70
29
+ - ruby: 2.5
30
+ gemfile: rails70
31
+ - ruby: 2.6
32
+ gemfile: rails70
33
+ - ruby: 3.0
34
+ gemfile: rails50
35
+ - ruby: 3.0
36
+ gemfile: rails51
37
+ - ruby: 3.0
38
+ gemfile: rails52
39
+ - ruby: 3.1
40
+ gemfile: rails50
41
+ - ruby: 3.1
42
+ gemfile: rails51
43
+ - ruby: 3.1
44
+ gemfile: rails52
45
+
46
+ name: ruby ${{ matrix.ruby }}, ${{ matrix.gemfile }}
47
+
48
+ env:
49
+ POSTGRES_USER: postgres
50
+ POSTGRES_PASSWORD: postgres
51
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
52
+
53
+ steps:
54
+ - uses: actions/checkout@v2
55
+ - uses: ruby/setup-ruby@v1
56
+ with:
57
+ ruby-version: ${{ matrix.ruby }}
58
+ bundler-cache: true
59
+ - name: Run test
60
+ run: |
61
+ bundle exec rspec spec/slonik_migration_spec.rb
62
+ bundle exec rspec spec/slonik_migration_task_spec.rb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.2.0
4
+
5
+ * Support ruby 3.1.
6
+ * Drop support for ruby 2.3.
7
+
3
8
  ## 1.1.3
4
9
 
5
10
  * Fix deprecation warning for ruby 2.7.
data/README.md CHANGED
@@ -4,7 +4,7 @@ A rails migration gem for slony using `slonik_execute_script` command.
4
4
 
5
5
  ## Dependencies
6
6
 
7
- * ruby 2.3+
7
+ * ruby 2.4+
8
8
  * activerecord 5.0+
9
9
  * slony 2.2+
10
10
 
@@ -1,5 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem "rails", "~> 6.0.0"
4
+ gem "psych", "~> 3.3.0"
4
5
 
5
6
  gemspec path: "../"
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem "rails", "~> 6.1.0"
4
+
5
+ gemspec path: "../"
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem "rails", "~> 7.0.1"
4
+
5
+ gemspec path: "../"
@@ -4,19 +4,30 @@ module SlonikMigration
4
4
  class Config
5
5
  class << self
6
6
  def load
7
- file = config_file
8
- env = ENV['RAILS_ENV'] || 'development'
9
-
10
- hash = if File.exist?(file)
11
- YAML.load(ERB.new(IO.read(file)).result)[env]
12
- else
13
- {}
14
- end
7
+ hash = load_file
15
8
  OpenStruct.new(hash).freeze
16
9
  end
17
10
 
18
11
  private
19
12
 
13
+ def load_file
14
+ file = config_file
15
+ if File.exist?(file)
16
+ load_yaml(file).fetch(ENV['RAILS_ENV'] || 'development', {})
17
+ else
18
+ {}
19
+ end
20
+ end
21
+
22
+ def load_yaml(file)
23
+ yaml = ERB.new(IO.read(file)).result
24
+ if Gem::Version.new(Psych::VERSION) >= Gem::Version.new("4.0")
25
+ YAML.load(yaml, aliases: true)
26
+ else
27
+ YAML.load(yaml)
28
+ end
29
+ end
30
+
20
31
  def config_file
21
32
  if ENV['CONFIG_FILE']
22
33
  ENV['CONFIG_FILE']
@@ -1,3 +1,3 @@
1
1
  module SlonikMigration
2
- VERSION = '1.1.3'
2
+ VERSION = '1.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slonik_migration
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoshikazu Kaneta
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-24 00:00:00.000000000 Z
11
+ date: 2022-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -101,9 +101,9 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
+ - ".github/workflows/ci.yml"
104
105
  - ".gitignore"
105
106
  - ".rspec"
106
- - ".travis.yml"
107
107
  - CHANGELOG.md
108
108
  - Gemfile
109
109
  - LICENSE
@@ -113,6 +113,8 @@ files:
113
113
  - gemfiles/rails51.gemfile
114
114
  - gemfiles/rails52.gemfile
115
115
  - gemfiles/rails60.gemfile
116
+ - gemfiles/rails61.gemfile
117
+ - gemfiles/rails70.gemfile
116
118
  - lib/generators/slonik_migration/config_generator.rb
117
119
  - lib/generators/slonik_migration/templates/slonik.yml
118
120
  - lib/slonik_migration.rb
data/.travis.yml DELETED
@@ -1,25 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.3
4
- - 2.4
5
- - 2.5
6
- - 2.6
7
- - 2.7
8
- services:
9
- - postgresql
10
- addons:
11
- postgresql: "9.5"
12
- gemfile:
13
- - gemfiles/rails50.gemfile
14
- - gemfiles/rails51.gemfile
15
- - gemfiles/rails52.gemfile
16
- - gemfiles/rails60.gemfile
17
- matrix:
18
- exclude:
19
- - rvm: 2.3
20
- gemfile: gemfiles/rails60.gemfile
21
- - rvm: 2.4
22
- gemfile: gemfiles/rails60.gemfile
23
- script:
24
- - bundle exec rspec spec/slonik_migration_spec.rb
25
- - bundle exec rspec spec/slonik_migration_task_spec.rb