xbrlware-ce 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (194) hide show
  1. data/Copying.txt +13 -0
  2. data/License.txt +13 -0
  3. data/Rakefile.rb +124 -0
  4. data/Readme.txt +15 -0
  5. data/doc/classes/Edgar.html +144 -0
  6. data/doc/classes/Edgar/HTMLFeedDownloader.html +199 -0
  7. data/doc/classes/Edgar/RSSFeedDownloader.html +225 -0
  8. data/doc/classes/Xbrlware.html +350 -0
  9. data/doc/classes/Xbrlware/Context.html +429 -0
  10. data/doc/classes/Xbrlware/Entity.html +323 -0
  11. data/doc/classes/Xbrlware/Identifier.html +191 -0
  12. data/doc/classes/Xbrlware/Instance.html +742 -0
  13. data/doc/classes/Xbrlware/Item.html +278 -0
  14. data/doc/classes/Xbrlware/LBConstants.html +144 -0
  15. data/doc/classes/Xbrlware/Linkbase.html +131 -0
  16. data/doc/classes/Xbrlware/Linkbase/CalculationLinkbase.html +212 -0
  17. data/doc/classes/Xbrlware/Linkbase/CalculationLinkbase/Calculation.html +172 -0
  18. data/doc/classes/Xbrlware/Linkbase/CalculationLinkbase/Calculation/CalculationArc.html +166 -0
  19. data/doc/classes/Xbrlware/Linkbase/DefinitionLinkbase.html +210 -0
  20. data/doc/classes/Xbrlware/Linkbase/DefinitionLinkbase/Definition.html +204 -0
  21. data/doc/classes/Xbrlware/Linkbase/DefinitionLinkbase/Definition/DefinitionArc.html +160 -0
  22. data/doc/classes/Xbrlware/Linkbase/LabelLinkbase.html +239 -0
  23. data/doc/classes/Xbrlware/Linkbase/LabelLinkbase/Label.html +189 -0
  24. data/doc/classes/Xbrlware/Linkbase/Linkbase.html +172 -0
  25. data/doc/classes/Xbrlware/Linkbase/Linkbase/Link.html +217 -0
  26. data/doc/classes/Xbrlware/Linkbase/Linkbase/Link/Arc.html +284 -0
  27. data/doc/classes/Xbrlware/Linkbase/PresentationLinkbase.html +224 -0
  28. data/doc/classes/Xbrlware/Linkbase/PresentationLinkbase/Presentation.html +222 -0
  29. data/doc/classes/Xbrlware/Linkbase/PresentationLinkbase/Presentation/PresentationArc.html +160 -0
  30. data/doc/classes/Xbrlware/Taxonomy.html +369 -0
  31. data/doc/classes/Xbrlware/TaxonomyDefintion.html +177 -0
  32. data/doc/classes/Xbrlware/Unit.html +179 -0
  33. data/doc/classes/Xbrlware/Unit/Divide.html +165 -0
  34. data/doc/created.rid +1 -0
  35. data/doc/files/Readme_txt.html +124 -0
  36. data/doc/files/lib/edgar/edgar_data_downloader_rb.html +129 -0
  37. data/doc/files/lib/edgar/util_rb.html +129 -0
  38. data/doc/files/lib/edgar_rb.html +141 -0
  39. data/doc/files/lib/xbrlware/constants_rb.html +129 -0
  40. data/doc/files/lib/xbrlware/context_rb.html +129 -0
  41. data/doc/files/lib/xbrlware/date_util_rb.html +129 -0
  42. data/doc/files/lib/xbrlware/float_patch_rb.html +129 -0
  43. data/doc/files/lib/xbrlware/hash_util_rb.html +129 -0
  44. data/doc/files/lib/xbrlware/instance_rb.html +129 -0
  45. data/doc/files/lib/xbrlware/item_rb.html +129 -0
  46. data/doc/files/lib/xbrlware/linkbase/calculation_linkbase_rb.html +129 -0
  47. data/doc/files/lib/xbrlware/linkbase/definition_linkbase_rb.html +129 -0
  48. data/doc/files/lib/xbrlware/linkbase/label_linkbase_rb.html +129 -0
  49. data/doc/files/lib/xbrlware/linkbase/linkbase_rb.html +129 -0
  50. data/doc/files/lib/xbrlware/linkbase/presentation_linkbase_rb.html +129 -0
  51. data/doc/files/lib/xbrlware/meta_util_rb.html +129 -0
  52. data/doc/files/lib/xbrlware/taxonomy_rb.html +129 -0
  53. data/doc/files/lib/xbrlware/unit_rb.html +129 -0
  54. data/doc/files/lib/xbrlware/util_rb.html +129 -0
  55. data/doc/files/lib/xbrlware/xml_parser_rb.html +129 -0
  56. data/doc/files/lib/xbrlware_rb.html +163 -0
  57. data/doc/fr_class_index.html +55 -0
  58. data/doc/fr_file_index.html +48 -0
  59. data/doc/fr_method_index.html +104 -0
  60. data/doc/index.html +24 -0
  61. data/doc/rdoc-style.css +208 -0
  62. data/example/benchmark/instance_parser_benchmark.rb +25 -0
  63. data/example/case_study/buy_strategy.rb +34 -0
  64. data/example/case_study/c-20091230.xml +29 -0
  65. data/example/case_study/c_sell_strategy.rb +29 -0
  66. data/example/lang_integration/thrift/rating-client.py +21 -0
  67. data/example/lang_integration/thrift/rating-impl.rb +13 -0
  68. data/example/lang_integration/thrift/rating-server.rb +25 -0
  69. data/example/lang_integration/thrift/rating.thrift +52 -0
  70. data/example/quick_start/foo.rb +10 -0
  71. data/example/quick_start/foo.xml +29 -0
  72. data/example/quick_start/print_item.rb +27 -0
  73. data/lib/edgar.rb +30 -0
  74. data/lib/edgar/edgar_data_downloader.rb +126 -0
  75. data/lib/edgar/util.rb +30 -0
  76. data/lib/xbrlware.rb +65 -0
  77. data/lib/xbrlware/constants.rb +29 -0
  78. data/lib/xbrlware/context.rb +148 -0
  79. data/lib/xbrlware/date_util.rb +35 -0
  80. data/lib/xbrlware/float_patch.rb +26 -0
  81. data/lib/xbrlware/hash_util.rb +175 -0
  82. data/lib/xbrlware/instance.rb +406 -0
  83. data/lib/xbrlware/item.rb +115 -0
  84. data/lib/xbrlware/linkbase/calculation_linkbase.rb +137 -0
  85. data/lib/xbrlware/linkbase/definition_linkbase.rb +186 -0
  86. data/lib/xbrlware/linkbase/label_linkbase.rb +128 -0
  87. data/lib/xbrlware/linkbase/linkbase.rb +170 -0
  88. data/lib/xbrlware/linkbase/presentation_linkbase.rb +160 -0
  89. data/lib/xbrlware/meta_util.rb +45 -0
  90. data/lib/xbrlware/taxonomies/us_gaap_taxonomy_20090131.rb +40365 -0
  91. data/lib/xbrlware/taxonomy.rb +133 -0
  92. data/lib/xbrlware/unit.rb +42 -0
  93. data/lib/xbrlware/util.rb +83 -0
  94. data/lib/xbrlware/xml_parser.rb +122 -0
  95. data/setup.rb +1585 -0
  96. data/test/lib/edgar/edgar_data_downloader_test.rb +35 -0
  97. data/test/lib/edgar/resources/0000930413-09-005485-index.htm +331 -0
  98. data/test/lib/edgar/resources/usgaap.rss.xml +2861 -0
  99. data/test/lib/xbrlware/411_footnotes_test.rb +65 -0
  100. data/test/lib/xbrlware/42_schemaref_test.rb +20 -0
  101. data/test/lib/xbrlware/46_item_test.rb +253 -0
  102. data/test/lib/xbrlware/47_context_test.rb +129 -0
  103. data/test/lib/xbrlware/48_unit_test.rb +45 -0
  104. data/test/lib/xbrlware/49_tuple_test.rb +12 -0
  105. data/test/lib/xbrlware/date_util_test.rb +24 -0
  106. data/test/lib/xbrlware/dimension/context_explicit_dimension_test.rb +40 -0
  107. data/test/lib/xbrlware/dimension/resources/context_explicit_dimension.xml +84 -0
  108. data/test/lib/xbrlware/float_patch_test.rb +10 -0
  109. data/test/lib/xbrlware/hash_util_test.rb +29 -0
  110. data/test/lib/xbrlware/instance_test.rb +250 -0
  111. data/test/lib/xbrlware/linkbase/calculation_linkbase_test.rb +39 -0
  112. data/test/lib/xbrlware/linkbase/definition_linkbase_test.rb +35 -0
  113. data/test/lib/xbrlware/linkbase/label_linkbase_test.rb +22 -0
  114. data/test/lib/xbrlware/linkbase/linkbase_test.rb +36 -0
  115. data/test/lib/xbrlware/linkbase/linkbase_test_util.rb +98 -0
  116. data/test/lib/xbrlware/linkbase/presentation_linkbase_test.rb +33 -0
  117. data/test/lib/xbrlware/linkbase/report.html +62 -0
  118. data/test/lib/xbrlware/linkbase/resources/cal.xml +219 -0
  119. data/test/lib/xbrlware/linkbase/resources/def.xml +186 -0
  120. data/test/lib/xbrlware/linkbase/resources/def_with_multiple_dimension.xml +41 -0
  121. data/test/lib/xbrlware/linkbase/resources/instance.xml +5822 -0
  122. data/test/lib/xbrlware/linkbase/resources/lab.xml +782 -0
  123. data/test/lib/xbrlware/linkbase/resources/pre.xml +485 -0
  124. data/test/lib/xbrlware/linkbase/resources/report_10_q.htm +12327 -0
  125. data/test/lib/xbrlware/linkbase/resources/taxonomy.xsd +178 -0
  126. data/test/lib/xbrlware/linkbase/sample_html_report.html +40 -0
  127. data/test/lib/xbrlware/meta_util_test.rb +23 -0
  128. data/test/lib/xbrlware/resources/411/411_footnotes.xml +66 -0
  129. data/test/lib/xbrlware/resources/42/42_schema_ref_with_base.xml +7 -0
  130. data/test/lib/xbrlware/resources/42/42_schema_ref_without_base.xml +7 -0
  131. data/test/lib/xbrlware/resources/46/46_item_value.xml +61 -0
  132. data/test/lib/xbrlware/resources/47/472_period_forever.xml +29 -0
  133. data/test/lib/xbrlware/resources/47/472_period_instant.xml +24 -0
  134. data/test/lib/xbrlware/resources/47/472_period_start_dt_and_end_dt.xml +30 -0
  135. data/test/lib/xbrlware/resources/47/4731_entity_identifier.xml +29 -0
  136. data/test/lib/xbrlware/resources/47/4732_entity_segment_not_present.xml +24 -0
  137. data/test/lib/xbrlware/resources/47/4732_entity_segment_present.xml +30 -0
  138. data/test/lib/xbrlware/resources/47/474_scenario_not_present.xml +26 -0
  139. data/test/lib/xbrlware/resources/47/474_scenario_present.xml +30 -0
  140. data/test/lib/xbrlware/resources/47/47_multiple_contexts.xml +36 -0
  141. data/test/lib/xbrlware/resources/48/482_unit_measure.xml +32 -0
  142. data/test/lib/xbrlware/resources/48/483_unit_divide.xml +39 -0
  143. data/test/lib/xbrlware/resources/48/48_multiple_units.xml +43 -0
  144. data/test/lib/xbrlware/resources/49/49_tuple.xml +61 -0
  145. data/test/lib/xbrlware/resources/49_tuple.xsd +44 -0
  146. data/test/lib/xbrlware/resources/instance.xml +128 -0
  147. data/test/lib/xbrlware/resources/report_test_xbrl_files/cal.xml +219 -0
  148. data/test/lib/xbrlware/resources/report_test_xbrl_files/def.xml +186 -0
  149. data/test/lib/xbrlware/resources/report_test_xbrl_files/instance.xml +5822 -0
  150. data/test/lib/xbrlware/resources/report_test_xbrl_files/lab.xml +782 -0
  151. data/test/lib/xbrlware/resources/report_test_xbrl_files/pre.xml +485 -0
  152. data/test/lib/xbrlware/resources/report_test_xbrl_files/report/report_index.html +62 -0
  153. data/test/lib/xbrlware/resources/report_test_xbrl_files/taxonomy.xsd +178 -0
  154. data/test/lib/xbrlware/resources/taxonomy_test_files/1/cal.xml +223 -0
  155. data/test/lib/xbrlware/resources/taxonomy_test_files/1/def.xml +190 -0
  156. data/test/lib/xbrlware/resources/taxonomy_test_files/1/lab.xml +786 -0
  157. data/test/lib/xbrlware/resources/taxonomy_test_files/1/pre.xml +489 -0
  158. data/test/lib/xbrlware/resources/taxonomy_test_files/1/taxonomy.xsd +177 -0
  159. data/test/lib/xbrlware/resources/taxonomy_test_files/2/linkbases/cal.xml +223 -0
  160. data/test/lib/xbrlware/resources/taxonomy_test_files/2/linkbases/def.xml +190 -0
  161. data/test/lib/xbrlware/resources/taxonomy_test_files/2/linkbases/lab.xml +786 -0
  162. data/test/lib/xbrlware/resources/taxonomy_test_files/2/linkbases/pre.xml +489 -0
  163. data/test/lib/xbrlware/resources/taxonomy_test_files/2/taxonomy.xsd +175 -0
  164. data/test/lib/xbrlware/resources/taxonomy_test_files/3/taxonomy.xsd +175 -0
  165. data/test/lib/xbrlware/resources/us_gaap_schema.xsd +8 -0
  166. data/test/lib/xbrlware/resources/us_gaap_schema_local.xsd +10 -0
  167. data/test/lib/xbrlware/resources/util_test_xbrl_files/cal.xml +219 -0
  168. data/test/lib/xbrlware/resources/util_test_xbrl_files/def.xml +186 -0
  169. data/test/lib/xbrlware/resources/util_test_xbrl_files/instance.xml +5822 -0
  170. data/test/lib/xbrlware/resources/util_test_xbrl_files/lab.xml +782 -0
  171. data/test/lib/xbrlware/resources/util_test_xbrl_files/pre.xml +485 -0
  172. data/test/lib/xbrlware/resources/util_test_xbrl_files/taxonomy.xsd +178 -0
  173. data/test/lib/xbrlware/resources/xbrl_xsd/dei-2009-01-31.xsd +162 -0
  174. data/test/lib/xbrlware/resources/xbrl_xsd/dei-std-2009-01-31.xsd +23 -0
  175. data/test/lib/xbrlware/resources/xbrl_xsd/negated-2008-03-31.xsd +23 -0
  176. data/test/lib/xbrlware/resources/xbrl_xsd/ref-2006-02-27.xsd +121 -0
  177. data/test/lib/xbrlware/resources/xbrl_xsd/us-gaap-2009-01-31.xsd +13474 -0
  178. data/test/lib/xbrlware/resources/xbrl_xsd/us-roles-2009-01-31.xsd +2283 -0
  179. data/test/lib/xbrlware/resources/xbrl_xsd/us-types-2009-01-31.xsd +368 -0
  180. data/test/lib/xbrlware/resources/xbrl_xsd/xbrl-instance-2003-12-31.xsd +772 -0
  181. data/test/lib/xbrlware/resources/xbrl_xsd/xbrl-linkbase-2003-12-31.xsd +477 -0
  182. data/test/lib/xbrlware/resources/xbrl_xsd/xbrldi-2006.xsd +41 -0
  183. data/test/lib/xbrlware/resources/xbrl_xsd/xbrldt-2005.xsd +53 -0
  184. data/test/lib/xbrlware/resources/xbrl_xsd/xl-2003-12-31.xsd +246 -0
  185. data/test/lib/xbrlware/resources/xbrl_xsd/xlink-2003-12-31.xsd +117 -0
  186. data/test/lib/xbrlware/taxonomy_test.rb +124 -0
  187. data/test/lib/xbrlware/util_test.rb +18 -0
  188. data/test/lib/xbrlware/xml_parser_test.rb +142 -0
  189. data/test/schema_validator_jruby.rb +40 -0
  190. data/test/schema_validator_ruby.rb +7 -0
  191. data/test/scratchpad/block.rb +36 -0
  192. data/test/test_helper.rb +21 -0
  193. data/xbrlware.iml +30 -0
  194. metadata +261 -0
