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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8be9c5912f22281328dbe445399a4c394e028c3a10a68b107f8feccd73b46adb
4
- data.tar.gz: f75142d4ea1e47002fb66463ff2f66ca34a0d408a0759259a4b4e3db800dfea1
3
+ metadata.gz: 40aaede1ff8ad4d6148ab8306512e8f80380f9f3682cea6077316f5a24d43092
4
+ data.tar.gz: 64f8b7f11de61649190d9d256b85bd5dd77f7f6f5f90df6ee620f1959098ec47
5
5
  SHA512:
6
- metadata.gz: ef308ae1289cc4d23405fba1146b9b349f17ed13cdb0d26a9330eaa45d68904e444ea60623aa8015711a2bf84c374831c101ee639bc947c1f0640c24cef40b01
7
- data.tar.gz: 7be71f335ea1d0e6a3820abbab497c17ff346051ce0d79758806c6c2b2ae09e355f58ba8221ba42d5ba0e5075900766341c5aa541339a97736d22623031e1ba3
6
+ metadata.gz: 8984fa0e3c19a0a638b24d085f9ce304737418e7a35657c0d10a2ba94a4d614486f4b9de36403e5a5808272e6462438fb9b076610f5d1316aab4d2a607146ce7
7
+ data.tar.gz: 8924ae6bb9e10082e7c62153cfabb1615c6c367aa60e8cd74679311f74823daa9895196dd16b206279bb5dab233b09457ec3aca2f19f158562125b2d0f55fb72
data/config/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module OrigenDocHelpers
2
2
  MAJOR = 0
3
3
  MINOR = 8
4
- BUGFIX = 4
4
+ BUGFIX = 5
5
5
  DEV = nil
6
6
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
7
7
  end
@@ -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
- @id ||= model.class.to_s.symbolize.to_s.gsub('::', '_')
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
- model.class.to_s
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
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-05-11 00:00:00.000000000 Z
11
+ date: 2021-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: origen