Module: Origen::Generator::Compiler::DocHelpers::TestFlowHelpers
- Defined in:
- lib/origen_doc_helpers/helpers.rb
Overview
Helpers for the test flow documentation
Instance Method Summary collapse
- #_bin_number(test) ⇒ Object
- #_sbin_number(test) ⇒ Object
- #_start_accordion(heading, options = {}) ⇒ Object
- #_start_test_flow_table ⇒ Object
- #_stop_accordion ⇒ Object
- #_stop_test_flow_table ⇒ Object
- #_test_name(test) ⇒ Object
- #_test_number(test) ⇒ Object
- #_test_to_local_link(test) ⇒ Object
Instance Method Details
#_bin_number(test) ⇒ Object
171 172 173 174 |
# File 'lib/origen_doc_helpers/helpers.rb', line 171 def _bin_number(test) flow = test[:flow] flow[:bin] || flow[:hard_bin] || flow[:hardbin] || flow[:soft_bin] || flow[:softbin] end |
#_sbin_number(test) ⇒ Object
176 177 178 179 |
# File 'lib/origen_doc_helpers/helpers.rb', line 176 def _sbin_number(test) flow = test[:flow] flow[:soft_bin] || flow[:softbin] end |
#_start_accordion(heading, options = {}) ⇒ Object
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'lib/origen_doc_helpers/helpers.rb', line 181 def _start_accordion(heading, = {}) = { panel: :default }.merge() @_accordion_index ||= 0 @_accordion_index += 1 "\n\n<div class=\"panel panel-\#{options[:panel]}\">\n<a href=\"#_\" class=\"expand-collapse-switch btn btn-xs pull-right btn-default\" state=\"0\"><i class='fa fa-plus'></i></a>\n<div class=\"panel-heading clickable\" data-toggle=\"collapse\" data-parent=\"#blah2\" href=\"#collapseAccordion\#{@_accordion_index}\">\n\#{heading}\n</div>\n<div id=\"collapseAccordion\#{@_accordion_index}\" class=\"panel-collapse collapse\">\n<div class=\"panel-body\" markdown=\"1\">\n\n\n END\nend\n" |
#_start_test_flow_table ⇒ Object
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/origen_doc_helpers/helpers.rb', line 214 def _start_test_flow_table if @_test_flow_table_open '' else @_test_flow_table_open = true "<table class=\"table table-condensed table-bordered flow-table\">\n\n<thead>\n<tr>\n<th class=\"col1\">Test</th>\n<th class=\"col2\">Number</th>\n<th class=\"col3\">HBin</th>\n<th class=\"col3\">SBin</th>\n<th class=\"col5\">Attributes</th>\n<th class=\"col6\">Description</th>\n</tr>\n</thead>\n\n<tbody>\n END\n end\nend\n" |
#_stop_accordion ⇒ Object
202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/origen_doc_helpers/helpers.rb', line 202 def _stop_accordion "\n\n</div>\n</div>\n</div>\n\n\n END\nend\n" |
#_stop_test_flow_table ⇒ Object
238 239 240 241 242 243 244 245 246 247 248 249 |
# File 'lib/origen_doc_helpers/helpers.rb', line 238 def _stop_test_flow_table if @_test_flow_table_open @_test_flow_table_open = false "\n</tbody>\n</table>\n END\n else\n ''\n end\nend\n" |
#_test_name(test) ⇒ Object
162 163 164 |
# File 'lib/origen_doc_helpers/helpers.rb', line 162 def _test_name(test) test[:flow][:name] || test[:instance].first[:name] end |
#_test_number(test) ⇒ Object
166 167 168 169 |
# File 'lib/origen_doc_helpers/helpers.rb', line 166 def _test_number(test) flow = test[:flow] flow[:number] || flow[:test_number] || flow[:tnum] end |
#_test_to_local_link(test) ⇒ Object
156 157 158 159 160 |
# File 'lib/origen_doc_helpers/helpers.rb', line 156 def _test_to_local_link(test) name = _test_name(test) number = _test_number(test) "<a href='##{name}_#{number}'>#{name}</a>" end |