qiflib 0.2.0 → 0.3.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.
@@ -1,88 +1,101 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
1
+ <!DOCTYPE html>
4
2
 
5
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <html>
6
4
  <head>
7
- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
8
6
 
9
- <title>File: README.rdoc [qiflib]</title>
7
+ <title>README - qiflib</title>
10
8
 
11
- <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet" />
9
+ <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
10
+
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "./";
13
+ </script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
16
+ <script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
17
+ <script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
18
+ <script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
19
+ <script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
20
+ <script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
12
21
 
13
- <script src="./js/jquery.js" type="text/javascript"
14
- charset="utf-8"></script>
15
- <script src="./js/thickbox-compressed.js" type="text/javascript"
16
- charset="utf-8"></script>
17
- <script src="./js/quicksearch.js" type="text/javascript"
18
- charset="utf-8"></script>
19
- <script src="./js/darkfish.js" type="text/javascript"
20
- charset="utf-8"></script>
21
- </head>
22
22
 
23
23
  <body class="file">
24
- <div id="metadata">
25
- <div id="home-metadata">
26
- <div id="home-section" class="section">
27
- <h3 class="section-header">
28
- <a href="./index.html">Home</a>
29
- <a href="./index.html#classes">Classes</a>
30
- <a href="./index.html#methods">Methods</a>
31
- </h3>
32
- </div>
33
- </div>
34
-
35
- <div id="project-metadata">
36
-
37
-
38
- <div id="fileindex-section" class="section project-section">
39
- <h3 class="section-header">Files</h3>
40
- <ul>
41
-
42
- <li class="file"><a href="./README_rdoc.html">README.rdoc</a></li>
43
-
44
- </ul>
45
- </div>
46
-
47
-
48
- <div id="classindex-section" class="section project-section">
49
- <h3 class="section-header">Class Index
50
- <span class="search-toggle"><img src="./images/find.png"
51
- height="16" width="16" alt="[+]"
52
- title="show/hide quicksearch" /></span></h3>
53
- <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
54
- <fieldset>
55
- <legend>Quicksearch</legend>
56
- <input type="text" name="quicksearch" value=""
57
- class="quicksearch-field" />
58
- </fieldset>
59
- </form>
60
-
61
- <ul class="link-list">
62
-
63
- <li><a href="./Qiflib.html">Qiflib</a></li>
64
-
65
- <li><a href="./Qiflib/Category.html">Qiflib::Category</a></li>
66
-
67
- <li><a href="./Qiflib/Date.html">Qiflib::Date</a></li>
68
-
69
- <li><a href="./Qiflib/Money.html">Qiflib::Money</a></li>
70
-
71
- <li><a href="./Qiflib/Transaction.html">Qiflib::Transaction</a></li>
72
-
73
- <li><a href="./Qiflib/Util.html">Qiflib::Util</a></li>
74
-
75
- </ul>
76
- <div id="no-class-search-results" style="display: none;">No matching classes.</div>
77
- </div>
78
-
79
-
80
- </div>
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="./index.html">Home</a>
28
+ <a href="./table_of_contents.html#classes">Classes</a>
29
+ <a href="./table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
32
+
33
+
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ title="Type to search, Up and Down to navigate, Enter to load">
39
+ </h3>
40
+ </form>
41
+
42
+ <ul id="search-results" class="initially-hidden"></ul>
43
+ </nav>
44
+
45
+
46
+
47
+ <div id="table-of-contents">
48
+ <nav class="section">
49
+ <h3 class="section-header">Table of Contents</h3>
50
+ <ul>
51
+ <li><a href="#label-Qiflib">Qiflib</a>
52
+ <li><a href="#label-Install">Install</a>
53
+ <li><a href="#label-Synopsis">Synopsis</a>
54
+ <li><a href="#label-Generated+DDL">Generated DDL</a>
55
+ <li><a href="#label-Generated+shell+script+">Generated shell script </a>
56
+ <li><a href="#label-Copyright+and+License">Copyright and License</a>
57
+ </ul>
58
+ </nav>
59
+ </div>
60
+
61
+
62
+ <div id="project-metadata">
63
+ <nav id="fileindex-section" class="section project-section">
64
+ <h3 class="section-header">Pages</h3>
65
+
66
+ <ul>
67
+
68
+ <li class="file"><a href="./README_rdoc.html">README</a>
69
+
70
+ </ul>
71
+ </nav>
72
+
73
+ <nav id="classindex-section" class="section project-section">
74
+ <h3 class="section-header">Class and Module Index</h3>
75
+
76
+ <ul class="link-list">
77
+
78
+ <li><a href="./Qiflib.html">Qiflib</a>
79
+
80
+ <li><a href="./Qiflib/Category.html">Qiflib::Category</a>
81
+
82
+ <li><a href="./Qiflib/Date.html">Qiflib::Date</a>
83
+
84
+ <li><a href="./Qiflib/Money.html">Qiflib::Money</a>
85
+
86
+ <li><a href="./Qiflib/Transaction.html">Qiflib::Transaction</a>
87
+
88
+ <li><a href="./Qiflib/Util.html">Qiflib::Util</a>
89
+
90
+ </ul>
91
+ </nav>
92
+
81
93
  </div>
