care_bert 0.0.4 → 0.0.5

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
  SHA1:
3
- metadata.gz: e4360ea65357b5b0a8376982c62ebfc2433ffca1
4
- data.tar.gz: 8c421c3292fb62e1dc22c6bf2f21802a3735d719
3
+ metadata.gz: 025907a2acbc643e76e7466fb368e56838ae8ede
4
+ data.tar.gz: 9e626acd9dfd0bbd65329d0fe57088d987c24f28
5
5
  SHA512:
6
- metadata.gz: 7463f6663af5c90f66ed5305973ae44c7283100c8b6c749e9bd981c389c6c48b9aef762fb9f8b913fd5df2770f456523cd3b7eb468ec6271026ae39ff2ad965d
7
- data.tar.gz: e1d19b5b670e98d6e69df89b22c2cc41a1fa9866310eec7b1dae33a1f7bb466c1ccf5ab2c4e3f89fa36f3de3bd9532c329a8704a46835313cc62e62eb61c7b52
6
+ metadata.gz: bd86b1d6edecbc6ec9187db23de71172b429994318945fbdcb86465d912b3a2daa7d028c5150fa4371923618a5aff81503184762facafa77ccdceaeb4ae6a392
7
+ data.tar.gz: e7c5941b54edfb81a98fddba088fca19751788e8f7bf975215705c9ee0f2c9f521185d8b1b126859cfd852e0b2c3fc94433d27b6bfce54163ab549b5f1fab91e
@@ -6,7 +6,9 @@ module CareBert
6
6
 
7
7
  chunk_size = CareBert::Configuration::CHUNK_SIZE
8
8
 
9
- Dir.glob(Rails.root.join('/app/models/**/*.rb')).each { |file| require file }
9
+ # Load Model definitions
10
+ Rails.application.eager_load!
11
+
10
12
  ActiveRecord::Base.descendants.select { |c| c.base_class == c }.sort_by(&:name).each do |klass|
11
13
  total = klass.count
12
14
 
@@ -36,7 +38,9 @@ module CareBert
36
38
 
37
39
  chunk_size = CareBert::Configuration::CHUNK_SIZE
38
40
 
39
- Dir.glob(Rails.root.join('/app/models/**/*.rb')).each { |file| require file }
41
+ # Load Model definitions
42
+ Rails.application.eager_load!
43
+
40
44
  ActiveRecord::Base.descendants.select { |c| c.base_class == c }.sort_by(&:name).each do |klass|
41
45
  result[klass.name] = {
42
46
  total: klass.count,
@@ -70,7 +74,9 @@ module CareBert
70
74
 
71
75
  chunk_size = CareBert::Configuration::CHUNK_SIZE
72
76
 
73
- Dir.glob(Rails.root.join('/app/models/**/*.rb')).each { |file| require file }
77
+ # Load Model definitions
78
+ Rails.application.eager_load!
79
+
74
80
  ActiveRecord::Base.descendants.select { |c| c.base_class == c }.sort_by(&:name).each do |klass|
75
81
  result[klass.name] = {
76
82
  total: klass.count,
@@ -1,3 +1,3 @@
1
1
  module CareBert
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
@@ -9,6 +9,9 @@ require 'care_bert'
9
9
  # file: validate_models.rake
10
10
  # task: rake db:validate_models
11
11
  namespace :care_bert do
12
+
13
+
14
+
12
15
  desc 'Run model validations on all model records in database'
13
16
  task validate_models: :environment do
14
17
  # ANALYZE all
@@ -29,3 +32,14 @@ namespace :care_bert do
29
32
  end
30
33
 
31
34
  end
35
+
36
+ task :care_bert do
37
+ require 'spinner.rb'
38
+
39
+ spinner = Spinner.new
40
+ spinner.task('Checking table integrity', 'care_bert:table_integrity')
41
+ spinner.task('Validating all models', 'care_bert:validate_models')
42
+ spinner.task('Checking presence of all associations', 'care_bert:missing_assocs')
43
+ # TODO print out catched outputs
44
+ spinner.spin!
45
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: care_bert
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Loy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-22 00:00:00.000000000 Z
11
+ date: 2015-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: spinner.rb
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.3'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.3'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: sqlite3
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -132,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
146
  version: '0'
133
147
  requirements: []
134
148
  rubyforge_project:
135
- rubygems_version: 2.4.2
149
+ rubygems_version: 2.4.5
136
150
  signing_key:
137
151
  specification_version: 4
138
152
  summary: CareBert takes care of the validation state of your current database items
@@ -174,3 +188,4 @@ test_files:
174
188
  - test/dummy/Rakefile
175
189
  - test/dummy/README.rdoc
176
190
  - test/test_helper.rb
191
+ has_rdoc: