pronto-rails_migrations 0.10.1 → 0.10.2

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: 8759567be612ea98f5a55432236144a570fb0d577a94669a97544b214e21cd56
4
- data.tar.gz: 70de473bffef3c43636888990c98c4d7089d09a7b7afc88dc1ecb97ffda11a39
3
+ metadata.gz: eeb34528f8fdd5bf1307c0ce5f58dbcbe234a5eb9277a8944b4e5ea5035b0372
4
+ data.tar.gz: 23fbf86083977078f3761aa5036826da35fd071b0b43121d55baae77ee9c7915
5
5
  SHA512:
6
- metadata.gz: 0b8298cff6bffcbe03b1d9dbe07e7927bca866dbfebb879a793da4c141ebf04ace7d11b6a5da506d2747368292de7c64a42cb81305f5199feb73832d756f1f25
7
- data.tar.gz: 80a5db5dd0a0f7f6abee5724902142179b5104ff49c13eaf4c7ab8ce02e13e63c0dd6499ff597ec9aa316af467aa615803eb718df8a51f1529029b7201a533ca
6
+ metadata.gz: 06f66842fb383366a7a72070e2c57427698a886fada5c766d338d1253929dc575d0aa33ea5244356915e5d9272b8accc35f8a1abc7c095b9518d22434a694e0d
7
+ data.tar.gz: 6229ed6b24733ef6beb2dcf7066824c78b54ed07333dc729eda502e08caffe528675d8dee3c600f6113ffd1d72edb26b605a7ea13f2e6e1423f8a203caf11a60
@@ -8,7 +8,7 @@ module Pronto
8
8
  if other_patches?
9
9
  patch = migration_patches.first
10
10
  messages << message(
11
- patch.delta.new_file[:path],
11
+ patch,
12
12
  'Run migrations in a separate PR from application code changes.'
13
13
  )
14
14
  end
@@ -34,7 +34,6 @@ module Pronto
34
34
  patch = structure_sql_patches.first
35
35
  return false unless patch
36
36
 
37
- path = patch.delta.new_file[:path]
38
37
  structure_sql = File.read(patch.new_file_full_path)
39
38
  inserts = structure_sql.split("\n").grep(/\('\d+'\)/)
40
39
  unordered_inserts = (inserts.sort != inserts)
@@ -48,24 +47,26 @@ module Pronto
48
47
 
49
48
  if unordered_inserts
50
49
  messages << message(
51
- path,
50
+ patch,
52
51
  '`schema_migrations` insert values are not ordered by timestamp.'
53
52
  )
54
53
  end
55
54
  if bad_semicolons
56
55
  messages << message(
57
- path,
56
+ patch,
58
57
  '`schema_migrations` inserts must end with comma (`,`), ' \
59
58
  'last insert must end with semicolon (`;`).'
60
59
  )
61
60
  end
62
- messages << message(path, '`db/structure.sql` must end with 2 empty lines.') if bad_ending
61
+ messages << message(patch, '`db/structure.sql` must end with 2 empty lines.') if bad_ending
63
62
 
64
63
  messages
65
64
  end
66
65
 
67
- def message(path, text)
68
- Message.new(path, nil, :warning, text, nil, self.class)
66
+ def message(patch, text)
67
+ path = patch.delta.new_file[:path]
68
+ line = patch.added_lines.first
69
+ Message.new(path, line, :warning, text, nil, self.class)
69
70
  end
70
71
 
71
72
  def structure_sql_patches
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "pronto-rails_migrations"
7
- spec.version = '0.10.1'
7
+ spec.version = '0.10.2'
8
8
  spec.authors = ["Tomas Varneckas"]
9
9
  spec.email = ["t.varneckas@gmail.com"]
10
10
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pronto-rails_migrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Varneckas