94
+ </nav>
82
95
 
83
- <div id="documentation">
84
-
85
- <h2><a href="Qiflib.html">Qiflib</a></h2>
96
+ <div id="documentation" class="description">
97
+
98
+ <h2 id="label-Qiflib"><a href="Qiflib.html">Qiflib</a><span><a href="#label-Qiflib">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
86
99
 
87
100
  <p>A ruby library for reading and parsing qif files.</p>
88
101
 
@@ -95,73 +108,74 @@ each transaction.</p>
95
108
  <p>Also includes DDL generation for importing the parsed categories and
96
109
  transactions into a sqlite3 database.</p>
97
110
 
98
- <h2>Install</h2>
111
+ <h2 id="label-Install">Install<span><a href="#label-Install">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
99
112
 
100
113
  <pre>gem install qiflib</pre>
101
114
 
102
- <h2>Synopsis</h2>
115
+ <h2 id="label-Synopsis">Synopsis<span><a href="#label-Synopsis">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
103
116
 
104
- <pre># Parse the transactions from one or more files to csv.
105
- # Due to a discrepancy between the way iBank and Quicken export
106
- # qif files, you need to specify either Qiflib::SOURCE_IBANK or
107
- # Qiflib::SOURCE_QUICKEN as the :source.
117
+ <pre class="ruby"><span class="ruby-comment"># Parse the transactions from one or more files to csv.</span>
118
+ <span class="ruby-comment"># Due to a discrepancy between the way iBank and Quicken export</span>
119
+ <span class="ruby-comment"># qif files, you need to specify either Qiflib::SOURCE_IBANK or</span>
120
+ <span class="ruby-comment"># Qiflib::SOURCE_QUICKEN as the :source.</span>
108
121
 
109
- input_list = []
110
- input_list &lt;&lt; {
111
- :owner =&gt; 'Chris',
112
- :filename =&gt; 'data/ibank_cj.qif',
113
- :source =&gt; Qiflib::SOURCE_IBANK }
114
- input_list &lt;&lt; {
115
- :owner =&gt; 'Teri',
116
- :filename =&gt; 'data/ibank_tj.qif',
117
- :source =&gt; Qiflib::SOURCE_QUICKEN }
122
+ <span class="ruby-identifier">input_list</span> = []
123
+ <span class="ruby-identifier">input_list</span> <span class="ruby-operator">&lt;&lt;</span> {
124
+ :<span class="ruby-identifier">owner</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&#39;Chris&#39;</span>,
125
+ :<span class="ruby-identifier">filename</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&#39;data/ibank_cj.qif&#39;</span>,
126
+ :<span class="ruby-identifier">source</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Qiflib</span><span class="ruby-operator">::</span><span class="ruby-constant">SOURCE_IBANK</span> }
127
+ <span class="ruby-identifier">input_list</span> <span class="ruby-operator">&lt;&lt;</span> {
128
+ :<span class="ruby-identifier">owner</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&#39;Teri&#39;</span>,
129
+ :<span class="ruby-identifier">filename</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&#39;data/ibank_tj.qif&#39;</span>,
130
+ :<span class="ruby-identifier">source</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Qiflib</span><span class="ruby-operator">::</span><span class="ruby-constant">SOURCE_QUICKEN</span> }
118
131
 
