xbrlware-ce 1.0.4 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile.rb +4 -4
- data/Readme.txt +6 -1
- data/ReleaseNotes.txt +22 -5
- data/doc/classes/Edgar/HTMLFeedDownloader.html +8 -8
- data/doc/classes/Edgar/RSSFeedDownloader.html +15 -15
- data/doc/classes/Xbrlware.html +22 -0
- data/doc/classes/Xbrlware/Context.html +104 -74
- data/doc/classes/Xbrlware/Context/Period.html +305 -0
- data/doc/classes/Xbrlware/Entity.html +75 -51
- data/doc/classes/Xbrlware/Identifier.html +17 -17
- data/doc/classes/Xbrlware/Instance.html +165 -137
- data/doc/classes/Xbrlware/Item.html +19 -19
- data/doc/classes/Xbrlware/Linkbase/CalculationLinkbase/Calculation.html +1 -1
- data/doc/classes/Xbrlware/Linkbase/DefinitionLinkbase/Definition.html +2 -2
- data/doc/classes/Xbrlware/Linkbase/Linkbase/Link.html +9 -3
- data/doc/classes/Xbrlware/Linkbase/Linkbase/Link/Arc.html +4 -4
- data/doc/classes/Xbrlware/Linkbase/PresentationLinkbase/Presentation.html +1 -1
- data/doc/classes/Xbrlware/Report.html +352 -0
- data/doc/classes/Xbrlware/Taxonomy.html +48 -48
- data/doc/classes/Xbrlware/TaxonomyDefintion.html +15 -15
- data/doc/classes/Xbrlware/Unit.html +6 -6
- data/doc/classes/Xbrlware/Unit/Divide.html +6 -6
- data/doc/created.rid +1 -1
- data/doc/files/Readme_txt.html +9 -1
- data/doc/files/lib/xbrlware/context_rb.html +1 -1
- data/doc/files/lib/xbrlware/date_util_rb.html +1 -1
- data/doc/files/lib/xbrlware/instance_rb.html +1 -1
- data/doc/files/lib/xbrlware/linkbase/calculation_linkbase_rb.html +1 -1
- data/doc/files/lib/xbrlware/linkbase/definition_linkbase_rb.html +1 -1
- data/doc/files/lib/xbrlware/linkbase/linkbase_rb.html +1 -1
- data/doc/files/lib/xbrlware/linkbase/presentation_linkbase_rb.html +1 -1
- data/doc/files/lib/xbrlware/meta_util_rb.html +1 -1
- data/doc/files/lib/xbrlware/report_rb.html +101 -0
- data/doc/files/lib/xbrlware/taxonomy_rb.html +1 -1
- data/doc/files/lib/xbrlware/version_rb.html +129 -0
- data/doc/fr_class_index.html +2 -0
- data/doc/fr_file_index.html +2 -0
- data/doc/fr_method_index.html +75 -62
- data/example/case_study/buy_strategy.rb +1 -1
- data/example/case_study/c_sell_strategy.rb +1 -1
- data/lib/xbrlware/context.rb +77 -34
- data/lib/xbrlware/date_util.rb +16 -6
- data/lib/xbrlware/instance.rb +35 -28
- data/lib/xbrlware/linkbase/calculation_linkbase.rb +1 -1
- data/lib/xbrlware/linkbase/definition_linkbase.rb +2 -2
- data/lib/xbrlware/linkbase/linkbase.rb +3 -2
- data/lib/xbrlware/linkbase/presentation_linkbase.rb +1 -1
- data/lib/xbrlware/meta_util.rb +5 -0
- data/lib/xbrlware/report.rb +277 -0
- data/lib/xbrlware/taxonomy.rb +13 -10
- data/lib/xbrlware/version.rb +22 -0
- data/test/lib/xbrlware/47_context_test.rb +13 -4
- data/test/lib/xbrlware/date_util_test.rb +10 -2
- data/test/lib/xbrlware/instance_test.rb +19 -0
- data/test/lib/xbrlware/meta_util_test.rb +21 -1
- metadata +10 -4
|
@@ -100,9 +100,9 @@ instance page on xbrlware wiki</a> for more details.
|
|
|
100
100
|
<h3 class="section-bar">Methods</h3>
|
|
101
101
|
|
|
102
102
|
<div class="name-list">
|
|
103
|
-
<a href="#
|
|
104
|
-
<a href="#
|
|
105
|
-
<a href="#
|
|
103
|
+
<a href="#M000063">balance</a>
|
|
104
|
+
<a href="#M000061">new</a>
|
|
105
|
+
<a href="#M000062">value</a>
|
|
106
106
|
</div>
|
|
107
107
|
</div>
|
|
108
108
|
|
|
@@ -180,23 +180,23 @@ instance page on xbrlware wiki</a> for more details.
|
|
|
180
180
|
<div id="methods">
|
|
181
181
|
<h3 class="section-bar">Public Class methods</h3>
|
|
182
182
|
|
|
183
|
-
<div id="method-
|
|
184
|
-
<a name="
|
|
183
|
+
<div id="method-M000061" class="method-detail">
|
|
184
|
+
<a name="M000061"></a>
|
|
185
185
|
|
|
186
186
|
<div class="method-heading">
|
|
187
|
-
<a href="#
|
|
187
|
+
<a href="#M000061" class="method-signature">
|
|
188
188
|
<span class="method-name">new</span><span class="method-args">(name, context, value, unit=nil,precision=nil,decimals=nil, footnotes=nil)</span>
|
|
189
189
|
</a>
|
|
190
190
|
</div>
|
|
191
191
|
|
|
192
192
|
<div class="method-description">
|
|
193
193
|
<p>
|
|
194
|
-
Constructs item <a href="Item.html#
|
|
194
|
+
Constructs item <a href="Item.html#M000062">value</a> is normalized based
|
|
195
195
|
on precision and decimals passed as per XBRL specification
|
|
196
196
|
</p>
|
|
197
197
|
<p><a class="source-toggle" href="#"
|
|
198
|
-
onclick="toggleCode('
|
|
199
|
-
<div class="method-source-code" id="
|
|
198
|
+
onclick="toggleCode('M000061-source');return false;">[Source]</a></p>
|
|
199
|
+
<div class="method-source-code" id="M000061-source">
|
|
200
200
|
<pre>
|
|
201
201
|
<span class="ruby-comment cmt"># File lib/xbrlware/item.rb, line 31</span>
|
|
202
202
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">context</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">unit</span>=<span class="ruby-keyword kw">nil</span>,<span class="ruby-identifier">precision</span>=<span class="ruby-keyword kw">nil</span>,<span class="ruby-identifier">decimals</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">footnotes</span>=<span class="ruby-keyword kw">nil</span>)
|
|
@@ -215,19 +215,19 @@ on precision and decimals passed as per XBRL specification
|
|
|
215
215
|
|
|
216
216
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
217
217
|
|
|
218
|
-
<div id="method-
|
|
219
|
-
<a name="
|
|
218
|
+
<div id="method-M000063" class="method-detail">
|
|
219
|
+
<a name="M000063"></a>
|
|
220
220
|
|
|
221
221
|
<div class="method-heading">
|
|
222
|
-
<a href="#
|
|
222
|
+
<a href="#M000063" class="method-signature">
|
|
223
223
|
<span class="method-name">balance</span><span class="method-args">()</span>
|
|
224
224
|
</a>
|
|
225
225
|
</div>
|
|
226
226
|
|
|
227
227
|
<div class="method-description">
|
|
228
228
|
<p><a class="source-toggle" href="#"
|
|
229
|
-
onclick="toggleCode('
|
|
230
|
-
<div class="method-source-code" id="
|
|
229
|
+
onclick="toggleCode('M000063-source');return false;">[Source]</a></p>
|
|
230
|
+
<div class="method-source-code" id="M000063-source">
|
|
231
231
|
<pre>
|
|
232
232
|
<span class="ruby-comment cmt"># File lib/xbrlware/item.rb, line 48</span>
|
|
233
233
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">balance</span>
|
|
@@ -239,19 +239,19 @@ on precision and decimals passed as per XBRL specification
|
|
|
239
239
|
</div>
|
|
240
240
|
</div>
|
|
241
241
|
|
|
242
|
-
<div id="method-
|
|
243
|
-
<a name="
|
|
242
|
+
<div id="method-M000062" class="method-detail">
|
|
243
|
+
<a name="M000062"></a>
|
|
244
244
|
|
|
245
245
|
<div class="method-heading">
|
|
246
|
-
<a href="#
|
|
246
|
+
<a href="#M000062" class="method-signature">
|
|
247
247
|
<span class="method-name">value</span><span class="method-args">() {|@value| ...}</span>
|
|
248
248
|
</a>
|
|
249
249
|
</div>
|
|
250
250
|
|
|
251
251
|
<div class="method-description">
|
|
252
252
|
<p><a class="source-toggle" href="#"
|
|
253
|
-
onclick="toggleCode('
|
|
254
|
-
<div class="method-source-code" id="
|
|
253
|
+
onclick="toggleCode('M000062-source');return false;">[Source]</a></p>
|
|
254
|
+
<div class="method-source-code" id="M000062-source">
|
|
255
255
|
<pre>
|
|
256
256
|
<span class="ruby-comment cmt"># File lib/xbrlware/item.rb, line 41</span>
|
|
257
257
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">value</span>
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
<pre>
|
|
149
149
|
<span class="ruby-comment cmt"># File lib/xbrlware/linkbase/calculation_linkbase.rb, line 118</span>
|
|
150
150
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">entity_details</span>, <span class="ruby-identifier">title</span>, <span class="ruby-identifier">role</span>, <span class="ruby-identifier">href</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">arcs</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">contexts</span>=<span class="ruby-keyword kw">nil</span>)
|
|
151
|
-
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">title</span>, <span class="ruby-identifier">role</span>, <span class="ruby-identifier">href</span>, <span class="ruby-identifier">arcs</span>)
|
|
151
|
+
<span class="ruby-keyword kw">super</span>(<span class="ruby-value str">"Calculation"</span>, <span class="ruby-identifier">title</span>, <span class="ruby-identifier">role</span>, <span class="ruby-identifier">href</span>, <span class="ruby-identifier">arcs</span>)
|
|
152
152
|
<span class="ruby-ivar">@contexts</span>=<span class="ruby-identifier">contexts</span>
|
|
153
153
|
<span class="ruby-ivar">@entity_details</span>=<span class="ruby-identifier">entity_details</span>
|
|
154
154
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
<pre>
|
|
145
145
|
<span class="ruby-comment cmt"># File lib/xbrlware/linkbase/definition_linkbase.rb, line 153</span>
|
|
146
146
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">title</span>, <span class="ruby-identifier">role</span>, <span class="ruby-identifier">href</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">primary_items</span>=<span class="ruby-keyword kw">nil</span>)
|
|
147
|
-
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">title</span>, <span class="ruby-identifier">role</span>, <span class="ruby-identifier">href</span>, <span class="ruby-identifier">primary_items</span>)
|
|
147
|
+
<span class="ruby-keyword kw">super</span>(<span class="ruby-value str">"Definition"</span>, <span class="ruby-identifier">title</span>, <span class="ruby-identifier">role</span>, <span class="ruby-identifier">href</span>, <span class="ruby-identifier">primary_items</span>)
|
|
148
148
|
<span class="ruby-ivar">@primary_items</span>=<span class="ruby-identifier">primary_items</span>
|
|
149
149
|
<span class="ruby-keyword kw">end</span>
|
|
150
150
|
</pre>
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
<span class="ruby-identifier">dimension</span>.<span class="ruby-identifier">domains</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">domain</span><span class="ruby-operator">|</span>
|
|
179
179
|
<span class="ruby-identifier">domains</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">domain</span>.<span class="ruby-identifier">href</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-value str">"_"</span>, <span class="ruby-value str">":"</span>)
|
|
180
180
|
<span class="ruby-keyword kw">end</span>
|
|
181
|
-
<span class="ruby-identifier">dim_dom_map</span>[<span class="ruby-identifier">dimension</span>.<span class="ruby-identifier">href</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-value str">"_"</span>, <span class="ruby-value str">":"</span>)]=<span class="ruby-identifier">domains</span>
|
|
181
|
+
<span class="ruby-identifier">dim_dom_map</span>[<span class="ruby-identifier">dimension</span>.<span class="ruby-identifier">href</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-value str">"_"</span>, <span class="ruby-value str">":"</span>)]=<span class="ruby-identifier">domains</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">domains</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
|
182
182
|
<span class="ruby-keyword kw">end</span>
|
|
183
183
|
<span class="ruby-keyword kw">end</span>
|
|
184
184
|
<span class="ruby-keyword kw">end</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@primary_items</span>.<span class="ruby-identifier">nil?</span>
|
|
@@ -123,6 +123,11 @@
|
|
|
123
123
|
<td class="context-item-value"> [R] </td>
|
|
124
124
|
<td class="context-item-desc"></td>
|
|
125
125
|
</tr>
|
|
126
|
+
<tr class="top-aligned-row context-row">
|
|
127
|
+
<td class="context-item-name">link_type</td>
|
|
128
|
+
<td class="context-item-value"> [R] </td>
|
|
129
|
+
<td class="context-item-desc"></td>
|
|
130
|
+
</tr>
|
|
126
131
|
<tr class="top-aligned-row context-row">
|
|
127
132
|
<td class="context-item-name">role</td>
|
|
128
133
|
<td class="context-item-value"> [R] </td>
|
|
@@ -148,7 +153,7 @@
|
|
|
148
153
|
|
|
149
154
|
<div class="method-heading">
|
|
150
155
|
<a href="#M000005" class="method-signature">
|
|
151
|
-
<span class="method-name">new</span><span class="method-args">(title, role, href, arcs=nil)</span>
|
|
156
|
+
<span class="method-name">new</span><span class="method-args">(link_type, title, role, href, arcs=nil)</span>
|
|
152
157
|
</a>
|
|
153
158
|
</div>
|
|
154
159
|
|
|
@@ -158,7 +163,8 @@
|
|
|
158
163
|
<div class="method-source-code" id="M000005-source">
|
|
159
164
|
<pre>
|
|
160
165
|
<span class="ruby-comment cmt"># File lib/xbrlware/linkbase/linkbase.rb, line 100</span>
|
|
161
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">title</span>, <span class="ruby-identifier">role</span>, <span class="ruby-identifier">href</span>, <span class="ruby-identifier">arcs</span>=<span class="ruby-keyword kw">nil</span>)
|
|
166
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">link_type</span>, <span class="ruby-identifier">title</span>, <span class="ruby-identifier">role</span>, <span class="ruby-identifier">href</span>, <span class="ruby-identifier">arcs</span>=<span class="ruby-keyword kw">nil</span>)
|
|
167
|
+
<span class="ruby-ivar">@link_type</span>=<span class="ruby-identifier">link_type</span>
|
|
162
168
|
<span class="ruby-ivar">@role</span> = <span class="ruby-identifier">role</span>
|
|
163
169
|
<span class="ruby-ivar">@href</span> = <span class="ruby-identifier">href</span>
|
|
164
170
|
|
|
@@ -191,7 +197,7 @@
|
|
|
191
197
|
onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
|
|
192
198
|
<div class="method-source-code" id="M000006-source">
|
|
193
199
|
<pre>
|
|
194
|
-
<span class="ruby-comment cmt"># File lib/xbrlware/linkbase/linkbase.rb, line
|
|
200
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/linkbase/linkbase.rb, line 128</span>
|
|
195
201
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inspect</span>(<span class="ruby-identifier">verbose_flag</span>=<span class="ruby-value str">"q"</span>)
|
|
196
202
|
<span class="ruby-identifier">puts</span> <span class="ruby-value str">" title ["</span><span class="ruby-operator">+</span><span class="ruby-identifier">title</span><span class="ruby-operator">+</span><span class="ruby-value str">"] role ["</span><span class="ruby-operator">+</span><span class="ruby-identifier">role</span><span class="ruby-operator">+</span><span class="ruby-value str">"]"</span>
|
|
197
203
|
<span class="ruby-identifier">print_arc_hierarchy</span>(<span class="ruby-identifier">verbose_flag</span>)
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
|
|
179
179
|
<div class="method-source-code" id="M000007-source">
|
|
180
180
|
<pre>
|
|
181
|
-
<span class="ruby-comment cmt"># File lib/xbrlware/linkbase/linkbase.rb, line
|
|
181
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/linkbase/linkbase.rb, line 139</span>
|
|
182
182
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">item_id</span>, <span class="ruby-identifier">href</span>, <span class="ruby-identifier">role</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">order</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">priority</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">label</span>=<span class="ruby-keyword kw">nil</span>)
|
|
183
183
|
<span class="ruby-ivar">@item_id</span>=<span class="ruby-identifier">item_id</span>
|
|
184
184
|
<span class="ruby-ivar">@href</span>=<span class="ruby-identifier">href</span>
|
|
@@ -214,7 +214,7 @@
|
|
|
214
214
|
onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
|
|
215
215
|
<div class="method-source-code" id="M000009-source">
|
|
216
216
|
<pre>
|
|
217
|
-
<span class="ruby-comment cmt"># File lib/xbrlware/linkbase/linkbase.rb, line
|
|
217
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/linkbase/linkbase.rb, line 158</span>
|
|
218
218
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">eql?</span>(<span class="ruby-identifier">o</span>)
|
|
219
219
|
<span class="ruby-identifier">o</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Arc</span>) <span class="ruby-operator">&&</span> <span class="ruby-ivar">@item_id</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">item_id</span>
|
|
220
220
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
|
|
238
238
|
<div class="method-source-code" id="M000008-source">
|
|
239
239
|
<pre>
|
|
240
|
-
<span class="ruby-comment cmt"># File lib/xbrlware/linkbase/linkbase.rb, line
|
|
240
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/linkbase/linkbase.rb, line 154</span>
|
|
241
241
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">has_children?</span>
|
|
242
242
|
<span class="ruby-ivar">@children</span>.<span class="ruby-identifier">size</span><span class="ruby-operator">></span><span class="ruby-value">0</span>
|
|
243
243
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -260,7 +260,7 @@
|
|
|
260
260
|
onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
|
|
261
261
|
<div class="method-source-code" id="M000010-source">
|
|
262
262
|
<pre>
|
|
263
|
-
<span class="ruby-comment cmt"># File lib/xbrlware/linkbase/linkbase.rb, line
|
|
263
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/linkbase/linkbase.rb, line 162</span>
|
|
264
264
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hash</span>
|
|
265
265
|
<span class="ruby-ivar">@item_id</span>.<span class="ruby-identifier">hash</span>
|
|
266
266
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
<pre>
|
|
170
170
|
<span class="ruby-comment cmt"># File lib/xbrlware/linkbase/presentation_linkbase.rb, line 135</span>
|
|
171
171
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">entity_details</span>, <span class="ruby-identifier">title</span>, <span class="ruby-identifier">role</span>, <span class="ruby-identifier">href</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">contexts</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">arcs</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">definition</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">instance</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">dimensions</span>=[])
|
|
172
|
-
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">title</span>, <span class="ruby-identifier">role</span>, <span class="ruby-identifier">href</span>, <span class="ruby-identifier">arcs</span>)
|
|
172
|
+
<span class="ruby-keyword kw">super</span>(<span class="ruby-value str">"Presentation"</span>, <span class="ruby-identifier">title</span>, <span class="ruby-identifier">role</span>, <span class="ruby-identifier">href</span>, <span class="ruby-identifier">arcs</span>)
|
|
173
173
|
<span class="ruby-ivar">@entity_details</span>=<span class="ruby-identifier">entity_details</span>
|
|
174
174
|
<span class="ruby-ivar">@contexts</span>=<span class="ruby-identifier">contexts</span>
|
|
175
175
|
<span class="ruby-ivar">@definition</span>=<span class="ruby-identifier">definition</span>
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
+
<head>
|
|
8
|
+
<title>Class: Xbrlware::Report</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
+
<script type="text/javascript">
|
|
13
|
+
// <![CDATA[
|
|
14
|
+
|
|
15
|
+
function popupCode( url ) {
|
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function toggleCode( id ) {
|
|
20
|
+
if ( document.getElementById )
|
|
21
|
+
elem = document.getElementById( id );
|
|
22
|
+
else if ( document.all )
|
|
23
|
+
elem = eval( "document.all." + id );
|
|
24
|
+
else
|
|
25
|
+
return false;
|
|
26
|
+
|
|
27
|
+
elemStyle = elem.style;
|
|
28
|
+
|
|
29
|
+
if ( elemStyle.display != "block" ) {
|
|
30
|
+
elemStyle.display = "block"
|
|
31
|
+
} else {
|
|
32
|
+
elemStyle.display = "none"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Make codeblocks hidden by default
|
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
+
|
|
41
|
+
// ]]>
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
</head>
|
|
45
|
+
<body>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
<div id="classHeader">
|
|
50
|
+
<table class="header-table">
|
|
51
|
+
<tr class="top-aligned-row">
|
|
52
|
+
<td><strong>Class</strong></td>
|
|
53
|
+
<td class="class-name-in-header">Xbrlware::Report</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../../files/lib/xbrlware/report_rb.html">
|
|
59
|
+
lib/xbrlware/report.rb
|
|
60
|
+
</a>
|
|
61
|
+
<br />
|
|
62
|
+
</td>
|
|
63
|
+
</tr>
|
|
64
|
+
|
|
65
|
+
<tr class="top-aligned-row">
|
|
66
|
+
<td><strong>Parent:</strong></td>
|
|
67
|
+
<td>
|
|
68
|
+
Object
|
|
69
|
+
</td>
|
|
70
|
+
</tr>
|
|
71
|
+
</table>
|
|
72
|
+
</div>
|
|
73
|
+
<!-- banner header -->
|
|
74
|
+
|
|
75
|
+
<div id="bodyContent">
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
<div id="contextContent">
|
|
80
|
+
|
|
81
|
+
<div id="description">
|
|
82
|
+
<p>
|
|
83
|
+
This class defines methods to generate HTML reports from XBRL documents.
|
|
84
|
+
</p>
|
|
85
|
+
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<div id="method-list">
|
|
92
|
+
<h3 class="section-bar">Methods</h3>
|
|
93
|
+
|
|
94
|
+
<div class="name-list">
|
|
95
|
+
<a href="#M000030">gen</a>
|
|
96
|
+
<a href="#M000031">gen_for</a>
|
|
97
|
+
<a href="#M000029">new</a>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
<!-- if includes -->
|
|
105
|
+
|
|
106
|
+
<div id="section">
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
<div id="constants-list">
|
|
110
|
+
<h3 class="section-bar">Constants</h3>
|
|
111
|
+
|
|
112
|
+
<div class="name-list">
|
|
113
|
+
<table summary="Constants">
|
|
114
|
+
<tr class="top-aligned-row context-row">
|
|
115
|
+
<td class="context-item-name">PREF</td>
|
|
116
|
+
<td>=</td>
|
|
117
|
+
<td class="context-item-value">{}</td>
|
|
118
|
+
</tr>
|
|
119
|
+
</table>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
<!-- if method_list -->
|
|
129
|
+
<div id="methods">
|
|
130
|
+
<h3 class="section-bar">Public Class methods</h3>
|
|
131
|
+
|
|
132
|
+
<div id="method-M000029" class="method-detail">
|
|
133
|
+
<a name="M000029"></a>
|
|
134
|
+
|
|
135
|
+
<div class="method-heading">
|
|
136
|
+
<a href="#M000029" class="method-signature">
|
|
137
|
+
<span class="method-name">new</span><span class="method-args">(entity_details={}, pref={})</span>
|
|
138
|
+
</a>
|
|
139
|
+
</div>
|
|
140
|
+
|
|
141
|
+
<div class="method-description">
|
|
142
|
+
<p><a class="source-toggle" href="#"
|
|
143
|
+
onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
|
|
144
|
+
<div class="method-source-code" id="M000029-source">
|
|
145
|
+
<pre>
|
|
146
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/report.rb, line 8</span>
|
|
147
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">entity_details</span>={}, <span class="ruby-identifier">pref</span>={})
|
|
148
|
+
<span class="ruby-constant">PREF</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">pref</span>)
|
|
149
|
+
<span class="ruby-constant">PREF</span>[<span class="ruby-value str">"ITEM_FORMAT"</span>]=<span class="ruby-identifier">lambda</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">val</span><span class="ruby-operator">|</span> (<span class="ruby-constant">BigDecimal</span>(<span class="ruby-identifier">val</span>)<span class="ruby-operator">/</span><span class="ruby-value">1000000</span>).<span class="ruby-identifier">round</span>(<span class="ruby-value">4</span>).<span class="ruby-identifier">to_s</span>(<span class="ruby-value str">"F"</span>)} <span class="ruby-keyword kw">if</span> <span class="ruby-constant">PREF</span>[<span class="ruby-value str">"ITEM_FORMAT"</span>].<span class="ruby-identifier">nil?</span>
|
|
150
|
+
<span class="ruby-constant">PREF</span>[<span class="ruby-value str">"ITEM_FORMAT_DESC"</span>]=<span class="ruby-value str">" in millions "</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">PREF</span>[<span class="ruby-value str">"ITEM_FORMAT_DESC"</span>].<span class="ruby-identifier">nil?</span>
|
|
151
|
+
<span class="ruby-constant">PREF</span>[<span class="ruby-value str">"ITEM_FORMAT_EXCLUDE"</span>] = [<span class="ruby-value str">"EntityRegistrantName"</span>, <span class="ruby-value str">"EntityCentralIndexKey"</span>, <span class="ruby-value str">"DocumentType"</span>, <span class="ruby-value str">"DocumentPeriodEndDate"</span>, <span class="ruby-value str">"CurrentFiscalYearEndDate"</span>, <span class="ruby-value str">"EntityCommonStockSharesOutstanding"</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-constant">PREF</span>[<span class="ruby-value str">"ITEM_EXCLUDE"</span>].<span class="ruby-identifier">nil?</span>
|
|
152
|
+
<span class="ruby-ivar">@entity_details</span>=<span class="ruby-identifier">entity_details</span>
|
|
153
|
+
<span class="ruby-keyword kw">end</span>
|
|
154
|
+
</pre>
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
|
|
159
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
160
|
+
|
|
161
|
+
<div id="method-M000030" class="method-detail">
|
|
162
|
+
<a name="M000030"></a>
|
|
163
|
+
|
|
164
|
+
<div class="method-heading">
|
|
165
|
+
<a href="#M000030" class="method-signature">
|
|
166
|
+
<span class="method-name">gen</span><span class="method-args">(path_to_data_folder=".", report_for="pre|cal", report_type="html|xls|xml|json", verbose_flag="q")</span>
|
|
167
|
+
</a>
|
|
168
|
+
</div>
|
|
169
|
+
|
|
170
|
+
<div class="method-description">
|
|
171
|
+
<p>
|
|
172
|
+
Takes path to folder that contains xbrl documents of entities. If the
|
|
173
|
+
folder contains xbrl documents of single entity then HTML reports are
|
|
174
|
+
generated for that entity. If there is need to generate reports for
|
|
175
|
+
multiple entities then
|
|
176
|
+
</p>
|
|
177
|
+
<pre>
|
|
178
|
+
1. Create root folder
|
|
179
|
+
2. Create subfolder for each entity inside root folder
|
|
180
|
+
3. The sub folders contains xbrl documents of the entity
|
|
181
|
+
4. File names of xbrl documents has to be in the following convention (if files are not in the convention mentioned below, you have to use gen_for method to generate reports)
|
|
182
|
+
calculation linkbase document must end with _cal.xml
|
|
183
|
+
definition linkbase document must end with _def.xml
|
|
184
|
+
presentation linkbase document must end with _pre.xml
|
|
185
|
+
label linkbase document must end with _lab.xml
|
|
186
|
+
taxonomy file must end with .xsd
|
|
187
|
+
instance document must end with .xml
|
|
188
|
+
</pre>
|
|
189
|
+
<p>
|
|
190
|
+
calling "<a href="Report.html#M000030">gen</a>" with root folder,
|
|
191
|
+
will create reports for all entities under root folder detailed reports are
|
|
192
|
+
stored under "reports" folder of the entity. If the
|
|
193
|
+
"reports" doesn‘t exist, it will be created. Consolidated
|
|
194
|
+
report of all generated reports is stored under root folder with name
|
|
195
|
+
"edgar_report_index.html"
|
|
196
|
+
</p>
|
|
197
|
+
<p><a class="source-toggle" href="#"
|
|
198
|
+
onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
|
|
199
|
+
<div class="method-source-code" id="M000030-source">
|
|
200
|
+
<pre>
|
|
201
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/report.rb, line 122</span>
|
|
202
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">gen</span>(<span class="ruby-identifier">path_to_data_folder</span>=<span class="ruby-value str">"."</span>, <span class="ruby-identifier">report_for</span>=<span class="ruby-value str">"pre|cal"</span>, <span class="ruby-identifier">report_type</span>=<span class="ruby-value str">"html|xls|xml|json"</span>, <span class="ruby-identifier">verbose_flag</span>=<span class="ruby-value str">"q"</span>)
|
|
203
|
+
<span class="ruby-ivar">@ins_report_map</span>={}
|
|
204
|
+
<span class="ruby-identifier">files</span>=<span class="ruby-identifier">xbrl_files</span>(<span class="ruby-identifier">path_to_data_folder</span>)
|
|
205
|
+
<span class="ruby-identifier">$LOG</span>.<span class="ruby-identifier">info</span> <span class="ruby-value str">" Filtering xbrl files from folder ["</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">path_to_data_folder</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"] done"</span>
|
|
206
|
+
<span class="ruby-identifier">files</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file_map</span><span class="ruby-operator">|</span>
|
|
207
|
+
<span class="ruby-keyword kw">begin</span>
|
|
208
|
+
<span class="ruby-ivar">@ins_report_map</span>[<span class="ruby-identifier">file_map</span>[<span class="ruby-value str">"ins"</span>]]=<span class="ruby-identifier">gen_for</span>(<span class="ruby-identifier">file_map</span>, <span class="ruby-identifier">report_for</span>, <span class="ruby-identifier">report_type</span>, <span class="ruby-identifier">verbose_flag</span>)
|
|
209
|
+
<span class="ruby-identifier">$LOG</span>.<span class="ruby-identifier">info</span> <span class="ruby-value str">"Report generation for ["</span><span class="ruby-operator">+</span><span class="ruby-identifier">file_map</span>[<span class="ruby-value str">"ins"</span>]<span class="ruby-operator">+</span><span class="ruby-value str">"] completed."</span>
|
|
210
|
+
<span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span><span class="ruby-operator">:</span>
|
|
211
|
+
<span class="ruby-identifier">$LOG</span>.<span class="ruby-identifier">fatal</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>
|
|
212
|
+
<span class="ruby-keyword kw">end</span>
|
|
213
|
+
<span class="ruby-keyword kw">end</span>
|
|
214
|
+
|
|
215
|
+
<span class="ruby-identifier">erb</span> = <span class="ruby-constant">ERB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@@html_template</span>)
|
|
216
|
+
<span class="ruby-identifier">index_content</span>=<span class="ruby-identifier">erb</span>.<span class="ruby-identifier">result</span>(<span class="ruby-identifier">get_binding</span>)
|
|
217
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-value str">"master_report_index.html"</span>, <span class="ruby-value str">'w'</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">index_content</span>) }
|
|
218
|
+
|
|
219
|
+
<span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span><span class="ruby-operator">:</span>
|
|
220
|
+
<span class="ruby-identifier">$LOG</span>.<span class="ruby-identifier">fatal</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>
|
|
221
|
+
<span class="ruby-keyword kw">end</span>
|
|
222
|
+
</pre>
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
|
|
227
|
+
<div id="method-M000031" class="method-detail">
|
|
228
|
+
<a name="M000031"></a>
|
|
229
|
+
|
|
230
|
+
<div class="method-heading">
|
|
231
|
+
<a href="#M000031" class="method-signature">
|
|
232
|
+
<span class="method-name">gen_for</span><span class="method-args">(file_map, report_for="pre|cal", report_type="html|xls|xml|json", verbose_flag="q", report_dir=nil, meta_gen=true)</span>
|
|
233
|
+
</a>
|
|
234
|
+
</div>
|
|
235
|
+
|
|
236
|
+
<div class="method-description">
|
|
237
|
+
<p>
|
|
238
|
+
Generates HTML reports from given Hash that contains files for instance,
|
|
239
|
+
taxonomy, calculation, presentation, label, definition. Example of
|
|
240
|
+
populating hash,
|
|
241
|
+
</p>
|
|
242
|
+
<pre>
|
|
243
|
+
files={}
|
|
244
|
+
files["ins"] = "<instnace_file_path>"
|
|
245
|
+
files["tax"] = "<taxonomy_file_path>"
|
|
246
|
+
files["cal"] = "<calculation_linkbase_file_path>"
|
|
247
|
+
files["pre"] = "<presentation_linkbase_file_path>"
|
|
248
|
+
files["lab"] = "<label_linkbase_file_path>"
|
|
249
|
+
files["def"] = "<definition_linkbase_file_path>"
|
|
250
|
+
</pre>
|
|
251
|
+
<p>
|
|
252
|
+
Generated HTML reports will be stored under "reports" folder of
|
|
253
|
+
current dir. If the "reports" doesn‘t exist, it will be
|
|
254
|
+
created. If "cal" is passed as null, calculation linkbase path
|
|
255
|
+
from taxonomy will be used. Same for other linkbases too (ie,
|
|
256
|
+
"pre", "lab" and "def".)
|
|
257
|
+
</p>
|
|
258
|
+
<p><a class="source-toggle" href="#"
|
|
259
|
+
onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
|
|
260
|
+
<div class="method-source-code" id="M000031-source">
|
|
261
|
+
<pre>
|
|
262
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/report.rb, line 204</span>
|
|
263
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">gen_for</span> (<span class="ruby-identifier">file_map</span>, <span class="ruby-identifier">report_for</span>=<span class="ruby-value str">"pre|cal"</span>, <span class="ruby-identifier">report_type</span>=<span class="ruby-value str">"html|xls|xml|json"</span>, <span class="ruby-identifier">verbose_flag</span>=<span class="ruby-value str">"q"</span>, <span class="ruby-identifier">report_dir</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">meta_gen</span>=<span class="ruby-keyword kw">true</span>)
|
|
264
|
+
<span class="ruby-identifier">ins_file</span>=<span class="ruby-identifier">file_map</span>[<span class="ruby-value str">"ins"</span>]
|
|
265
|
+
<span class="ruby-identifier">tax_file</span>=<span class="ruby-identifier">file_map</span>[<span class="ruby-value str">"tax"</span>]
|
|
266
|
+
<span class="ruby-identifier">cal_file</span>=<span class="ruby-identifier">file_map</span>[<span class="ruby-value str">"cal"</span>]
|
|
267
|
+
<span class="ruby-identifier">pre_file</span>=<span class="ruby-identifier">file_map</span>[<span class="ruby-value str">"pre"</span>]
|
|
268
|
+
<span class="ruby-identifier">lab_file</span>=<span class="ruby-identifier">file_map</span>[<span class="ruby-value str">"lab"</span>]
|
|
269
|
+
<span class="ruby-identifier">def_file</span>=<span class="ruby-identifier">file_map</span>[<span class="ruby-value str">"def"</span>]
|
|
270
|
+
|
|
271
|
+
<span class="ruby-identifier">reports_map</span>={}
|
|
272
|
+
|
|
273
|
+
<span class="ruby-identifier">instance</span>=<span class="ruby-keyword kw">nil</span>
|
|
274
|
+
<span class="ruby-identifier">m</span>=<span class="ruby-constant">Benchmark</span>.<span class="ruby-identifier">measure</span> <span class="ruby-keyword kw">do</span>
|
|
275
|
+
<span class="ruby-identifier">instance</span> = <span class="ruby-constant">Instance</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">ins_file</span>, <span class="ruby-identifier">tax_file</span>)
|
|
276
|
+
<span class="ruby-identifier">taxonomy</span>=<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">taxonomy</span>
|
|
277
|
+
<span class="ruby-identifier">taxonomy</span>.<span class="ruby-identifier">init_all_lb</span>(<span class="ruby-identifier">cal_file</span>, <span class="ruby-identifier">pre_file</span>, <span class="ruby-identifier">lab_file</span>, <span class="ruby-identifier">def_file</span>)
|
|
278
|
+
<span class="ruby-keyword kw">end</span>
|
|
279
|
+
<span class="ruby-identifier">bm</span>(<span class="ruby-value str">" Initializing xbrl took"</span>, <span class="ruby-identifier">m</span>)
|
|
280
|
+
|
|
281
|
+
<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">entity_details</span>=<span class="ruby-ivar">@entity_details</span>
|
|
282
|
+
<span class="ruby-identifier">reports_map</span>[<span class="ruby-value str">"entity_details"</span>]=<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">entity_details</span>
|
|
283
|
+
<span class="ruby-identifier">reports_map</span>[<span class="ruby-value str">"instance"</span>]=<span class="ruby-identifier">instance</span>
|
|
284
|
+
|
|
285
|
+
<span class="ruby-identifier">report_dir</span> = (<span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">ins_file</span>)) <span class="ruby-operator">+</span> <span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">Separator</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"report"</span> <span class="ruby-operator">+</span> <span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">Separator</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">report_dir</span>.<span class="ruby-identifier">nil?</span>
|
|
286
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">makedirs</span>(<span class="ruby-identifier">report_dir</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">report_dir</span>)
|
|
287
|
+
|
|
288
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">report_for</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/pre/</span> <span class="ruby-operator">&&</span> (<span class="ruby-keyword kw">not</span> <span class="ruby-identifier">instance</span>.<span class="ruby-identifier">taxonomy</span>.<span class="ruby-identifier">prelb</span>.<span class="ruby-identifier">nil?</span>)
|
|
289
|
+
<span class="ruby-identifier">links</span>=<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">taxonomy</span>.<span class="ruby-identifier">prelb</span>.<span class="ruby-identifier">presentation</span>
|
|
290
|
+
<span class="ruby-identifier">pre_dir</span> = <span class="ruby-identifier">report_dir</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"pre"</span>
|
|
291
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">makedirs</span>(<span class="ruby-identifier">pre_dir</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">pre_dir</span>)
|
|
292
|
+
<span class="ruby-identifier">reports_map</span>[<span class="ruby-value str">"pre"</span>]=<span class="ruby-identifier">write_reports</span>(<span class="ruby-identifier">links</span>, <span class="ruby-identifier">pre_dir</span>, <span class="ruby-identifier">report_type</span>, <span class="ruby-identifier">verbose_flag</span>)
|
|
293
|
+
<span class="ruby-keyword kw">end</span>
|
|
294
|
+
|
|
295
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">report_for</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/cal/</span> <span class="ruby-operator">&&</span> (<span class="ruby-keyword kw">not</span> <span class="ruby-identifier">instance</span>.<span class="ruby-identifier">taxonomy</span>.<span class="ruby-identifier">callb</span>.<span class="ruby-identifier">nil?</span>)
|
|
296
|
+
<span class="ruby-identifier">links</span>=<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">taxonomy</span>.<span class="ruby-identifier">callb</span>.<span class="ruby-identifier">calculation</span>
|
|
297
|
+
<span class="ruby-identifier">cal_dir</span> = <span class="ruby-identifier">report_dir</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"cal"</span>
|
|
298
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">makedirs</span>(<span class="ruby-identifier">cal_dir</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">cal_dir</span>)
|
|
299
|
+
<span class="ruby-identifier">reports_map</span>[<span class="ruby-value str">"cal"</span>]=<span class="ruby-identifier">write_reports</span>(<span class="ruby-identifier">links</span>, <span class="ruby-identifier">cal_dir</span>, <span class="ruby-identifier">report_type</span>, <span class="ruby-identifier">verbose_flag</span>)
|
|
300
|
+
<span class="ruby-keyword kw">end</span>
|
|
301
|
+
|
|
302
|
+
<span class="ruby-identifier">_tmp</span> = <span class="ruby-ivar">@ins_report_map</span>
|
|
303
|
+
|
|
304
|
+
<span class="ruby-identifier">erb</span> = <span class="ruby-constant">ERB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@@html_template</span>)
|
|
305
|
+
<span class="ruby-identifier">index_content</span>=<span class="ruby-identifier">erb</span>.<span class="ruby-identifier">result</span>(<span class="ruby-identifier">lambda</span> <span class="ruby-keyword kw">do</span>
|
|
306
|
+
<span class="ruby-ivar">@ins_report_map</span>={}
|
|
307
|
+
<span class="ruby-ivar">@ins_report_map</span>[<span class="ruby-identifier">file_map</span>[<span class="ruby-value str">"ins"</span>]]=<span class="ruby-identifier">reports_map</span>
|
|
308
|
+
<span class="ruby-identifier">lambda</span> {}
|
|
309
|
+
<span class="ruby-keyword kw">end</span>.<span class="ruby-identifier">call</span>)
|
|
310
|
+
|
|
311
|
+
<span class="ruby-ivar">@ins_report_map</span> = <span class="ruby-identifier">_tmp</span>
|
|
312
|
+
|
|
313
|
+
<span class="ruby-comment cmt"># str_ci_key=reports_map["entity_details"]["ci_key"]</span>
|
|
314
|
+
<span class="ruby-comment cmt"># str_doc_end_date=reports_map["entity_details"]["doc_end_date"]</span>
|
|
315
|
+
<span class="ruby-comment cmt"># str_doc_end_date="" if str_doc_end_date.nil?</span>
|
|
316
|
+
<span class="ruby-comment cmt"># str_doc_end_date.gsub!("-", "")</span>
|
|
317
|
+
<span class="ruby-comment cmt"># report_index_file = report_dir + str_ci_key+"_"+str_doc_end_date+"_report.html"</span>
|
|
318
|
+
|
|
319
|
+
<span class="ruby-identifier">report_index_file</span> = <span class="ruby-identifier">report_dir</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"report_index.html"</span>
|
|
320
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>( <span class="ruby-identifier">report_index_file</span>, <span class="ruby-value str">'w'</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">index_content</span>) }
|
|
321
|
+
|
|
322
|
+
<span class="ruby-identifier">reports_map</span>[<span class="ruby-value str">"report_index_file"</span>]=<span class="ruby-identifier">report_index_file</span>
|
|
323
|
+
|
|
324
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">meta_gen</span>
|
|
325
|
+
<span class="ruby-identifier">meta_file_name</span> = <span class="ruby-identifier">report_dir</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"meta.json"</span>
|
|
326
|
+
<span class="ruby-identifier">meta_gen_content</span> = <span class="ruby-identifier">reports_map</span>.<span class="ruby-identifier">reject</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">k</span><span class="ruby-operator">==</span><span class="ruby-value str">"instance"</span>}.<span class="ruby-identifier">to_json</span>.<span class="ruby-identifier">to_s</span>
|
|
327
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>( <span class="ruby-identifier">meta_file_name</span>, <span class="ruby-value str">'w'</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">meta_gen_content</span>) }
|
|
328
|
+
<span class="ruby-identifier">reports_map</span>[<span class="ruby-value str">"report_meta_file"</span>]=<span class="ruby-identifier">meta_file_name</span>
|
|
329
|
+
<span class="ruby-keyword kw">end</span>
|
|
330
|
+
|
|
331
|
+
<span class="ruby-identifier">reports_map</span>
|
|
332
|
+
<span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
|
333
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">" Report generation failed for instance "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">ins_file</span> <span class="ruby-operator">+</span> <span class="ruby-node">"\n #{e.to_s + "\n" + e.backtrace.join("\n ")}"</span>
|
|
334
|
+
<span class="ruby-keyword kw">end</span>
|
|
335
|
+
</pre>
|
|
336
|
+
</div>
|
|
337
|
+
</div>
|
|
338
|
+
</div>
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
</div>
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
</div>
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
<div id="validator-badges">
|
|
348
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
349
|
+
</div>
|
|
350
|
+
|
|
351
|
+
</body>
|
|
352
|
+
</html>
|