schema_doc 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -0
- data/lib/schema_doc.rb +17 -0
- data/lib/schema_doc/configuration.rb +9 -0
- data/lib/schema_doc/document.rb +1 -1
- data/lib/schema_doc/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eadb829eb9f3581debcd1a1916db1f39ef23782a3f10257394453ba9e28d82d9
|
4
|
+
data.tar.gz: 0ac48d9c7a82bac4d46435065bd1064fd1bea25b5c25f7d3a351131d54b2c6ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf247b70e5250c9504f19e7c48bcd7ac15846e099fbcd3e10d4241b5c235c57e1619f381302d6ac1d165f6a91e64fda1a0f222f97b7d3491ccdb08f24ba02e8a
|
7
|
+
data.tar.gz: ff8843e7a210fece539ec0aab79dc363f47c1a0e3e2bf5a0f81f457e6108d9beaeccbcba79e244fba9fe65bbf9d2a1d1ae75393cc377761e025be373388fcaa9
|
data/README.md
CHANGED
@@ -38,6 +38,16 @@ end
|
|
38
38
|
|
39
39
|
SchemaDoc will output [THIS](https://github.com/mizoR/schema_doc/tree/master/example/sample_output.md).
|
40
40
|
|
41
|
+
## Optional Configuration
|
42
|
+
|
43
|
+
If you want to customize the models that are listed, you can create a `config/initializers/schema_doc.rb` as shown in the example below:
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
SchemaDoc.configure do |config|
|
47
|
+
config.model_classes = Proc.new { ApplicationRecord.descendants.select{ |klass| klass.superclass.name == ApplicationRecord.name } }
|
48
|
+
end
|
49
|
+
```
|
50
|
+
|
41
51
|
## Contributing
|
42
52
|
|
43
53
|
1. Fork it
|
data/lib/schema_doc.rb
CHANGED
@@ -1,8 +1,25 @@
|
|
1
|
+
require "schema_doc/configuration"
|
1
2
|
require "schema_doc/version"
|
2
3
|
require "schema_doc/document"
|
3
4
|
require "schema_doc/railtie" if defined?(Rails)
|
4
5
|
|
5
6
|
module SchemaDoc
|
7
|
+
class << self
|
8
|
+
attr_accessor :configuration
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.configuration
|
12
|
+
@configuration ||= Configuration.new
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.reset
|
16
|
+
@configuration = Configuration.new
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.configure
|
20
|
+
yield(configuration)
|
21
|
+
end
|
22
|
+
|
6
23
|
def self.root
|
7
24
|
File.expand_path('../..', __FILE__)
|
8
25
|
end
|
data/lib/schema_doc/document.rb
CHANGED
data/lib/schema_doc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schema_doc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mizokami
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- Rakefile
|
97
97
|
- example/sample_output.md
|
98
98
|
- lib/schema_doc.rb
|
99
|
+
- lib/schema_doc/configuration.rb
|
99
100
|
- lib/schema_doc/document.rb
|
100
101
|
- lib/schema_doc/railtie.rb
|
101
102
|
- lib/schema_doc/tasks.rake
|