slonik_migration 1.1.3 → 1.2.1

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: 6e91f59938392524c23e33e477734c3faa88b512900ebab204d2f5c49c19f839
4
+ data.tar.gz: b87cb6f4e6f518b974f43393ed28bf4c97a5abd14c835e39ae211e202865387d
5
5
  SHA512:
6
- metadata.gz: c40b3d8247d8d27d01a7afdc517d41fdbc38c2be035083ef9f98fe29be8eee87623e527ee2b487cb1bc6f67d8e5e335f248a6527c1ac63a8bc8798f8c33226b2
7
- data.tar.gz: ce38616d04d30060ddf887752cb2ace1ddf16fd8fefbc7e562c9d2d505805a65ecb445e93c2aa7076ff655a63709c3f87a9348d73d441674275bc1bf765f4157
6
+ metadata.gz: 80d8c5a880b0b5f8bd7184a785affd795e9f6c0f255aa22ef305eaa855e3119dfebbcc0f9f41c12912784f504d4fcb2f142c1c9c9b6e1749ba8c1611b65a2653
7
+ data.tar.gz: 8c88b74567361e765339afe6554512d8f726f1ab555ea262c97c0c77e3daf4f23fa9f37ef2dd3adc6098dc40e624270dd14ad46bd65b4e2017b7b95b2a1014eb
@@ -0,0 +1,80 @@
1
+ name: CI
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ test:
7
+ runs-on: ubuntu-22.04
8
+ services:
9
+ postgres:
10
+ image: postgres:15
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, 3.2, 3.3]
21
+ gemfile: ['rails50', 'rails51', 'rails52', 'rails60', 'rails61', 'rails70', 'rails71']
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.4
30
+ gemfile: rails71
31
+ - ruby: 2.5
32
+ gemfile: rails70
33
+ - ruby: 2.5
34
+ gemfile: rails71
35
+ - ruby: 2.6
36
+ gemfile: rails70
37
+ - ruby: 2.6
38
+ gemfile: rails71
39
+ - ruby: 3.0
40
+ gemfile: rails50
41
+ - ruby: 3.0
42
+ gemfile: rails51
43
+ - ruby: 3.0
44
+ gemfile: rails52
45
+ - ruby: 3.1
46
+ gemfile: rails50
47
+ - ruby: 3.1
48
+ gemfile: rails51
49
+ - ruby: 3.1
50
+ gemfile: rails52
51
+ - ruby: 3.2
52
+ gemfile: rails50
53
+ - ruby: 3.2
54
+ gemfile: rails51
55
+ - ruby: 3.2
56
+ gemfile: rails52
57
+ - ruby: 3.3
58
+ gemfile: rails50
59
+ - ruby: 3.3
60
+ gemfile: rails51
61
+ - ruby: 3.3
62
+ gemfile: rails52
63
+
64
+ name: ruby ${{ matrix.ruby }}, ${{ matrix.gemfile }}
65
+
66
+ env:
67
+ POSTGRES_USER: postgres
68
+ POSTGRES_PASSWORD: postgres
69
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
70
+
71
+ steps:
72
+ - uses: actions/checkout@v4
73
+ - uses: ruby/setup-ruby@v1
74
+ with:
75
+ ruby-version: ${{ matrix.ruby }}
76
+ bundler-cache: true
77
+ - name: Run test
78
+ run: |
79
+ bundle exec rspec spec/slonik_migration_spec.rb
80
+ bundle exec rspec spec/slonik_migration_task_spec.rb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.2.1
4
+
5
+ * Add `frozen_string_literal: true`.
6
+
7
+ ## 1.2.0
8
+
9
+ * Support ruby 3.1.
10
+ * Drop support for ruby 2.3.
11
+
3
12
  ## 1.1.3
4
13
 
5
14
  * 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
 
@@ -2,5 +2,6 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem "rails", "~> 5.0.0"
4
4
  gem "pg", "~> 0.18"
5
+ gem "loofah", "~> 2.19.1"
5
6
 
6
7
  gemspec path: "../"
@@ -2,5 +2,6 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem "rails", "~> 5.1.0"
4
4
  gem "pg", "~> 0.18"
5
+ gem "loofah", "~> 2.19.1"
5
6
 
6
7
  gemspec path: "../"
@@ -1,5 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem "rails", "~> 5.2.0"
4
+ gem "loofah", "~> 2.19.1"
4
5
 
5
6
  gemspec path: "../"
@@ -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: "../"
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem "rails", "~> 7.1.0"
4
+
5
+ gemspec path: "../"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rails/generators'
2
4
 
3
5
  module SlonikMigration
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yaml'
2
4
  require 'shellwords'
3
5
 
@@ -1,22 +1,35 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'ostruct'
2
4
 
3
5
  module SlonikMigration
4
6
  class Config
5
7
  class << self
6
8
  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
9
+ hash = load_file
15
10
  OpenStruct.new(hash).freeze
16
11
  end
17
12
 
18
13
  private
19
14
 
15
+ def load_file
16
+ file = config_file
17
+ if File.exist?(file)
18
+ load_yaml(file).fetch(ENV['RAILS_ENV'] || 'development', {})
19
+ else
20
+ {}
21
+ end
22
+ end
23
+
24
+ def load_yaml(file)
25
+ yaml = ERB.new(IO.read(file)).result
26
+ if Gem::Version.new(Psych::VERSION) >= Gem::Version.new("4.0")
27
+ YAML.load(yaml, aliases: true)
28
+ else
29
+ YAML.load(yaml)
30
+ end
31
+ end
32
+
20
33
  def config_file
21
34
  if ENV['CONFIG_FILE']
22
35
  ENV['CONFIG_FILE']
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'command'
2
4
 
3
5
  module SlonikMigration
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SlonikMigration
2
4
  class Railtie < Rails::Railtie
3
5
  rake_tasks do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SlonikMigration
2
- VERSION = '1.1.3'
4
+ VERSION = '1.2.1'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'slonik_migration/version'
2
4
  require 'slonik_migration/railtie' if defined?(Rails)
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'slonik_migration/config'
2
4
  require 'slonik_migration/extension'
3
5
 
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.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoshikazu Kaneta
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-24 00:00:00.000000000 Z
11
+ date: 2024-06-23 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,9 @@ files:
113
113
  - gemfiles/rails51.gemfile
114
114
  - gemfiles/rails52.gemfile
115
115
  - gemfiles/rails60.gemfile
116
+ - gemfiles/rails61.gemfile
117
+ - gemfiles/rails70.gemfile
118
+ - gemfiles/rails71.gemfile
116
119
  - lib/generators/slonik_migration/config_generator.rb
117
120
  - lib/generators/slonik_migration/templates/slonik.yml
118
121
  - lib/slonik_migration.rb
@@ -126,7 +129,7 @@ files:
126
129
  homepage: https://github.com/kanety/slonik_migration
127
130
  licenses: []
128
131
  metadata: {}
129
- post_install_message:
132
+ post_install_message:
130
133
  rdoc_options: []
131
134
  require_paths:
132
135
  - lib
@@ -141,8 +144,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
144
  - !ruby/object:Gem::Version
142
145
  version: '0'
143
146
  requirements: []
144
- rubygems_version: 3.1.2
145
- signing_key:
147
+ rubygems_version: 3.3.3
148
+ signing_key:
146
149
  specification_version: 4
147
150
  summary: A rails migration gem for slony
148
151
  test_files: []
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