origen_doc_helpers 0.8.4 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/version.rb +1 -1
- data/lib/origen_doc_helpers/model_page_generator.rb +11 -2
- data/templates/web/helpers/model.md.erb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40aaede1ff8ad4d6148ab8306512e8f80380f9f3682cea6077316f5a24d43092
|
4
|
+
data.tar.gz: 64f8b7f11de61649190d9d256b85bd5dd77f7f6f5f90df6ee620f1959098ec47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8984fa0e3c19a0a638b24d085f9ce304737418e7a35657c0d10a2ba94a4d614486f4b9de36403e5a5808272e6462438fb9b076610f5d1316aab4d2a607146ce7
|
7
|
+
data.tar.gz: 8924ae6bb9e10082e7c62153cfabb1615c6c367aa60e8cd74679311f74823daa9895196dd16b206279bb5dab233b09457ec3aca2f19f158562125b2d0f55fb72
|
data/config/version.rb
CHANGED
@@ -4,6 +4,7 @@ module OrigenDocHelpers
|
|
4
4
|
attr_accessor :layout_options
|
5
5
|
attr_accessor :layout
|
6
6
|
attr_reader :pages
|
7
|
+
attr_accessor :target_as_id
|
7
8
|
|
8
9
|
def run(options)
|
9
10
|
@pages = {}
|
@@ -148,11 +149,19 @@ module OrigenDocHelpers
|
|
148
149
|
end
|
149
150
|
|
150
151
|
def id
|
151
|
-
|
152
|
+
if :target_as_id
|
153
|
+
@id ||= "#{Origen.target.name.downcase}" # _#{model.class.to_s.symbolize.to_s.gsub('::', '_')}"
|
154
|
+
else
|
155
|
+
@id ||= model.class.to_s.symbolize.to_s.gsub('::', '_')
|
156
|
+
end
|
152
157
|
end
|
153
158
|
|
154
159
|
def heading
|
155
|
-
|
160
|
+
if :target_as_id
|
161
|
+
@id.upcase
|
162
|
+
else
|
163
|
+
model.class.to_s
|
164
|
+
end
|
156
165
|
end
|
157
166
|
|
158
167
|
def output_path
|
@@ -79,6 +79,9 @@ end
|
|
79
79
|
|
80
80
|
* <code>:model</code> - **Required**, supply an instance of the model
|
81
81
|
* <code>:group</code> - Optional, a heading to group similar models under on the index page, e.g. "Production", "In Development"
|
82
|
+
* <code>:target_as_id</code> - Optional, causes the target name to be used for model page headings instead of the top-level model class name,
|
83
|
+
e.g. "Eagle" instead of "MyApp::ModelA". This is particularly useful if multiple targets instantiate the same top-level model with different
|
84
|
+
options or attributes that lead to differentiation.
|
82
85
|
|
83
86
|
## Website Integration
|
84
87
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: origen_doc_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen McGinty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: origen
|