database_consistency 0.6.3 → 0.6.4

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: 5838553640c9936a64b3b4d57cf07a8f906ad2898a08cfa9e35dd335601c55fa
4
- data.tar.gz: e7bcff327c307641b5841a569e89595f3df09dcc1291c1626ec4defb8f529143
3
+ metadata.gz: 86e5667ae277f41bb7a4e1125b7058680e236bee30b10bd43a56ae3c1b608c2a
4
+ data.tar.gz: b72491a32de3e10f9ac92f1b711ec5c412776be44bb8f54502420be21ed2299d
5
5
  SHA512:
6
- metadata.gz: e585ce47867455350dc2e23cb6316318272171ba2cf43ff24b3e83e80263bba515aafc66209d982ab7bc857831613850608cd3305ce4ceb37412450c5a27b084
7
- data.tar.gz: 707be00b640e0f1c95ca7f6a192edb684513c6fd872ad0efbf58e869754dfc12d1e6471dc54bc81e7bce6c5174473f4529896cfcf7949b66c5a3593e6aef7884
6
+ metadata.gz: 40cde48b836130ccfe120ea2826260a794bc35edcca1ec24622b2f92066597d679a6132dc64904311cc655e0756eab82bb1fd92f6c6f4e821a3f27c3d4185b7e
7
+ data.tar.gz: 8ed3b4f6e41c29f9d37323b6c8ecc79dc7d34cfe6eaa5c80982ec51d9fb61b58e520c1a809a0e63c1ef3a13627b5ff8fd1c99f3d38f6625bf7b7d9fec9ac2caf
@@ -6,6 +6,7 @@ unless File.realpath(base_dir).start_with?(Dir.pwd)
6
6
  puts "\nWarning! You are going out of current directory, ruby version may be wrong and some gems may be missing.\n"
7
7
  end
8
8
 
9
+ # Load Rails project
9
10
  begin
10
11
  require File.join(base_dir, 'config', 'boot')
11
12
  require File.join(base_dir, 'config', 'environment')
@@ -14,8 +15,17 @@ rescue LoadError
14
15
  raise
15
16
  end
16
17
 
18
+ # Load Rails models
19
+ Rails.application.eager_load! if defined?(Rails)
20
+
21
+ # Require the gem
17
22
  $LOAD_PATH.unshift(File.expand_path('lib', __dir__))
18
23
  require 'database_consistency'
19
24
 
25
+ # Welcome message
26
+ puts 'Thank you for using the gem. Any contribution is welcome https://github.com/djezzzl/database_consistency!'
27
+ puts "(c) Evgeniy Demin <lawliet.djez@gmail.com>\n\n"
28
+
29
+ # Process checks
20
30
  result = DatabaseConsistency.run
21
31
  exit result
@@ -5,11 +5,6 @@ module DatabaseConsistency
5
5
  module Helper
6
6
  module_function
7
7
 
8
- def welcome_message!
9
- puts 'Thank you for using the gem. Any contribution is welcome https://github.com/djezzzl/database_consistency!'
10
- puts '(c) Evgeniy Demin <lawliet.djez@gmail.com>'
11
- end
12
-
13
8
  # Returns list of models to check
14
9
  def models
15
10
  ActiveRecord::Base.descendants.delete_if(&:abstract_class?)
@@ -22,11 +17,6 @@ module DatabaseConsistency
22
17
  end
23
18
  end
24
19
 
25
- # Loads all models
26
- def load_environment!
27
- Rails.application.eager_load! if defined?(Rails)
28
- end
29
-
30
20
  # @return [Boolean]
31
21
  def check_inclusion?(array, element)
32
22
  array.include?(element.to_s) || array.include?(element.to_sym)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DatabaseConsistency
4
- VERSION = '0.6.3'
4
+ VERSION = '0.6.4'
5
5
  end
@@ -30,9 +30,6 @@ require 'database_consistency/processors/columns_processor'
30
30
  module DatabaseConsistency
31
31
  class << self
32
32
  def run
33
- Helper.welcome_message!
34
- Helper.load_environment!
35
-
36
33
  configuration = Configuration.new
37
34
  reports = Processors.reports(configuration)
38
35
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: database_consistency
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeniy Demin