fix-db-schema-conflicts 3.0.2 → 3.0.3
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 +5 -5
- data/.rubocop_schema.53.yml +38 -0
- data/README.md +7 -4
- data/lib/fix_db_schema_conflicts/autocorrect_configuration.rb +9 -3
- data/lib/fix_db_schema_conflicts/version.rb +1 -1
- data/spec/integration/integration_spec.rb +0 -2
- data/spec/test-app/db/schema.rb +0 -2
- data/spec/unit/autocorrect_configuration_spec.rb +6 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d333bf66122bebe3e479e9799bbefe7731181244f3877b29c15efa70dfdab5dd
|
4
|
+
data.tar.gz: f94f107c5bac325dd24b50bcd78496bac9c4bfb0fb697e16a5fe945af36e25ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3dbbc8e064c1db6a7c14846b813ce2b60b4955c35f62af6ca9b4b67d0d28536bd93d8f5e97d2a1ec405697f874d4bdccd0757bdf7b5b280e06efb8661eb5100
|
7
|
+
data.tar.gz: 0330e6fd3a1dac530b2eaab637b2a6bd5affc952711c43813e5266520aca72f693e8d0da41103d4354ad083b82286c45c5d1f314cebe36f0c24f6447e92eb78b
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# Configuration for Rubocop >= 0.53.0
|
2
|
+
|
3
|
+
Layout/AlignHash:
|
4
|
+
EnforcedColonStyle: 'key'
|
5
|
+
EnforcedHashRocketStyle: 'key'
|
6
|
+
|
7
|
+
Layout/ExtraSpacing:
|
8
|
+
# When true, allows most uses of extra spacing if the intent is to align
|
9
|
+
# things with the previous or next line, not counting empty lines or comment
|
10
|
+
# lines.
|
11
|
+
AllowForAlignment: false
|
12
|
+
|
13
|
+
Layout/SpaceBeforeFirstArg:
|
14
|
+
Enabled: true
|
15
|
+
|
16
|
+
Style/NumericLiterals:
|
17
|
+
Enabled: false
|
18
|
+
|
19
|
+
Metrics/BlockNesting:
|
20
|
+
Max: 2
|
21
|
+
|
22
|
+
Style/WordArray:
|
23
|
+
Enabled: false
|
24
|
+
|
25
|
+
Style/TrailingCommaInArrayLiteral:
|
26
|
+
EnforcedStyleForMultiline: 'comma'
|
27
|
+
|
28
|
+
Style/TrailingCommaInHashLiteral:
|
29
|
+
EnforcedStyleForMultiline: 'comma'
|
30
|
+
|
31
|
+
Style/TrailingCommaInArguments:
|
32
|
+
EnforcedStyleForMultiline: 'comma'
|
33
|
+
|
34
|
+
Style/HashSyntax:
|
35
|
+
EnforcedStyle: 'ruby19'
|
36
|
+
|
37
|
+
Style/StringLiterals:
|
38
|
+
EnforcedStyle: double_quotes
|
data/README.md
CHANGED
@@ -37,8 +37,8 @@ auto-correct flag to ensure a consistent output format.
|
|
37
37
|
## Usage
|
38
38
|
|
39
39
|
You don't have to do anything different. It should just work. Simply run `rake
|
40
|
-
db:migrate` or `rake db:schema:dump` as you would before and
|
41
|
-
conflicts` will do the rest.
|
40
|
+
db:migrate` or `rake db:schema:dump` as you would before and
|
41
|
+
`fix-db-schema-conflicts` will do the rest.
|
42
42
|
|
43
43
|
## Installation
|
44
44
|
|
@@ -54,8 +54,8 @@ And then execute:
|
|
54
54
|
|
55
55
|
## Older versions of Rubocop:
|
56
56
|
|
57
|
-
If you wish to use a version of Rubocop `< 0.36.0` or below, use
|
58
|
-
schema-conflicts', '~> 1.0.2'`
|
57
|
+
If you wish to use a version of Rubocop `< 0.36.0` or below, use
|
58
|
+
`gem 'fix-db-schema-conflicts', '~> 1.0.2'`
|
59
59
|
|
60
60
|
## Older versions of Ruby:
|
61
61
|
|
@@ -81,8 +81,11 @@ old Ruby.
|
|
81
81
|
- [@vsubramanian](https://github.com/vsubramanian)
|
82
82
|
- [@claytron](https://github.com/claytron)
|
83
83
|
- [@amckinnell](https://github.com/amckinnell)
|
84
|
+
- [@rosscooperman](https://github.com/rosscooperman)
|
84
85
|
|
85
86
|
## Releases
|
87
|
+
- 3.0.3
|
88
|
+
- Added support for new Rubocop 0.53+ schema (rosscooperman)
|
86
89
|
- 3.0.2
|
87
90
|
- Added support for new Rubocop 0.49+ schema (amckinnell)
|
88
91
|
- 3.0.1
|
@@ -5,13 +5,19 @@ module FixDBSchemaConflicts
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def load
|
8
|
-
|
8
|
+
if less_than_rubocop?(49)
|
9
|
+
'.rubocop_schema.yml'
|
10
|
+
elsif less_than_rubocop?(53)
|
11
|
+
'.rubocop_schema.49.yml'
|
12
|
+
else
|
13
|
+
'.rubocop_schema.53.yml'
|
14
|
+
end
|
9
15
|
end
|
10
16
|
|
11
17
|
private
|
12
18
|
|
13
|
-
def
|
14
|
-
Gem::Version.new(
|
19
|
+
def less_than_rubocop?(ver)
|
20
|
+
Gem.loaded_specs['rubocop'].version < Gem::Version.new("0.#{ver}.0")
|
15
21
|
end
|
16
22
|
end
|
17
23
|
end
|
@@ -20,8 +20,6 @@ end
|
|
20
20
|
|
21
21
|
def reference_db_schema
|
22
22
|
<<-RUBY
|
23
|
-
# encoding: UTF-8
|
24
|
-
|
25
23
|
# This file is auto-generated from the current state of the database. Instead
|
26
24
|
# of editing this file, please use the migrations feature of Active Record to
|
27
25
|
# incrementally modify your database, and then regenerate this schema definition.
|
data/spec/test-app/db/schema.rb
CHANGED
@@ -16,6 +16,12 @@ RSpec.describe FixDBSchemaConflicts::AutocorrectConfiguration do
|
|
16
16
|
expect(autocorrect_config.load).to eq('.rubocop_schema.49.yml')
|
17
17
|
end
|
18
18
|
|
19
|
+
it 'for versions 0.53.0 and above' do
|
20
|
+
installed_rubocop(version: '0.53.0')
|
21
|
+
|
22
|
+
expect(autocorrect_config.load).to eq('.rubocop_schema.53.yml')
|
23
|
+
end
|
24
|
+
|
19
25
|
def installed_rubocop(version:)
|
20
26
|
allow(Gem).to receive_message_chain(:loaded_specs, :[], :version)
|
21
27
|
.and_return(Gem::Version.new(version))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fix-db-schema-conflicts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jake Moffatt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- ".gitignore"
|
106
106
|
- ".rspec"
|
107
107
|
- ".rubocop_schema.49.yml"
|
108
|
+
- ".rubocop_schema.53.yml"
|
108
109
|
- ".rubocop_schema.yml"
|
109
110
|
- ".travis.yml"
|
110
111
|
- Gemfile
|
@@ -207,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
208
|
version: '0'
|
208
209
|
requirements: []
|
209
210
|
rubyforge_project:
|
210
|
-
rubygems_version: 2.
|
211
|
+
rubygems_version: 2.7.8
|
211
212
|
signing_key:
|
212
213
|
specification_version: 4
|
213
214
|
summary: Helps prevent unneeded db/schema.rb conflicts
|