pronto-rails_schema 0.5.0 → 0.6.0
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/README.md +2 -0
- data/lib/pronto/rails_schema.rb +16 -12
- data/lib/pronto/rails_schema/version.rb +1 -1
- data/pronto-rails_schema.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a791d0ec72059f102b4c6f632b340cf8138bede
|
4
|
+
data.tar.gz: 152ce45fed3689b7e34ec51191d2374acba87fea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32d1ef3147db97068f6c24d093bcc5fbb6d176c5fb5fa5d521a9ae89fe13ecbffa5365d76adffe0f7ff4edcea484bf410c5d69be3f3e29342e7bae1d8a6d6beb
|
7
|
+
data.tar.gz: 145d097760d97772b819dd62358eda5623a9d56ccb1d6c0332cfc9ed9d434152b6f6201df57c59ad13b0313ded63755ccf175374856de001ad78136258ce3f4a
|
data/README.md
CHANGED
@@ -4,3 +4,5 @@ Pronto runner for monitoring Rails schema.rb or structure.sql consistency.
|
|
4
4
|
Tool prints a warning message when migration is present
|
5
5
|
but there are no modifications in schema.rb or structure.sql.
|
6
6
|
[What is Pronto?](https://github.com/mmozuras/pronto)
|
7
|
+
|
8
|
+
[](https://badge.fury.io/rb/pronto-rails_schema)
|
data/lib/pronto/rails_schema.rb
CHANGED
@@ -2,22 +2,19 @@ require 'pronto'
|
|
2
2
|
|
3
3
|
module Pronto
|
4
4
|
class RailsSchema < Runner
|
5
|
-
def run
|
6
|
-
return [] unless patches
|
7
|
-
|
8
|
-
migration_patches = patches
|
9
|
-
.select { |patch| detect_added_migration_file(patch) }
|
5
|
+
def run
|
10
6
|
return [] unless migration_patches.any?
|
11
7
|
|
12
8
|
if schema_file_present?
|
13
|
-
schema_patch = patches.find { |patch| detect_schema_file(patch.new_file_full_path) }
|
14
|
-
return generate_messages_for(
|
9
|
+
schema_patch = @patches.find { |patch| detect_schema_file(patch.new_file_full_path) }
|
10
|
+
return generate_messages_for('schema.rb') unless changes_detected?(schema_patch)
|
15
11
|
end
|
16
12
|
|
17
13
|
if structure_file_present?
|
18
|
-
structure_patch = patches.find { |patch| detect_structure_file(patch.new_file_full_path) }
|
19
|
-
return generate_messages_for(
|
14
|
+
structure_patch = @patches.find { |patch| detect_structure_file(patch.new_file_full_path) }
|
15
|
+
return generate_messages_for('structure.sql') unless changes_detected?(structure_patch)
|
20
16
|
end
|
17
|
+
|
21
18
|
[]
|
22
19
|
end
|
23
20
|
|
@@ -31,10 +28,17 @@ module Pronto
|
|
31
28
|
File.exists?('db/structure.sql')
|
32
29
|
end
|
33
30
|
|
34
|
-
def
|
35
|
-
|
31
|
+
def migration_patches
|
32
|
+
return [] unless @patches
|
33
|
+
@migration_patches ||= @patches
|
34
|
+
.select { |patch| detect_added_migration_file(patch) }
|
35
|
+
end
|
36
|
+
|
37
|
+
def generate_messages_for(target)
|
38
|
+
migration_patches.map do |patch|
|
36
39
|
Message.new(patch.delta.new_file[:path], nil, :warning,
|
37
|
-
"Migration file detected, but no changes in #{target}"
|
40
|
+
"Migration file detected, but no changes in #{target}",
|
41
|
+
nil, self.class)
|
38
42
|
end
|
39
43
|
end
|
40
44
|
|
data/pronto-rails_schema.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
|
-
spec.add_dependency 'pronto', '~> 0.
|
23
|
+
spec.add_dependency 'pronto', '~> 0.6.0 '
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.10"
|
25
25
|
spec.add_development_dependency "rake", "~> 10.0"
|
26
26
|
spec.add_development_dependency "rspec", "~> 3.3"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pronto-rails_schema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Raimondas Valickas
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pronto
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.6.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.6.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|