active_record_schema_scrapper 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +9 -3
- data/Appraisals +5 -0
- data/Gemfile +1 -1
- data/active_record_schema_scrapper.gemspec +3 -2
- data/gemfiles/activerecord_4.0.gemfile +1 -1
- data/gemfiles/activerecord_4.0.gemfile.lock +19 -17
- data/gemfiles/activerecord_4.1.gemfile +1 -1
- data/gemfiles/activerecord_4.1.gemfile.lock +19 -17
- data/gemfiles/activerecord_4.2.gemfile +8 -0
- data/gemfiles/activerecord_4.2.gemfile.lock +92 -0
- data/gemfiles/activerecord_5.gemfile +9 -0
- data/gemfiles/activerecord_5.gemfile.lock +91 -0
- data/lib/active_record_schema_scrapper.rb +1 -0
- data/lib/active_record_schema_scrapper/associations.rb +13 -7
- data/lib/active_record_schema_scrapper/attributes.rb +12 -10
- data/lib/active_record_schema_scrapper/object_error.rb +23 -0
- data/lib/active_record_schema_scrapper/version.rb +1 -1
- metadata +36 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef33781189d4aa1c90773b52cdd1179945a8d2c8
|
4
|
+
data.tar.gz: e0843604a1056ba0fd29f83d571c9166b94af1bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0d78d6b35ced6f3135ef9e6020a3a8c97502416941794714e51163dace28e03b91c9d39d5f12330fe57324a6c6d42627f82e6cde14d10ca4890fec3cb802fab
|
7
|
+
data.tar.gz: a1b1240a0c741dbf9c19efcf183a4ffa462bbc0d5a3264a377ae554ad530d2e50b4113f167f8bf8a8a342b102fff2a55461ad39cf7f9d6c4e518af938d12de2d
|
data/.travis.yml
CHANGED
@@ -1,8 +1,14 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- 2.1.
|
4
|
-
- 2.2.
|
3
|
+
- 2.1.8
|
4
|
+
- 2.2.5
|
5
|
+
- 2.3.1
|
5
6
|
gemfile:
|
6
7
|
- gemfiles/activerecord_4.0.gemfile
|
7
8
|
- gemfiles/activerecord_4.1.gemfile
|
8
|
-
-
|
9
|
+
- gemfiles/activerecord_4.2.gemfile
|
10
|
+
- gemfiles/activerecord_5.gemfile
|
11
|
+
matrix:
|
12
|
+
exclude:
|
13
|
+
- rvm: 2.1.8
|
14
|
+
gemfile: gemfiles/activerecord_5.gemfile
|
data/Appraisals
CHANGED
data/Gemfile
CHANGED
@@ -19,11 +19,12 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
+
spec.add_runtime_dependency "activerecord", ">= 4.0", "<= 5.9"
|
22
23
|
spec.add_runtime_dependency "virtus", "~> 1.0"
|
23
24
|
spec.add_development_dependency "bundler", "~> 1.9"
|
24
|
-
spec.add_development_dependency "rake", "
|
25
|
+
spec.add_development_dependency "rake", ">= 10.0"
|
25
26
|
spec.add_development_dependency "rspec", "~> 3.4"
|
26
27
|
spec.add_development_dependency "sqlite3", "~>1.3"
|
27
|
-
spec.add_development_dependency "activerecord", "~>4.2"
|
28
28
|
spec.add_development_dependency "appraisal", "~> 2.0"
|
29
|
+
spec.add_development_dependency "codeclimate-test-reporter", "~> 0.5"
|
29
30
|
end
|
@@ -1,20 +1,21 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../
|
3
3
|
specs:
|
4
|
-
active_record_schema_scrapper (0.2.
|
4
|
+
active_record_schema_scrapper (0.2.2)
|
5
|
+
activerecord (>= 4.0, <= 5.9)
|
5
6
|
virtus (~> 1.0)
|
6
7
|
|
7
8
|
GEM
|
8
9
|
remote: https://rubygems.org/
|
9
10
|
specs:
|
10
|
-
activemodel (4.2.
|
11
|
-
activesupport (= 4.2.
|
11
|
+
activemodel (4.2.6)
|
12
|
+
activesupport (= 4.2.6)
|
12
13
|
builder (~> 3.1)
|
13
|
-
activerecord (4.2.
|
14
|
-
activemodel (= 4.2.
|
15
|
-
activesupport (= 4.2.
|
14
|
+
activerecord (4.2.6)
|
15
|
+
activemodel (= 4.2.6)
|
16
|
+
activesupport (= 4.2.6)
|
16
17
|
arel (~> 6.0)
|
17
|
-
activesupport (4.2.
|
18
|
+
activesupport (4.2.6)
|
18
19
|
i18n (~> 0.7)
|
19
20
|
json (~> 1.7, >= 1.7.7)
|
20
21
|
minitest (~> 5.1)
|
@@ -30,7 +31,7 @@ GEM
|
|
30
31
|
ice_nine (~> 0.11.0)
|
31
32
|
thread_safe (~> 0.3, >= 0.3.1)
|
32
33
|
builder (3.2.2)
|
33
|
-
codeclimate-test-reporter (0.
|
34
|
+
codeclimate-test-reporter (0.5.0)
|
34
35
|
simplecov (>= 0.7.1, < 1.0.0)
|
35
36
|
coercible (1.0.0)
|
36
37
|
descendants_tracker (~> 0.0.1)
|
@@ -40,24 +41,24 @@ GEM
|
|
40
41
|
docile (1.1.5)
|
41
42
|
equalizer (0.0.11)
|
42
43
|
i18n (0.7.0)
|
43
|
-
ice_nine (0.11.
|
44
|
+
ice_nine (0.11.2)
|
44
45
|
json (1.8.3)
|
45
|
-
minitest (5.8.
|
46
|
-
rake (
|
46
|
+
minitest (5.8.4)
|
47
|
+
rake (11.1.2)
|
47
48
|
rspec (3.4.0)
|
48
49
|
rspec-core (~> 3.4.0)
|
49
50
|
rspec-expectations (~> 3.4.0)
|
50
51
|
rspec-mocks (~> 3.4.0)
|
51
|
-
rspec-core (3.4.
|
52
|
+
rspec-core (3.4.4)
|
52
53
|
rspec-support (~> 3.4.0)
|
53
54
|
rspec-expectations (3.4.0)
|
54
55
|
diff-lcs (>= 1.2.0, < 2.0)
|
55
56
|
rspec-support (~> 3.4.0)
|
56
|
-
rspec-mocks (3.4.
|
57
|
+
rspec-mocks (3.4.1)
|
57
58
|
diff-lcs (>= 1.2.0, < 2.0)
|
58
59
|
rspec-support (~> 3.4.0)
|
59
60
|
rspec-support (3.4.1)
|
60
|
-
simplecov (0.
|
61
|
+
simplecov (0.11.2)
|
61
62
|
docile (~> 1.1.0)
|
62
63
|
json (~> 1.8)
|
63
64
|
simplecov-html (~> 0.10.0)
|
@@ -81,10 +82,11 @@ DEPENDENCIES
|
|
81
82
|
activerecord (~> 4.0)
|
82
83
|
appraisal (~> 2.0)
|
83
84
|
bundler (~> 1.9)
|
84
|
-
codeclimate-test-reporter
|
85
|
-
rake (
|
85
|
+
codeclimate-test-reporter (~> 0.5)
|
86
|
+
rake (>= 10.0)
|
86
87
|
rspec (~> 3.4)
|
87
88
|
sqlite3 (~> 1.3)
|
89
|
+
virtus (~> 1.0)
|
88
90
|
|
89
91
|
BUNDLED WITH
|
90
|
-
1.
|
92
|
+
1.11.2
|
@@ -1,20 +1,21 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../
|
3
3
|
specs:
|
4
|
-
active_record_schema_scrapper (0.2.
|
4
|
+
active_record_schema_scrapper (0.2.2)
|
5
|
+
activerecord (>= 4.0, <= 5.9)
|
5
6
|
virtus (~> 1.0)
|
6
7
|
|
7
8
|
GEM
|
8
9
|
remote: https://rubygems.org/
|
9
10
|
specs:
|
10
|
-
activemodel (4.2.
|
11
|
-
activesupport (= 4.2.
|
11
|
+
activemodel (4.2.6)
|
12
|
+
activesupport (= 4.2.6)
|
12
13
|
builder (~> 3.1)
|
13
|
-
activerecord (4.2.
|
14
|
-
activemodel (= 4.2.
|
15
|
-
activesupport (= 4.2.
|
14
|
+
activerecord (4.2.6)
|
15
|
+
activemodel (= 4.2.6)
|
16
|
+
activesupport (= 4.2.6)
|
16
17
|
arel (~> 6.0)
|
17
|
-
activesupport (4.2.
|
18
|
+
activesupport (4.2.6)
|
18
19
|
i18n (~> 0.7)
|
19
20
|
json (~> 1.7, >= 1.7.7)
|
20
21
|
minitest (~> 5.1)
|
@@ -30,7 +31,7 @@ GEM
|
|
30
31
|
ice_nine (~> 0.11.0)
|
31
32
|
thread_safe (~> 0.3, >= 0.3.1)
|
32
33
|
builder (3.2.2)
|
33
|
-
codeclimate-test-reporter (0.
|
34
|
+
codeclimate-test-reporter (0.5.0)
|
34
35
|
simplecov (>= 0.7.1, < 1.0.0)
|
35
36
|
coercible (1.0.0)
|
36
37
|
descendants_tracker (~> 0.0.1)
|
@@ -40,24 +41,24 @@ GEM
|
|
40
41
|
docile (1.1.5)
|
41
42
|
equalizer (0.0.11)
|
42
43
|
i18n (0.7.0)
|
43
|
-
ice_nine (0.11.
|
44
|
+
ice_nine (0.11.2)
|
44
45
|
json (1.8.3)
|
45
|
-
minitest (5.8.
|
46
|
-
rake (
|
46
|
+
minitest (5.8.4)
|
47
|
+
rake (11.1.2)
|
47
48
|
rspec (3.4.0)
|
48
49
|
rspec-core (~> 3.4.0)
|
49
50
|
rspec-expectations (~> 3.4.0)
|
50
51
|
rspec-mocks (~> 3.4.0)
|
51
|
-
rspec-core (3.4.
|
52
|
+
rspec-core (3.4.4)
|
52
53
|
rspec-support (~> 3.4.0)
|
53
54
|
rspec-expectations (3.4.0)
|
54
55
|
diff-lcs (>= 1.2.0, < 2.0)
|
55
56
|
rspec-support (~> 3.4.0)
|
56
|
-
rspec-mocks (3.4.
|
57
|
+
rspec-mocks (3.4.1)
|
57
58
|
diff-lcs (>= 1.2.0, < 2.0)
|
58
59
|
rspec-support (~> 3.4.0)
|
59
60
|
rspec-support (3.4.1)
|
60
|
-
simplecov (0.
|
61
|
+
simplecov (0.11.2)
|
61
62
|
docile (~> 1.1.0)
|
62
63
|
json (~> 1.8)
|
63
64
|
simplecov-html (~> 0.10.0)
|
@@ -81,10 +82,11 @@ DEPENDENCIES
|
|
81
82
|
activerecord (~> 4.1)
|
82
83
|
appraisal (~> 2.0)
|
83
84
|
bundler (~> 1.9)
|
84
|
-
codeclimate-test-reporter
|
85
|
-
rake (
|
85
|
+
codeclimate-test-reporter (~> 0.5)
|
86
|
+
rake (>= 10.0)
|
86
87
|
rspec (~> 3.4)
|
87
88
|
sqlite3 (~> 1.3)
|
89
|
+
virtus (~> 1.0)
|
88
90
|
|
89
91
|
BUNDLED WITH
|
90
|
-
1.
|
92
|
+
1.11.2
|
@@ -0,0 +1,92 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../
|
3
|
+
specs:
|
4
|
+
active_record_schema_scrapper (0.2.2)
|
5
|
+
activerecord (>= 4.0, <= 5.9)
|
6
|
+
virtus (~> 1.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
activemodel (4.2.6)
|
12
|
+
activesupport (= 4.2.6)
|
13
|
+
builder (~> 3.1)
|
14
|
+
activerecord (4.2.6)
|
15
|
+
activemodel (= 4.2.6)
|
16
|
+
activesupport (= 4.2.6)
|
17
|
+
arel (~> 6.0)
|
18
|
+
activesupport (4.2.6)
|
19
|
+
i18n (~> 0.7)
|
20
|
+
json (~> 1.7, >= 1.7.7)
|
21
|
+
minitest (~> 5.1)
|
22
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
23
|
+
tzinfo (~> 1.1)
|
24
|
+
appraisal (2.1.0)
|
25
|
+
bundler
|
26
|
+
rake
|
27
|
+
thor (>= 0.14.0)
|
28
|
+
arel (6.0.3)
|
29
|
+
axiom-types (0.1.1)
|
30
|
+
descendants_tracker (~> 0.0.4)
|
31
|
+
ice_nine (~> 0.11.0)
|
32
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
33
|
+
builder (3.2.2)
|
34
|
+
codeclimate-test-reporter (0.5.0)
|
35
|
+
simplecov (>= 0.7.1, < 1.0.0)
|
36
|
+
coercible (1.0.0)
|
37
|
+
descendants_tracker (~> 0.0.1)
|
38
|
+
descendants_tracker (0.0.4)
|
39
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
40
|
+
diff-lcs (1.2.5)
|
41
|
+
docile (1.1.5)
|
42
|
+
equalizer (0.0.11)
|
43
|
+
i18n (0.7.0)
|
44
|
+
ice_nine (0.11.2)
|
45
|
+
json (1.8.3)
|
46
|
+
minitest (5.8.4)
|
47
|
+
rake (11.1.2)
|
48
|
+
rspec (3.4.0)
|
49
|
+
rspec-core (~> 3.4.0)
|
50
|
+
rspec-expectations (~> 3.4.0)
|
51
|
+
rspec-mocks (~> 3.4.0)
|
52
|
+
rspec-core (3.4.4)
|
53
|
+
rspec-support (~> 3.4.0)
|
54
|
+
rspec-expectations (3.4.0)
|
55
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
56
|
+
rspec-support (~> 3.4.0)
|
57
|
+
rspec-mocks (3.4.1)
|
58
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
59
|
+
rspec-support (~> 3.4.0)
|
60
|
+
rspec-support (3.4.1)
|
61
|
+
simplecov (0.11.2)
|
62
|
+
docile (~> 1.1.0)
|
63
|
+
json (~> 1.8)
|
64
|
+
simplecov-html (~> 0.10.0)
|
65
|
+
simplecov-html (0.10.0)
|
66
|
+
sqlite3 (1.3.11)
|
67
|
+
thor (0.19.1)
|
68
|
+
thread_safe (0.3.5)
|
69
|
+
tzinfo (1.2.2)
|
70
|
+
thread_safe (~> 0.1)
|
71
|
+
virtus (1.0.5)
|
72
|
+
axiom-types (~> 0.1)
|
73
|
+
coercible (~> 1.0)
|
74
|
+
descendants_tracker (~> 0.0, >= 0.0.3)
|
75
|
+
equalizer (~> 0.0, >= 0.0.9)
|
76
|
+
|
77
|
+
PLATFORMS
|
78
|
+
ruby
|
79
|
+
|
80
|
+
DEPENDENCIES
|
81
|
+
active_record_schema_scrapper!
|
82
|
+
activerecord (~> 4.2)
|
83
|
+
appraisal (~> 2.0)
|
84
|
+
bundler (~> 1.9)
|
85
|
+
codeclimate-test-reporter (~> 0.5)
|
86
|
+
rake (>= 10.0)
|
87
|
+
rspec (~> 3.4)
|
88
|
+
sqlite3 (~> 1.3)
|
89
|
+
virtus (~> 1.0)
|
90
|
+
|
91
|
+
BUNDLED WITH
|
92
|
+
1.11.2
|
@@ -0,0 +1,91 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../
|
3
|
+
specs:
|
4
|
+
active_record_schema_scrapper (0.2.2)
|
5
|
+
activerecord (>= 4.0, <= 5.9)
|
6
|
+
virtus (~> 1.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
activemodel (5.0.0.beta4)
|
12
|
+
activesupport (= 5.0.0.beta4)
|
13
|
+
activerecord (5.0.0.beta4)
|
14
|
+
activemodel (= 5.0.0.beta4)
|
15
|
+
activesupport (= 5.0.0.beta4)
|
16
|
+
arel (~> 7.0)
|
17
|
+
activesupport (5.0.0.beta4)
|
18
|
+
concurrent-ruby (~> 1.0)
|
19
|
+
i18n (~> 0.7)
|
20
|
+
minitest (~> 5.1)
|
21
|
+
tzinfo (~> 1.1)
|
22
|
+
appraisal (2.1.0)
|
23
|
+
bundler
|
24
|
+
rake
|
25
|
+
thor (>= 0.14.0)
|
26
|
+
arel (7.0.0)
|
27
|
+
axiom-types (0.1.1)
|
28
|
+
descendants_tracker (~> 0.0.4)
|
29
|
+
ice_nine (~> 0.11.0)
|
30
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
31
|
+
codeclimate-test-reporter (0.5.0)
|
32
|
+
simplecov (>= 0.7.1, < 1.0.0)
|
33
|
+
coercible (1.0.0)
|
34
|
+
descendants_tracker (~> 0.0.1)
|
35
|
+
concurrent-ruby (1.0.1)
|
36
|
+
descendants_tracker (0.0.4)
|
37
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
38
|
+
diff-lcs (1.2.5)
|
39
|
+
docile (1.1.5)
|
40
|
+
equalizer (0.0.11)
|
41
|
+
i18n (0.7.0)
|
42
|
+
ice_nine (0.11.2)
|
43
|
+
json (1.8.3)
|
44
|
+
minitest (5.8.4)
|
45
|
+
rake (11.1.2)
|
46
|
+
rspec (3.4.0)
|
47
|
+
rspec-core (~> 3.4.0)
|
48
|
+
rspec-expectations (~> 3.4.0)
|
49
|
+
rspec-mocks (~> 3.4.0)
|
50
|
+
rspec-core (3.4.4)
|
51
|
+
rspec-support (~> 3.4.0)
|
52
|
+
rspec-expectations (3.4.0)
|
53
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
54
|
+
rspec-support (~> 3.4.0)
|
55
|
+
rspec-mocks (3.4.1)
|
56
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
57
|
+
rspec-support (~> 3.4.0)
|
58
|
+
rspec-support (3.4.1)
|
59
|
+
simplecov (0.11.2)
|
60
|
+
docile (~> 1.1.0)
|
61
|
+
json (~> 1.8)
|
62
|
+
simplecov-html (~> 0.10.0)
|
63
|
+
simplecov-html (0.10.0)
|
64
|
+
sqlite3 (1.3.11)
|
65
|
+
thor (0.19.1)
|
66
|
+
thread_safe (0.3.5)
|
67
|
+
tzinfo (1.2.2)
|
68
|
+
thread_safe (~> 0.1)
|
69
|
+
virtus (1.0.5)
|
70
|
+
axiom-types (~> 0.1)
|
71
|
+
coercible (~> 1.0)
|
72
|
+
descendants_tracker (~> 0.0, >= 0.0.3)
|
73
|
+
equalizer (~> 0.0, >= 0.0.9)
|
74
|
+
|
75
|
+
PLATFORMS
|
76
|
+
ruby
|
77
|
+
|
78
|
+
DEPENDENCIES
|
79
|
+
active_record_schema_scrapper!
|
80
|
+
activerecord (= 5.0.0.beta4)
|
81
|
+
activesupport (= 5.0.0.beta4)
|
82
|
+
appraisal (~> 2.0)
|
83
|
+
bundler (~> 1.9)
|
84
|
+
codeclimate-test-reporter (~> 0.5)
|
85
|
+
rake (>= 10.0)
|
86
|
+
rspec (~> 3.4)
|
87
|
+
sqlite3 (~> 1.3)
|
88
|
+
virtus (~> 1.0)
|
89
|
+
|
90
|
+
BUNDLED WITH
|
91
|
+
1.11.2
|
@@ -30,10 +30,13 @@ class ActiveRecordSchemaScrapper
|
|
30
30
|
|
31
31
|
yield(ActiveRecordSchemaScrapper::Association.new(hash))
|
32
32
|
rescue NameError => e
|
33
|
-
errors <<
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
errors << ErrorObject.new(
|
34
|
+
class_name: model.name,
|
35
|
+
message: "Missing model #{a.name.to_s.camelize.singularize} for association #{model.name}.belongs_to :#{a.name}",
|
36
|
+
original_error: e,
|
37
|
+
level: :error,
|
38
|
+
type: :association
|
39
|
+
)
|
37
40
|
end
|
38
41
|
end
|
39
42
|
end
|
@@ -55,9 +58,12 @@ class ActiveRecordSchemaScrapper
|
|
55
58
|
|
56
59
|
def abstract_class
|
57
60
|
if model.abstract_class?
|
58
|
-
errors <<
|
59
|
-
|
60
|
-
|
61
|
+
errors << ErrorObject.new(
|
62
|
+
class_name: model.name,
|
63
|
+
message: "#{model.name} is an abstract class and has no associated table.",
|
64
|
+
level: :warn,
|
65
|
+
type: :no_table
|
66
|
+
)
|
61
67
|
end
|
62
68
|
end
|
63
69
|
end
|
@@ -44,27 +44,29 @@ class ActiveRecordSchemaScrapper
|
|
44
44
|
ActiveRecordSchemaScrapper::Attribute.new(
|
45
45
|
name: k,
|
46
46
|
type: v.type,
|
47
|
-
precision: v.
|
48
|
-
limit: v.
|
49
|
-
scale: v.
|
47
|
+
precision: v.precision,
|
48
|
+
limit: v.limit,
|
49
|
+
scale: v.scale,
|
50
50
|
default: v.default,
|
51
51
|
null: v.null,
|
52
52
|
)
|
53
53
|
end
|
54
54
|
rescue NoMethodError => e
|
55
|
-
@errors <<
|
55
|
+
@errors << ErrorObject.new(class_name: model.name,
|
56
56
|
message: "#{model.name} is not a valid ActiveRecord model.",
|
57
57
|
original_error: e,
|
58
|
-
level: :error
|
59
|
-
|
58
|
+
level: :error,
|
59
|
+
type: :invalid_model)
|
60
|
+
[]
|
60
61
|
rescue ActiveRecord::StatementInvalid => e
|
61
62
|
level = model.abstract_class? ? :warn : :error
|
62
|
-
message = model.abstract_class? ? "
|
63
|
-
@errors <<
|
63
|
+
message = model.abstract_class? ? "#{model.name} is an abstract class and has no associated table." : e.message
|
64
|
+
@errors << ErrorObject.new(class_name: model.name,
|
64
65
|
message: message,
|
65
66
|
original_error: e,
|
66
|
-
level: level
|
67
|
+
level: level,
|
68
|
+
type: :no_table)
|
67
69
|
[]
|
68
70
|
end
|
69
71
|
end
|
70
|
-
end
|
72
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class ActiveRecordSchemaScrapper
|
2
|
+
class ErrorObject
|
3
|
+
attr_reader :level, :message, :class_name, :type, :original_error
|
4
|
+
|
5
|
+
def initialize(level: :warn, message:, class_name:, type:, original_error: nil)
|
6
|
+
@level = level
|
7
|
+
@message = message
|
8
|
+
@class_name = class_name
|
9
|
+
@type = type
|
10
|
+
@original_error = original_error
|
11
|
+
end
|
12
|
+
|
13
|
+
def original_error?
|
14
|
+
original_error.present?
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def self.levels
|
20
|
+
[:info, :warn, :error, :fatal]
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record_schema_scrapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dustin Zeisler
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activerecord
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.0'
|
20
|
+
- - "<="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '5.9'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '4.0'
|
30
|
+
- - "<="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '5.9'
|
13
33
|
- !ruby/object:Gem::Dependency
|
14
34
|
name: virtus
|
15
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -42,14 +62,14 @@ dependencies:
|
|
42
62
|
name: rake
|
43
63
|
requirement: !ruby/object:Gem::Requirement
|
44
64
|
requirements:
|
45
|
-
- - "
|
65
|
+
- - ">="
|
46
66
|
- !ruby/object:Gem::Version
|
47
67
|
version: '10.0'
|
48
68
|
type: :development
|
49
69
|
prerelease: false
|
50
70
|
version_requirements: !ruby/object:Gem::Requirement
|
51
71
|
requirements:
|
52
|
-
- - "
|
72
|
+
- - ">="
|
53
73
|
- !ruby/object:Gem::Version
|
54
74
|
version: '10.0'
|
55
75
|
- !ruby/object:Gem::Dependency
|
@@ -81,33 +101,33 @@ dependencies:
|
|
81
101
|
- !ruby/object:Gem::Version
|
82
102
|
version: '1.3'
|
83
103
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
104
|
+
name: appraisal
|
85
105
|
requirement: !ruby/object:Gem::Requirement
|
86
106
|
requirements:
|
87
107
|
- - "~>"
|
88
108
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
109
|
+
version: '2.0'
|
90
110
|
type: :development
|
91
111
|
prerelease: false
|
92
112
|
version_requirements: !ruby/object:Gem::Requirement
|
93
113
|
requirements:
|
94
114
|
- - "~>"
|
95
115
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
116
|
+
version: '2.0'
|
97
117
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
118
|
+
name: codeclimate-test-reporter
|
99
119
|
requirement: !ruby/object:Gem::Requirement
|
100
120
|
requirements:
|
101
121
|
- - "~>"
|
102
122
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
123
|
+
version: '0.5'
|
104
124
|
type: :development
|
105
125
|
prerelease: false
|
106
126
|
version_requirements: !ruby/object:Gem::Requirement
|
107
127
|
requirements:
|
108
128
|
- - "~>"
|
109
129
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
130
|
+
version: '0.5'
|
111
131
|
description: A supporting library for active_mocker and wrapper around an active_record
|
112
132
|
model.
|
113
133
|
email:
|
@@ -132,11 +152,16 @@ files:
|
|
132
152
|
- gemfiles/activerecord_4.0.gemfile.lock
|
133
153
|
- gemfiles/activerecord_4.1.gemfile
|
134
154
|
- gemfiles/activerecord_4.1.gemfile.lock
|
155
|
+
- gemfiles/activerecord_4.2.gemfile
|
156
|
+
- gemfiles/activerecord_4.2.gemfile.lock
|
157
|
+
- gemfiles/activerecord_5.gemfile
|
158
|
+
- gemfiles/activerecord_5.gemfile.lock
|
135
159
|
- lib/active_record_schema_scrapper.rb
|
136
160
|
- lib/active_record_schema_scrapper/association.rb
|
137
161
|
- lib/active_record_schema_scrapper/associations.rb
|
138
162
|
- lib/active_record_schema_scrapper/attribute.rb
|
139
163
|
- lib/active_record_schema_scrapper/attributes.rb
|
164
|
+
- lib/active_record_schema_scrapper/object_error.rb
|
140
165
|
- lib/active_record_schema_scrapper/version.rb
|
141
166
|
homepage: https://github.com/zeisler/active_record_schema_scrapper
|
142
167
|
licenses:
|
@@ -158,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
183
|
version: '0'
|
159
184
|
requirements: []
|
160
185
|
rubyforge_project:
|
161
|
-
rubygems_version: 2.
|
186
|
+
rubygems_version: 2.5.1
|
162
187
|
signing_key:
|
163
188
|
specification_version: 4
|
164
189
|
summary: A wrapper around an active_record model.
|