119
- csv_lines = Qiflib::Util.transactions_to_csv(input_list)
132
+ <span class="ruby-identifier">csv_lines</span> = <span class="ruby-constant">Qiflib</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">transactions_to_csv</span>(<span class="ruby-identifier">input_list</span>)
120
133
 
121
- ... write csv_lines to a file
134
+ <span class="ruby-operator">...</span> <span class="ruby-identifier">write</span> <span class="ruby-identifier">csv_lines</span> <span class="ruby-identifier">to</span> <span class="ruby-identifier">a</span> <span class="ruby-identifier">file</span>
122
135
 
123
- # Parse the transactions from one or more files to ^-delimited text.
124
- # The text lines are suitable for loading to sqlite3.
136
+ <span class="ruby-comment"># Parse the transactions from one or more files to ^-delimited text. </span>
137
+ <span class="ruby-comment"># The text lines are suitable for loading to sqlite3.</span>
125
138
 
126
- input_list = []
127
- input_list &lt;&lt; {
128
- :owner =&gt; 'Chris',
129
- :filename =&gt; 'data/ibank_cj.qif',
130
- :source =&gt; Qiflib::SOURCE_IBANK }
139
+ <span class="ruby-identifier">input_list</span> = []
140
+ <span class="ruby-identifier">input_list</span> <span class="ruby-operator">&lt;&lt;</span> {
141
+ :<span class="ruby-identifier">owner</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&#39;Chris&#39;</span>,
142
+ :<span class="ruby-identifier">filename</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&#39;data/ibank_cj.qif&#39;</span>,
143
+ :<span class="ruby-identifier">source</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Qiflib</span><span class="ruby-operator">::</span><span class="ruby-constant">SOURCE_IBANK</span> }
131
144
 
132
- delim_lines = Qiflib::Util.transactions_to_delim(input_list)
145
+ <span class="ruby-identifier">delim_lines</span> = <span class="ruby-constant">Qiflib</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">transactions_to_delim</span>(<span class="ruby-identifier">input_list</span>)
133
146
 
134
- ... write delim_lines to a file
147
+ <span class="ruby-operator">...</span> <span class="ruby-identifier">write</span> <span class="ruby-identifier">delim_lines</span> <span class="ruby-identifier">to</span> <span class="ruby-identifier">a</span> <span class="ruby-identifier">file</span>
135
148
 
136
- # Parse the categories from one or more files to csv.
149
+ <span class="ruby-comment"># Parse the categories from one or more files to csv.</span>
137
150
 
