database_consistency 0.8.0 → 0.8.1

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: 4f029e8151f93b3824ea0ba0b7cb0eff4d2a1d22dc76597da6169957bffb7611
4
- data.tar.gz: b05b3a118134910eabdbf26a936185ad2cfc45df3417b7d8fad3b0f03d505466
3
+ metadata.gz: 20658faa1cdd6ae16c25dd7a9b2b85b608f81e2da8ffeb74f8f692ad5c8eb6cb
4
+ data.tar.gz: 7a6c555f10de5253af9744eea4ada2c95525dd127d081e939ffa6ad6c4923bab
5
5
  SHA512:
6
- metadata.gz: '05827f5dbbbb745ff76721881eb78669492a3fbadc3949362076b50736f61f0fa1a6c1750780098a12e6fb61389a8e75deb05603e7a3a4c6d7269f3bad3ba78e'
7
- data.tar.gz: 57796525845caf0652456e5141ec464146b3fd88ddb44ad51247b2a497b0afd108585edea38489c21da59055ffd5045f11e713e64a9e2107fdbe5b213d4d783f
6
+ metadata.gz: 95ff5510806f67c8e612c488c608f2685e1abebbb3ecba455e706db34a104ab9c1135cac0193692884a7cb9f61301c91e0a27ea07d61eb08a3b89ca3dd5d952d
7
+ data.tar.gz: 75a78627604fec92c8fd3703c70fa35e125139e188adf1d8592a480fcef44a50a6b4f670f2eaae139dd07c03ca397745b437d44fcdc35f96ea44b41aaaab6b7d
@@ -1,9 +1,25 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- base_dir = File.join(Dir.pwd, ARGV.first.to_s)
4
-
5
- unless File.realpath(base_dir).start_with?(Dir.pwd)
6
- puts "\nWarning! You are going out of current directory, ruby version may be wrong and some gems may be missing.\n"
3
+ if ARGV.include?('install')
4
+ require_relative '../lib/database_consistency/configuration'
5
+ config_filename = DatabaseConsistency::Configuration::CONFIGURATION_PATH
6
+ file_exists = File.exists?(config_filename)
7
+ rules = Pathname.new(__FILE__).dirname.join('..', 'lib', 'database_consistency', 'templates', 'rails_defaults.yml').read
8
+ if file_exists && File.foreach(config_filename).grep(Regexp.new(rules.lines.first.chomp)).any?
9
+ puts "#{config_filename} is already present"
10
+ else
11
+ File.open(config_filename, 'a') do |file|
12
+ file << "\n" * 2 if file_exists
13
+ file << rules
14
+ end
15
+ puts "#{config_filename} #{file_exists ? 'updated' : 'added'}"
16
+ end
17
+ exit 0
18
+ else
19
+ base_dir = File.join(Dir.pwd, ARGV.first.to_s)
20
+ unless File.realpath(base_dir).start_with?(Dir.pwd)
21
+ puts "\nWarning! You are going out of current directory, ruby version may be wrong and some gems may be missing.\n"
22
+ end
7
23
  end
8
24
 
9
25
  # Load Rails project
@@ -0,0 +1,7 @@
1
+ # Ignore false positive from Rails' ActionText and ActiveStorage
2
+ ActionText::RichText:
3
+ enabled: false
4
+ ActiveStorage::Attachment:
5
+ enabled: false
6
+ ActiveStorage::Blob:
7
+ enabled: false
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DatabaseConsistency
4
- VERSION = '0.8.0'
4
+ VERSION = '0.8.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: database_consistency
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeniy Demin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-02 00:00:00.000000000 Z
11
+ date: 2020-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -152,6 +152,7 @@ files:
152
152
  - lib/database_consistency/processors/validators_fractions_processor.rb
153
153
  - lib/database_consistency/processors/validators_processor.rb
154
154
  - lib/database_consistency/rescue_error.rb
155
+ - lib/database_consistency/templates/rails_defaults.yml
155
156
  - lib/database_consistency/version.rb
156
157
  - lib/database_consistency/writers/base_writer.rb
157
158
  - lib/database_consistency/writers/simple_writer.rb