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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20658faa1cdd6ae16c25dd7a9b2b85b608f81e2da8ffeb74f8f692ad5c8eb6cb
|
4
|
+
data.tar.gz: 7a6c555f10de5253af9744eea4ada2c95525dd127d081e939ffa6ad6c4923bab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95ff5510806f67c8e612c488c608f2685e1abebbb3ecba455e706db34a104ab9c1135cac0193692884a7cb9f61301c91e0a27ea07d61eb08a3b89ca3dd5d952d
|
7
|
+
data.tar.gz: 75a78627604fec92c8fd3703c70fa35e125139e188adf1d8592a480fcef44a50a6b4f670f2eaae139dd07c03ca397745b437d44fcdc35f96ea44b41aaaab6b7d
|
data/bin/database_consistency
CHANGED
@@ -1,9 +1,25 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
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
|
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.
|
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
|
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
|