138
- input_list = [ 'data/ibank_cj.qif' ]
139
- csv_lines = Qiflib::Util.catetory_names_to_csv(input_list)
151
+ <span class="ruby-identifier">input_list</span> = [ <span class="ruby-string">&#39;data/ibank_cj.qif&#39;</span> ]
152
+ <span class="ruby-identifier">csv_lines</span> = <span class="ruby-constant">Qiflib</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">catetory_names_to_csv</span>(<span class="ruby-identifier">input_list</span>)
140
153
 
141
- ... write csv_lines to a file
154
+ <span class="ruby-operator">...</span> <span class="ruby-identifier">write</span> <span class="ruby-identifier">csv_lines</span> <span class="ruby-identifier">to</span> <span class="ruby-identifier">a</span> <span class="ruby-identifier">file</span>
142
155
 
143
- # Parse the categories from one or more files to ^-delimited text.
144
- # The text lines are suitable for loading to sqlite3.
156
+ <span class="ruby-comment"># Parse the categories from one or more files to ^-delimited text. </span>
157
+ <span class="ruby-comment"># The text lines are suitable for loading to sqlite3. </span>
145
158
 
146
- input_list = [ 'data/ibank_cj.qif' ]
147
- delim_lines = Qiflib::Util.catetory_names_to_delim(input_list)
159
+ <span class="ruby-identifier">input_list</span> = [ <span class="ruby-string">&#39;data/ibank_cj.qif&#39;</span> ]
160
+ <span class="ruby-identifier">delim_lines</span> = <span class="ruby-constant">Qiflib</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">catetory_names_to_delim</span>(<span class="ruby-identifier">input_list</span>)
148
161
 
149
- ... write delim_lines to a file
162
+ <span class="ruby-operator">...</span> <span class="ruby-identifier">write</span> <span class="ruby-identifier">delim_lines</span> <span class="ruby-identifier">to</span> <span class="ruby-identifier">a</span> <span class="ruby-identifier">file</span>
150
163
 
151
- # Generate the DDL for a sqlite3 database with categories and transactions tables.
164
+ <span class="ruby-comment"># Generate the DDL for a sqlite3 database with categories and transactions tables.</span>
152
165
 
153
- ddl_lines = Qiflib::Util.generate_sqlite_ddl
166
+ <span class="ruby-identifier">ddl_lines</span> = <span class="ruby-constant">Qiflib</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">generate_sqlite_ddl</span>
154
167
 
155
- ... write ddl_lines to a file; use it in the following bash-shell script
168
+ <span class="ruby-operator">...</span> <span class="ruby-identifier">write</span> <span class="ruby-identifier">ddl_lines</span> <span class="ruby-identifier">to</span> <span class="ruby-identifier">a</span> <span class="ruby-identifier">file</span>; <span class="ruby-identifier">use</span> <span class="ruby-identifier">it</span> <span class="ruby-keyword">in</span> <span class="ruby-identifier">the</span> <span class="ruby-identifier">following</span> <span class="ruby-identifier">bash</span><span class="ruby-operator">-</span><span class="ruby-identifier">shell</span> <span class="ruby-identifier">script</span>
156
169
 
157
- # Generate a bash-shell script to load the categories and transactions
158
- # delimited files into a sqlite3 database, using the above DDL.
170
+ <span class="ruby-comment"># Generate a bash-shell script to load the categories and transactions </span>
171
+ <span class="ruby-comment"># delimited files into a sqlite3 database, using the above DDL.</span>
159
172
 
160
- sh_lines = Qiflib::Util.generate_sqlite_load_script
173
+ <span class="ruby-identifier">sh_lines</span> = <span class="ruby-constant">Qiflib</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">generate_sqlite_load_script</span>
161
174
 
162
- ... write sh_lines to a file; chmod 744; run it.</pre>
175
+ <span class="ruby-operator">...</span> <span class="ruby-identifier">write</span> <span class="ruby-identifier">sh_lines</span> <span class="ruby-identifier">to</span> <span class="ruby-identifier">a</span> <span class="ruby-identifier">file</span>; <span class="ruby-identifier">chmod</span> <span class="ruby-value">744</span>; <span class="ruby-identifier">run</span> <span class="ruby-identifier">it</span>.
176
+ </pre>
163
177
 
164
- <h2>Generated DDL</h2>
178
+ <h2 id="label-Generated+DDL">Generated DDL<span><a href="#label-Generated+DDL">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
165
179
 
166
180
  <pre># DDL file for sqlite3
167
181
 
@@ -204,12 +218,12 @@ create table categories(
204
218
  name varchar(80)
205
219
  );
206
220
 
207
- .separator '^'
221
+ .separator &#39;^&#39;
208
222
 
209
223
  .import qiflib_transactions.txt transactions
210
224
  .import qiflib_categories.txt categories</pre>
211
225
 
212
- <h2>Generated shell script </h2>
226
+ <h2 id="label-Generated+shell+script+">Generated shell script <span><a href="#label-Generated+shell+script+">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
213
227
 
214
228
  <pre># bash-shell script
215
229
 
@@ -217,20 +231,20 @@ create table categories(
217
231
 
218
232
  sqlite3 qiflib.db &lt; qiflib.ddl</pre>
219
233
 
220
- <h2>Copyright and License</h2>
234
+ <h2 id="label-Copyright+and+License">Copyright and License<span><a href="#label-Copyright+and+License">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
221
235
 
222
236
  <p>Copyright 2013, Chris Joakim &lt;cjoakim@bellsouth.net&gt;.</p>
223
237
 
224
238
  <p>GNU General Public License (GPLv3) license. See <a
225
239
  href="http://www.gnu.org/copyleft/gpl.html">www.gnu.org/copyleft/gpl.html</a></p>
226
240
 
227
- </div>
241
+ </div>
228
242
 
229
- <div id="validator-badges">
230
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
231
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
232
- Rdoc Generator</a> 2</small>.</p>
233
- </div>
234
- </body>
235
- </html>
243
+
244
+
245
+ <footer id="validator-badges">
246
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
247
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
248
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
249
+ </footer>
236
250