@@ -0,0 +1,225 @@
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: Edgar::RSSFeedDownloader</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">Edgar::RSSFeedDownloader</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/edgar/edgar_data_downloader_rb.html">
59
+ lib/edgar/edgar_data_downloader.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 method to <a
84
+ href="RSSFeedDownloader.html#M000077">download</a> XBRL files from
85
+ SEC&#8216;s XBRL RSS Feed. See <a
86
+ href="http://code.google.com/p/xbrlware/wiki/ReportGeneration">report
87
+ generation xbrlware wiki</a> for how to use this class.
88
+ </p>
89
+
90
+ </div>
91
+
92
+
93
+ </div>
94
+
95
+ <div id="method-list">
96
+ <h3 class="section-bar">Methods</h3>
97
+
98
+ <div class="name-list">
99
+ <a href="#M000077">download</a>&nbsp;&nbsp;
100
+ <a href="#M000076">new</a>&nbsp;&nbsp;
101
+ </div>
102
+ </div>
103
+
104
+ </div>
105
+
106
+
107
+ <!-- if includes -->
108
+ <div id="includes">
109
+ <h3 class="section-bar">Included Modules</h3>
110
+
111
+ <div id="includes-list">
112
+ <span class="include-name">FileUtil</span>
113
+ </div>
114
+ </div>
115
+
116
+ <div id="section">
117
+
118
+
119
+
120
+
121
+
122
+ <div id="attribute-list">
123
+ <h3 class="section-bar">Attributes</h3>
124
+
125
+ <div class="name-list">
126
+ <table>
127
+ <tr class="top-aligned-row context-row">
128
+ <td class="context-item-name">content</td>
129
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
130
+ <td class="context-item-desc"></td>
131
+ </tr>
132
+ </table>
133
+ </div>
134
+ </div>
135
+
136
+
137
+
138
+ <!-- if method_list -->
139
+ <div id="methods">
140
+ <h3 class="section-bar">Public Class methods</h3>
141
+
142
+ <div id="method-M000076" class="method-detail">
143
+ <a name="M000076"></a>
144
+
145
+ <div class="method-heading">
146
+ <a href="#M000076" class="method-signature">
147
+ <span class="method-name">new</span><span class="method-args">(sec_edgar_rss_file=nil)</span>
148
+ </a>
149
+ </div>
150
+
151
+ <div class="method-description">
152
+ <p><a class="source-toggle" href="#"
153
+ onclick="toggleCode('M000076-source');return false;">[Source]</a></p>
154
+ <div class="method-source-code" id="M000076-source">
155
+ <pre>
156
+ <span class="ruby-comment cmt"># File lib/edgar/edgar_data_downloader.rb, line 29</span>
157
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">sec_edgar_rss_file</span>=<span class="ruby-keyword kw">nil</span>)
158
+ <span class="ruby-identifier">sec_edgar_rss_file</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">&quot;http://www.sec.gov/Archives/edgar/usgaap.rss.xml&quot;</span>
159
+ <span class="ruby-ivar">@content</span> = <span class="ruby-constant">XmlSimple</span>.<span class="ruby-identifier">xml_in</span>(<span class="ruby-identifier">open</span>(<span class="ruby-identifier">sec_edgar_rss_file</span>).<span class="ruby-identifier">read</span>, {<span class="ruby-value str">'ForceContent'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>})
160
+ <span class="ruby-keyword kw">end</span>
161
+ </pre>
162
+ </div>
163
+ </div>
164
+ </div>
165
+
166
+ <h3 class="section-bar">Public Instance methods</h3>
167
+
168
+ <div id="method-M000077" class="method-detail">
169
+ <a name="M000077"></a>
170
+
171
+ <div class="method-heading">
172
+ <a href="#M000077" class="method-signature">
173
+ <span class="method-name">download</span><span class="method-args">(limit=100, download_to=File.expand_path(&quot;.&quot;)+File::SEPARATOR+&quot;edgar_data&quot;)</span>
174
+ </a>
175
+ </div>
176
+
177
+ <div class="method-description">
178
+ <p>
179
+ Takes limit (how many entities to <a
180
+ href="RSSFeedDownloader.html#M000077">download</a>), download_to (where to
181
+ <a href="RSSFeedDownloader.html#M000077">download</a>)
182
+ </p>
183
+ <pre>
184
+ default value for limit is 100
185
+ default value for download_to is current_dir + &quot;/edgar_data&quot;
186
+ </pre>
187
+ <p><a class="source-toggle" href="#"
188
+ onclick="toggleCode('M000077-source');return false;">[Source]</a></p>
189
+ <div class="method-source-code" id="M000077-source">
190
+ <pre>
191
+ <span class="ruby-comment cmt"># File lib/edgar/edgar_data_downloader.rb, line 37</span>
192
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">download</span>(<span class="ruby-identifier">limit</span>=<span class="ruby-value">100</span>, <span class="ruby-identifier">download_to</span>=<span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-value str">&quot;.&quot;</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">&quot;edgar_data&quot;</span>)
193
+ <span class="ruby-identifier">items</span>=<span class="ruby-ivar">@content</span>[<span class="ruby-value str">&quot;channel&quot;</span>][<span class="ruby-value">0</span>][<span class="ruby-value str">&quot;item&quot;</span>]
194
+ <span class="ruby-identifier">items</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">item</span>, <span class="ruby-identifier">index</span><span class="ruby-operator">|</span>
195
+ <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">index</span><span class="ruby-operator">==</span><span class="ruby-identifier">limit</span>
196
+ <span class="ruby-identifier">files</span>=<span class="ruby-identifier">get_xbrl_files</span>(<span class="ruby-identifier">item</span>)
197
+ <span class="ruby-identifier">download_to</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">unless</span> <span class="ruby-identifier">download_to</span>.<span class="ruby-identifier">end_with?</span>(<span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">SEPARATOR</span>)
198
+ <span class="ruby-identifier">data_dir</span>=<span class="ruby-identifier">download_to</span>
199
+ <span class="ruby-identifier">data_dir</span>=<span class="ruby-identifier">data_dir</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-identifier">item</span>[<span class="ruby-value str">&quot;xbrlFiling&quot;</span>][<span class="ruby-value">0</span>][<span class="ruby-value str">&quot;cikNumber&quot;</span>][<span class="ruby-value">0</span>][<span class="ruby-value str">&quot;content&quot;</span>]
200
+ <span class="ruby-identifier">data_dir</span>=<span class="ruby-identifier">data_dir</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-identifier">item</span>[<span class="ruby-value str">&quot;xbrlFiling&quot;</span>][<span class="ruby-value">0</span>][<span class="ruby-value str">&quot;accessionNumber&quot;</span>][<span class="ruby-value">0</span>][<span class="ruby-value str">&quot;content&quot;</span>]
201
+ <span class="ruby-identifier">mkdir</span>(<span class="ruby-identifier">data_dir</span>)
202
+ <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</span><span class="ruby-operator">|</span>
203
+ <span class="ruby-identifier">file_content</span>=<span class="ruby-identifier">open</span>(<span class="ruby-identifier">file</span>[<span class="ruby-value str">&quot;url&quot;</span>]).<span class="ruby-identifier">read</span>
204
+ <span class="ruby-identifier">dump_to_file</span>(<span class="ruby-identifier">data_dir</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-identifier">file</span>[<span class="ruby-value str">&quot;file&quot;</span>], <span class="ruby-identifier">file_content</span>)
205
+ <span class="ruby-keyword kw">end</span>
206
+ <span class="ruby-keyword kw">end</span>
207
+ <span class="ruby-keyword kw">end</span>
208
+ </pre>
209
+ </div>
210
+ </div>
211
+ </div>
212
+
213
+
214
+ </div>
215
+
216
+
217
+ </div>
218
+
219
+
220
+ <div id="validator-badges">
221
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
222
+ </div>
223
+
224
+ </body>
225
+ </html>
@@ -0,0 +1,350 @@
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>Module: Xbrlware</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>Module</strong></td>
53
+ <td class="class-name-in-header">Xbrlware</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../files/lib/xbrlware/linkbase/definition_linkbase_rb.html">
59
+ lib/xbrlware/linkbase/definition_linkbase.rb
60
+ </a>
61
+ <br />
62
+ <a href="../files/lib/xbrlware/linkbase/presentation_linkbase_rb.html">
63
+ lib/xbrlware/linkbase/presentation_linkbase.rb
64
+ </a>
65
+ <br />
66
+ <a href="../files/lib/xbrlware/linkbase/linkbase_rb.html">
67
+ lib/xbrlware/linkbase/linkbase.rb
68
+ </a>
69
+ <br />
70
+ <a href="../files/lib/xbrlware/linkbase/calculation_linkbase_rb.html">
71
+ lib/xbrlware/linkbase/calculation_linkbase.rb
72
+ </a>
73
+ <br />
74
+ <a href="../files/lib/xbrlware/linkbase/label_linkbase_rb.html">
75
+ lib/xbrlware/linkbase/label_linkbase.rb
76
+ </a>
77
+ <br />
78
+ <a href="../files/lib/xbrlware/hash_util_rb.html">
79
+ lib/xbrlware/hash_util.rb
80
+ </a>
81
+ <br />
82
+ <a href="../files/lib/xbrlware/constants_rb.html">
83
+ lib/xbrlware/constants.rb
84
+ </a>
85
+ <br />
86
+ <a href="../files/lib/xbrlware/instance_rb.html">
87
+ lib/xbrlware/instance.rb
88
+ </a>
89
+ <br />
90
+ <a href="../files/lib/xbrlware/date_util_rb.html">
91
+ lib/xbrlware/date_util.rb
92
+ </a>
93
+ <br />
94
+ <a href="../files/lib/xbrlware/xml_parser_rb.html">
95
+ lib/xbrlware/xml_parser.rb
96
+ </a>
97
+ <br />
98
+ <a href="../files/lib/xbrlware/util_rb.html">
99
+ lib/xbrlware/util.rb
100
+ </a>
101
+ <br />
102
+ <a href="../files/lib/xbrlware/meta_util_rb.html">
103
+ lib/xbrlware/meta_util.rb
104
+ </a>
105
+ <br />
106
+ <a href="../files/lib/xbrlware/context_rb.html">
107
+ lib/xbrlware/context.rb
108
+ </a>
109
+ <br />
110
+ <a href="../files/lib/xbrlware/unit_rb.html">
111
+ lib/xbrlware/unit.rb
112
+ </a>
113
+ <br />
114
+ <a href="../files/lib/xbrlware/item_rb.html">
115
+ lib/xbrlware/item.rb
116
+ </a>
117
+ <br />
118
+ <a href="../files/lib/xbrlware/taxonomy_rb.html">
119
+ lib/xbrlware/taxonomy.rb
120
+ </a>
121
+ <br />
122
+ </td>
123
+ </tr>
124
+
125
+ </table>
126
+ </div>
127
+ <!-- banner header -->
128
+
129
+ <div id="bodyContent">
130
+
131
+
132
+
133
+ <div id="contextContent">
134
+
135
+ <div id="description">
136
+ <table>
137
+ <tr><td valign="top">Author:</td><td>xbrlware@bitstat.com
138
+
139
+ </td></tr>
140
+ <tr><td valign="top">Copyright:</td><td>2009, 2010 bitstat (<a href="http://www.bitstat.com">www.bitstat.com</a>).
141
+ All Rights Reserved.
142
+
143
+ </td></tr>
144
+ <tr><td valign="top">License:</td><td>Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
145
+ you may not use this file except in compliance with the License. You may
146
+ obtain a copy of the License at
147
+
148
+ <p>
149
+ <a
150
+ href="http://www.apache.org/licenses/LICENSE-2.0">www.apache.org/licenses/LICENSE-2.0</a>
151
+ </p>
152
+ <p>
153
+ Unless required by applicable law or agreed to in writing, software
154
+ distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
155
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
156
+ See the License for the specific language governing permissions and
157
+ limitations under the License.
158
+ </p>
159
+ </td></tr>
160
+ </table>
161
+
162
+ </div>
163
+
164
+
165
+ </div>
166
+
167
+ <div id="method-list">
168
+ <h3 class="section-bar">Methods</h3>
169
+
170
+ <div class="name-list">
171
+ <a href="#M000001">file_grep</a>&nbsp;&nbsp;
172
+ <a href="#M000002">ins</a>&nbsp;&nbsp;
173
+ </div>
174
+ </div>
175
+
176
+ </div>
177
+
178
+
179
+ <!-- if includes -->
180
+
181
+ <div id="section">
182
+
183
+ <div id="class-list">
184
+ <h3 class="section-bar">Classes and Modules</h3>
185
+
186
+ Module <a href="Xbrlware/LBConstants.html" class="link">Xbrlware::LBConstants</a><br />
187
+ Module <a href="Xbrlware/Linkbase.html" class="link">Xbrlware::Linkbase</a><br />
188
+ Class <a href="Xbrlware/Context.html" class="link">Xbrlware::Context</a><br />
189
+ Class <a href="Xbrlware/Entity.html" class="link">Xbrlware::Entity</a><br />
190
+ Class <a href="Xbrlware/Identifier.html" class="link">Xbrlware::Identifier</a><br />
191
+ Class <a href="Xbrlware/Instance.html" class="link">Xbrlware::Instance</a><br />
192
+ Class <a href="Xbrlware/Item.html" class="link">Xbrlware::Item</a><br />
193
+ Class <a href="Xbrlware/Taxonomy.html" class="link">Xbrlware::Taxonomy</a><br />
194
+ Class <a href="Xbrlware/TaxonomyDefintion.html" class="link">Xbrlware::TaxonomyDefintion</a><br />
195
+ Class <a href="Xbrlware/Unit.html" class="link">Xbrlware::Unit</a><br />
196
+
197
+ </div>
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+ <!-- if method_list -->
206
+ <div id="methods">
207
+ <h3 class="section-bar">Public Class methods</h3>
208
+
209
+ <div id="method-M000001" class="method-detail">
210
+ <a name="M000001"></a>
211
+
212
+ <div class="method-heading">
213
+ <a href="#M000001" class="method-signature">
214
+ <span class="method-name">file_grep</span><span class="method-args">(dir_path=&quot;.&quot;)</span>
215
+ </a>
216
+ </div>
217
+
218
+ <div class="method-description">
219
+ <p>
220
+ Method to grep xbrl file names from given dir File names of xbrl documents
221
+ has to be in the following convention to use this method,
222
+ </p>
223
+ <pre>
224
+ calculation linkbase document must end with _cal.xml
225
+ definition linkbase document must end with _def.xml
226
+ presentation linkbase document must end with _pre.xml
227
+ label linkbase document must end with _lab.xml
228
+ taxonomy file muse end with .xsd
229
+ </pre>
230
+ <p><a class="source-toggle" href="#"
231
+ onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
232
+ <div class="method-source-code" id="M000001-source">
233
+ <pre>
234
+ <span class="ruby-comment cmt"># File lib/xbrlware/util.rb, line 29</span>
235
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">file_grep</span> (<span class="ruby-identifier">dir_path</span>=<span class="ruby-value str">&quot;.&quot;</span>)
236
+
237
+ <span class="ruby-identifier">taxonomy_file</span>=<span class="ruby-keyword kw">nil</span>
238
+ <span class="ruby-identifier">instance_file</span>=<span class="ruby-keyword kw">nil</span>
239
+
240
+ <span class="ruby-identifier">pre_file</span>=<span class="ruby-keyword kw">nil</span>
241
+ <span class="ruby-identifier">cal_file</span>=<span class="ruby-keyword kw">nil</span>
242
+ <span class="ruby-identifier">lab_file</span>=<span class="ruby-keyword kw">nil</span>
243
+ <span class="ruby-identifier">def_file</span>=<span class="ruby-keyword kw">nil</span>
244
+
245
+ <span class="ruby-identifier">files</span>=<span class="ruby-constant">Dir</span>[<span class="ruby-identifier">dir_path</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">&quot;*&quot;</span>]
246
+
247
+ <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</span><span class="ruby-operator">|</span>
248
+ <span class="ruby-keyword kw">case</span>
249
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">end_with?</span>(<span class="ruby-value str">&quot;.xsd&quot;</span>)<span class="ruby-operator">:</span>
250
+ <span class="ruby-identifier">taxonomy_file</span> = <span class="ruby-identifier">file</span>
251
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">end_with?</span>(<span class="ruby-value str">&quot;pre.xml&quot;</span>)<span class="ruby-operator">:</span>
252
+ <span class="ruby-identifier">pre_file</span> = <span class="ruby-identifier">file</span>
253
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">end_with?</span>(<span class="ruby-value str">&quot;cal.xml&quot;</span>)<span class="ruby-operator">:</span>
254
+ <span class="ruby-identifier">cal_file</span> = <span class="ruby-identifier">file</span>
255
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">end_with?</span>(<span class="ruby-value str">&quot;def.xml&quot;</span>)<span class="ruby-operator">:</span>
256
+ <span class="ruby-identifier">def_file</span> = <span class="ruby-identifier">file</span>
257
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">end_with?</span>(<span class="ruby-value str">&quot;lab.xml&quot;</span>)<span class="ruby-operator">:</span>
258
+ <span class="ruby-identifier">lab_file</span> = <span class="ruby-identifier">file</span>
259
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">end_with?</span>(<span class="ruby-value str">&quot;.xml&quot;</span>)<span class="ruby-operator">:</span>
260
+ <span class="ruby-identifier">instance_file</span> = <span class="ruby-identifier">file</span>
261
+ <span class="ruby-keyword kw">end</span>
262
+ <span class="ruby-keyword kw">end</span>
263
+
264
+ {<span class="ruby-value str">&quot;ins&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">instance_file</span>, <span class="ruby-value str">&quot;tax&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">taxonomy_file</span>, <span class="ruby-value str">&quot;pre&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">pre_file</span>, <span class="ruby-value str">&quot;cal&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">cal_file</span>, <span class="ruby-value str">&quot;lab&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">lab_file</span>, <span class="ruby-value str">&quot;def&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">def_file</span>}
265
+ <span class="ruby-keyword kw">end</span>
266
+ </pre>
267
+ </div>
268
+ </div>
269
+ </div>
270
+
271
+ <div id="method-M000002" class="method-detail">
272
+ <a name="M000002"></a>
273
+
274
+ <div class="method-heading">
275
+ <a href="#M000002" class="method-signature">
276
+ <span class="method-name">ins</span><span class="method-args">(instance_string, taxonomy_string=nil)</span>
277
+ </a>
278
+ </div>
279
+
280
+ <div class="method-description">
281
+ <p>
282
+ Initializes and returns an <a href="Xbrlware/Instance.html">Instance</a>.
283
+ </p>
284
+ <table>
285
+ <tr><td valign="top">instance_string:</td><td>XBRL <a href="Xbrlware/Instance.html">Instance</a> source. Could be one of
286
+ the following:
287
+
288
+ <ul>
289
+ <li>nil: Tries to load and parse &#8217;&lt;scriptname&gt;.xml&#8217;.
290
+
291
+ </li>
292
+ <li>filename: Tries to load and parse filename.
293
+
294
+ </li>
295
+ <li>IO object: Reads from object until EOF is detected and parses result.
296
+
297
+ </li>
298
+ <li>XML string: Parses string.
299
+
300
+ </li>
301
+ </ul>
302
+ </td></tr>
303
+ <tr><td valign="top">taxonomy_string:</td><td>optional parameter, XBRL <a href="Xbrlware/Taxonomy.html">Taxonomy</a>
304
+ source. Could be one of the following:
305
+
306
+ <ul>
307
+ <li>nil: taxonomy file specified in the instance file would be used if present.
308
+
309
+ </li>
310
+ <li>filename: Tries to load and parse filename., taxonomy file specified in the
311
+ instance document will be ignored
312
+
313
+ </li>
314
+ <li>IO object: Reads from object until EOF is detected and parses result,
315
+ taxonomy file specified in the instance document will be ignored
316
+
317
+ </li>
318
+ <li>XML string: Parses string, taxonomy file specified in the instance document
319
+ will be ignored
320
+
321
+ </li>
322
+ </ul>
323
+ </td></tr>
324
+ </table>
325
+ <p><a class="source-toggle" href="#"
326
+ onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
327
+ <div class="method-source-code" id="M000002-source">
328
+ <pre>
329
+ <span class="ruby-comment cmt"># File lib/xbrlware/util.rb, line 79</span>
330
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ins</span>(<span class="ruby-identifier">instance_string</span>, <span class="ruby-identifier">taxonomy_string</span>=<span class="ruby-keyword kw">nil</span>)
331
+ <span class="ruby-constant">Instance</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">instance_string</span>, <span class="ruby-identifier">taxonomy_string</span>=<span class="ruby-keyword kw">nil</span>)
332
+ <span class="ruby-keyword kw">end</span>
333
+ </pre>
334
+ </div>
335
+ </div>
336
+ </div>
337
+
338
+
339
+ </div>
340
+
341
+
342
+ </div>
343
+
344
+
345
+ <div id="validator-badges">
346
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
347
+ </div>
348
+
349
+ </body>
350
+ </html>