pronto-rails_migrations 0.16.0 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/pronto/rails_migrations/version.rb +1 -1
- data/lib/pronto/rails_migrations.rb +14 -3
- metadata +13 -53
- data/.github/workflows/build_release_pipeline.yaml +0 -51
- data/.gitignore +0 -8
- data/.ruby-version +0 -1
- data/CODEOWNERS +0 -2
- data/Gemfile +0 -4
- data/Gemfile.lock +0 -70
- data/Rakefile +0 -7
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/pronto-rails_migrations.gemspec +0 -31
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0ccb1a7b9bde96ecc3d086d9be345f5f3503e7107831533cacc9d594ad57f0d3
|
|
4
|
+
data.tar.gz: 994246a7bc0b318dacc6a775c07c531369a963625f5b25c3088010c321e2032c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fe80885e05cdd29fb42512ced02c75f35a217186538fa9e03d9012021b272492991ecd741be54b5d2d229e5f0b1b3af18d88edffcba56d57a79dfd2070d0c624
|
|
7
|
+
data.tar.gz: cb1db3938e852446a27aff0e6b117e12d2726308b3e469581037c2546496789329bc238ccead3d2d3c2ae97a48dee47e0adc6838d7408d7fc7a0fb084c07f173
|
|
@@ -42,8 +42,6 @@ module Pronto
|
|
|
42
42
|
*all_but_tail, tail = inserts
|
|
43
43
|
bad_semicolons = all_but_tail.any? { |line| line.end_with?(';') } || !tail.end_with?(';')
|
|
44
44
|
|
|
45
|
-
bad_ending = structure_sql[-4, 4] !~ /[^\n]\n\n\n/
|
|
46
|
-
|
|
47
45
|
messages = []
|
|
48
46
|
|
|
49
47
|
if unordered_inserts
|
|
@@ -59,7 +57,7 @@ module Pronto
|
|
|
59
57
|
'last insert must end with semicolon (`;`).'
|
|
60
58
|
)
|
|
61
59
|
end
|
|
62
|
-
messages << message(patch,
|
|
60
|
+
messages << message(patch, bad_ending_message) if bad_ending?(structure_sql)
|
|
63
61
|
|
|
64
62
|
messages
|
|
65
63
|
end
|
|
@@ -78,5 +76,18 @@ module Pronto
|
|
|
78
76
|
path = patch.new_file_full_path.to_s
|
|
79
77
|
/db.(schema.rb|structure.sql|migrate)/ =~ path
|
|
80
78
|
end
|
|
79
|
+
|
|
80
|
+
def bad_ending?(structure_sql)
|
|
81
|
+
!structure_sql.match?(/[^\n]\n{#{expected_empty_lines + 1}}\z/)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def bad_ending_message
|
|
85
|
+
"`db/structure.sql` must end with #{expected_empty_lines} empty lines."
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def expected_empty_lines
|
|
89
|
+
version = Gem.loaded_specs['activerecord']&.version
|
|
90
|
+
version && version < Gem::Version.new('7.1') ? 2 : 1
|
|
91
|
+
end
|
|
81
92
|
end
|
|
82
93
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pronto-rails_migrations
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.17.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vinted
|
|
8
|
-
|
|
9
|
-
bindir: exe
|
|
8
|
+
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: pronto
|
|
@@ -25,47 +24,19 @@ dependencies:
|
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
25
|
version: 0.11.1
|
|
27
26
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name:
|
|
27
|
+
name: base64
|
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
|
30
29
|
requirements:
|
|
31
30
|
- - ">="
|
|
32
31
|
- !ruby/object:Gem::Version
|
|
33
|
-
version:
|
|
34
|
-
type: :
|
|
35
|
-
prerelease: false
|
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
-
requirements:
|
|
38
|
-
- - ">="
|
|
39
|
-
- !ruby/object:Gem::Version
|
|
40
|
-
version: 1.10.3
|
|
41
|
-
- !ruby/object:Gem::Dependency
|
|
42
|
-
name: multipart-post
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - ">="
|
|
46
|
-
- !ruby/object:Gem::Version
|
|
47
|
-
version: 2.1.1
|
|
48
|
-
type: :runtime
|
|
49
|
-
prerelease: false
|
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
-
requirements:
|
|
52
|
-
- - ">="
|
|
53
|
-
- !ruby/object:Gem::Version
|
|
54
|
-
version: 2.1.1
|
|
55
|
-
- !ruby/object:Gem::Dependency
|
|
56
|
-
name: sawyer
|
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
|
58
|
-
requirements:
|
|
59
|
-
- - ">="
|
|
60
|
-
- !ruby/object:Gem::Version
|
|
61
|
-
version: '0.9'
|
|
62
|
-
type: :runtime
|
|
32
|
+
version: '0'
|
|
33
|
+
type: :development
|
|
63
34
|
prerelease: false
|
|
64
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
36
|
requirements:
|
|
66
37
|
- - ">="
|
|
67
38
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '0
|
|
39
|
+
version: '0'
|
|
69
40
|
- !ruby/object:Gem::Dependency
|
|
70
41
|
name: bundler
|
|
71
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -86,14 +57,14 @@ dependencies:
|
|
|
86
57
|
requirements:
|
|
87
58
|
- - "~>"
|
|
88
59
|
- !ruby/object:Gem::Version
|
|
89
|
-
version: '
|
|
60
|
+
version: '13.0'
|
|
90
61
|
type: :development
|
|
91
62
|
prerelease: false
|
|
92
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
64
|
requirements:
|
|
94
65
|
- - "~>"
|
|
95
66
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: '
|
|
67
|
+
version: '13.0'
|
|
97
68
|
description: This pronto runner warns when migrations are run and application code
|
|
98
69
|
is changed at the same time
|
|
99
70
|
email:
|
|
@@ -102,25 +73,15 @@ executables: []
|
|
|
102
73
|
extensions: []
|
|
103
74
|
extra_rdoc_files: []
|
|
104
75
|
files:
|
|
105
|
-
- ".github/workflows/build_release_pipeline.yaml"
|
|
106
|
-
- ".gitignore"
|
|
107
|
-
- ".ruby-version"
|
|
108
|
-
- CODEOWNERS
|
|
109
|
-
- Gemfile
|
|
110
|
-
- Gemfile.lock
|
|
111
76
|
- LICENSE.txt
|
|
112
77
|
- README.md
|
|
113
|
-
- Rakefile
|
|
114
|
-
- bin/console
|
|
115
|
-
- bin/setup
|
|
116
78
|
- lib/pronto/rails_migrations.rb
|
|
117
79
|
- lib/pronto/rails_migrations/version.rb
|
|
118
|
-
- pronto-rails_migrations.gemspec
|
|
119
80
|
homepage: https://github.com/vinted/pronto-rails_migrations
|
|
120
81
|
licenses:
|
|
121
82
|
- MIT
|
|
122
|
-
metadata:
|
|
123
|
-
|
|
83
|
+
metadata:
|
|
84
|
+
source_code_uri: https://github.com/vinted/pronto-rails_migrations
|
|
124
85
|
rdoc_options: []
|
|
125
86
|
require_paths:
|
|
126
87
|
- lib
|
|
@@ -135,8 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
135
96
|
- !ruby/object:Gem::Version
|
|
136
97
|
version: '0'
|
|
137
98
|
requirements: []
|
|
138
|
-
rubygems_version: 3.
|
|
139
|
-
signing_key:
|
|
99
|
+
rubygems_version: 3.6.9
|
|
140
100
|
specification_version: 4
|
|
141
|
-
summary: Validate migration and application code change
|
|
101
|
+
summary: Validate migration and application code change separation
|
|
142
102
|
test_files: []
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
name: Build and release ruby gem
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
branches: [ master ]
|
|
6
|
-
push:
|
|
7
|
-
workflow_dispatch:
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
build-release-pipeline:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
container: ruby:3.0.4
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/checkout@v2
|
|
15
|
-
- name: Setup
|
|
16
|
-
run: |
|
|
17
|
-
apt-get update -y && apt-get install -y --no-install-recommends cmake
|
|
18
|
-
gem install bundler
|
|
19
|
-
bundle install
|
|
20
|
-
|
|
21
|
-
- name: Build
|
|
22
|
-
id: build
|
|
23
|
-
if: success() && github.ref == 'refs/heads/master'
|
|
24
|
-
run: |
|
|
25
|
-
bundle exec rake build
|
|
26
|
-
echo "::set-output name=gem_version::v$(bundle exec rake version)"
|
|
27
|
-
|
|
28
|
-
- name: Release
|
|
29
|
-
if: success() && github.ref == 'refs/heads/master'
|
|
30
|
-
run: |
|
|
31
|
-
mkdir -p $HOME/.gem
|
|
32
|
-
touch $HOME/.gem/credentials
|
|
33
|
-
chmod 600 $HOME/.gem/credentials
|
|
34
|
-
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
|
35
|
-
gem push pkg/*
|
|
36
|
-
env:
|
|
37
|
-
GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_AUTH_TOKEN }}"
|
|
38
|
-
|
|
39
|
-
- name: Tag repo with new gem version
|
|
40
|
-
if: success() && github.ref == 'refs/heads/master'
|
|
41
|
-
uses: actions/github-script@v3
|
|
42
|
-
with:
|
|
43
|
-
github-token: ${{ github.token }}
|
|
44
|
-
script: |
|
|
45
|
-
github.git.createRef({
|
|
46
|
-
owner: context.repo.owner,
|
|
47
|
-
repo: context.repo.repo,
|
|
48
|
-
ref: "refs/tags/${{ steps.build.outputs.gem_version }}",
|
|
49
|
-
sha: context.sha
|
|
50
|
-
})
|
|
51
|
-
|
data/.gitignore
DELETED
data/.ruby-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3.0.4
|
data/CODEOWNERS
DELETED
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
pronto-rails_migrations (0.16.0)
|
|
5
|
-
faraday (>= 1.10.3)
|
|
6
|
-
multipart-post (>= 2.1.1)
|
|
7
|
-
pronto (>= 0.11.1)
|
|
8
|
-
sawyer (>= 0.9)
|
|
9
|
-
|
|
10
|
-
GEM
|
|
11
|
-
remote: https://rubygems.org/
|
|
12
|
-
specs:
|
|
13
|
-
addressable (2.8.7)
|
|
14
|
-
public_suffix (>= 2.0.2, < 7.0)
|
|
15
|
-
csv (3.3.0)
|
|
16
|
-
faraday (2.10.0)
|
|
17
|
-
faraday-net_http (>= 2.0, < 3.2)
|
|
18
|
-
logger
|
|
19
|
-
faraday-net_http (3.1.0)
|
|
20
|
-
net-http
|
|
21
|
-
gitlab (4.20.1)
|
|
22
|
-
httparty (~> 0.20)
|
|
23
|
-
terminal-table (>= 1.5.1)
|
|
24
|
-
httparty (0.22.0)
|
|
25
|
-
csv
|
|
26
|
-
mini_mime (>= 1.0.0)
|
|
27
|
-
multi_xml (>= 0.5.2)
|
|
28
|
-
logger (1.6.0)
|
|
29
|
-
mini_mime (1.1.5)
|
|
30
|
-
multi_xml (0.6.0)
|
|
31
|
-
multipart-post (2.4.1)
|
|
32
|
-
net-http (0.4.1)
|
|
33
|
-
uri
|
|
34
|
-
octokit (7.2.0)
|
|
35
|
-
faraday (>= 1, < 3)
|
|
36
|
-
sawyer (~> 0.9)
|
|
37
|
-
pronto (0.11.2)
|
|
38
|
-
gitlab (>= 4.4.0, < 5.0)
|
|
39
|
-
httparty (>= 0.13.7, < 1.0)
|
|
40
|
-
octokit (>= 4.7.0, < 8.0)
|
|
41
|
-
rainbow (>= 2.2, < 4.0)
|
|
42
|
-
rexml (>= 3.2.5, < 4.0)
|
|
43
|
-
rugged (>= 0.23.0, < 2.0)
|
|
44
|
-
thor (>= 0.20.3, < 2.0)
|
|
45
|
-
public_suffix (6.0.0)
|
|
46
|
-
rainbow (3.1.1)
|
|
47
|
-
rake (12.3.3)
|
|
48
|
-
rexml (3.3.1)
|
|
49
|
-
strscan
|
|
50
|
-
rugged (1.7.2)
|
|
51
|
-
sawyer (0.9.2)
|
|
52
|
-
addressable (>= 2.3.5)
|
|
53
|
-
faraday (>= 0.17.3, < 3)
|
|
54
|
-
strscan (3.1.0)
|
|
55
|
-
terminal-table (3.0.2)
|
|
56
|
-
unicode-display_width (>= 1.1.1, < 3)
|
|
57
|
-
thor (1.3.1)
|
|
58
|
-
unicode-display_width (2.5.0)
|
|
59
|
-
uri (0.13.0)
|
|
60
|
-
|
|
61
|
-
PLATFORMS
|
|
62
|
-
ruby
|
|
63
|
-
|
|
64
|
-
DEPENDENCIES
|
|
65
|
-
bundler
|
|
66
|
-
pronto-rails_migrations!
|
|
67
|
-
rake (~> 12.0)
|
|
68
|
-
|
|
69
|
-
BUNDLED WITH
|
|
70
|
-
2.2.33
|
data/Rakefile
DELETED
data/bin/console
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
|
|
3
|
-
require "bundler/setup"
|
|
4
|
-
require "pronto/rails_migrations"
|
|
5
|
-
|
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
|
8
|
-
|
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
|
-
# require "pry"
|
|
11
|
-
# Pry.start
|
|
12
|
-
|
|
13
|
-
require "irb"
|
|
14
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
lib = File.expand_path("../lib", __FILE__)
|
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
-
require 'pronto/rails_migrations/version'
|
|
5
|
-
|
|
6
|
-
Gem::Specification.new do |spec|
|
|
7
|
-
spec.name = "pronto-rails_migrations"
|
|
8
|
-
spec.version = Pronto::RAILS_MIGRATIONS_VERSION
|
|
9
|
-
spec.authors = ["Vinted"]
|
|
10
|
-
spec.email = ["backend@vinted.com"]
|
|
11
|
-
|
|
12
|
-
spec.summary = %q{Validate migration and application code change seperation}
|
|
13
|
-
spec.description = %q{This pronto runner warns when migrations are run and application code is changed at the same time}
|
|
14
|
-
spec.homepage = "https://github.com/vinted/pronto-rails_migrations"
|
|
15
|
-
spec.license = "MIT"
|
|
16
|
-
|
|
17
|
-
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
18
|
-
f.match(%r{^(test|spec|features)/})
|
|
19
|
-
end
|
|
20
|
-
spec.bindir = "exe"
|
|
21
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
22
|
-
spec.require_paths = ["lib"]
|
|
23
|
-
|
|
24
|
-
spec.add_dependency('pronto', '>= 0.11.1')
|
|
25
|
-
spec.add_dependency('faraday', '>= 1.10.3')
|
|
26
|
-
spec.add_dependency('multipart-post', '>= 2.1.1')
|
|
27
|
-
spec.add_dependency('sawyer', '>= 0.9')
|
|
28
|
-
|
|
29
|
-
spec.add_development_dependency "bundler"
|
|
30
|
-
spec.add_development_dependency "rake", "~> 12.0"
|
|
31
|
-
end
|