Module: Origen::Generator::Compiler::DocHelpers::TestFlowHelpers

Included in:
Origen::Generator::Compiler::DocHelpers
Defined in:
lib/helpers.rb

Overview

Helpers for the test flow documentation

Instance Method Summary collapse

Instance Method Details

#_bin_number(test) ⇒ Object



122
123
124
125
# File 'lib/helpers.rb', line 122

def _bin_number(test)
  flow = test[:flow]
  flow[:bin] || flow[:hard_bin] || flow[:hardbin] || flow[:soft_bin] || flow[:softbin]
end

#_sbin_number(test) ⇒ Object



127
128
129
130
# File 'lib/helpers.rb', line 127

def _sbin_number(test)
  flow = test[:flow]
  flow[:soft_bin] || flow[:softbin]
end

#_start_accordion(heading, _options = {}) ⇒ Object



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/helpers.rb', line 132

def _start_accordion(heading, _options = {})
  @_accordion_index ||= 0
  @_accordion_index += 1
  <<-END
<div class="panel panel-default">
<a href="#_" class="expandcollapse btn btn-xs pull-right btn-default" state="0"><i class='fa fa-plus'></i></a>
<div class="panel-heading clickable" style="background:whitesmoke" data-toggle="collapse" data-parent="#blah2" href="#collapseAccordion#{@_accordion_index}">
<a class="no-underline">
#{heading}
</a>
</div>
<div id="collapseAccordion#{@_accordion_index}" class="panel-collapse collapse">
<div class="panel-body" markdown="1">

  END
end

#_start_test_flow_tableObject



158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/helpers.rb', line 158

def _start_test_flow_table
  if @_test_flow_table_open
    ''
  else
    @_test_flow_table_open = true
    <<-END
<table class="table table-condensed table-bordered flow-table">

<thead>
<tr>
<th class="col1">Test</th>
<th class="col2">Number</th>
<th class="col3">HBin</th>
<th class="col3">SBin</th>
<th class="col5">Attributes</th>
<th class="col6">Description</th>
</tr>
</thead>

<tbody>
    END
  end
end

#_stop_accordionObject



149
150
151
152
153
154
155
156
# File 'lib/helpers.rb', line 149

def _stop_accordion
  <<-END

</div>
</div>
</div>
  END
end

#_stop_test_flow_tableObject



182
183
184
185
186
187
188
189
190
191
192
193
# File 'lib/helpers.rb', line 182

def _stop_test_flow_table
  if @_test_flow_table_open
    @_test_flow_table_open = false
    <<-END

</tbody>
</table>
    END
  else
    ''
  end
end

#_test_name(test) ⇒ Object



113
114
115
# File 'lib/helpers.rb', line 113

def _test_name(test)
  test[:flow][:name] || test[:instance].first[:name]
end

#_test_number(test) ⇒ Object



117
118
119
120
# File 'lib/helpers.rb', line 117

def _test_number(test)
  flow = test[:flow]
  flow[:number] || flow[:test_number] || flow[:tnum]
end


107
108
109
110
111
# File 'lib/helpers.rb', line 107

def _test_to_local_link(test)
  name = _test_name(test)
  number = _test_number(test)
  "<a href='##{name}_#{number}'>#{name}</a>"
end