blawzoo-plutus 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. data/.yardopts +2 -0
  2. data/LICENSE +23 -0
  3. data/README.markdown +197 -0
  4. data/Rakefile +11 -0
  5. data/VERSION.yml +5 -0
  6. data/app/controllers/accounts_controller.rb +43 -0
  7. data/app/controllers/transactions_controller.rb +42 -0
  8. data/app/models/account.rb +57 -0
  9. data/app/models/asset.rb +81 -0
  10. data/app/models/equity.rb +82 -0
  11. data/app/models/expense.rb +81 -0
  12. data/app/models/liability.rb +76 -0
  13. data/app/models/revenue.rb +81 -0
  14. data/app/models/transaction.rb +27 -0
  15. data/app/views/accounts/index.html.erb +27 -0
  16. data/app/views/accounts/show.html.erb +69 -0
  17. data/app/views/layouts/accounts.html.erb +68 -0
  18. data/app/views/layouts/transactions.html.erb +68 -0
  19. data/app/views/transactions/index.html.erb +27 -0
  20. data/app/views/transactions/show.html.erb +24 -0
  21. data/doc/Account.html +300 -0
  22. data/doc/AccountsController.html +317 -0
  23. data/doc/Asset.html +610 -0
  24. data/doc/Equity.html +610 -0
  25. data/doc/Expense.html +610 -0
  26. data/doc/Liability.html +588 -0
  27. data/doc/Revenue.html +610 -0
  28. data/doc/Transaction.html +156 -0
  29. data/doc/TransactionsController.html +317 -0
  30. data/doc/_index.html +204 -0
  31. data/doc/class_list.html +36 -0
  32. data/doc/file.README.html +250 -0
  33. data/doc/file_list.html +38 -0
  34. data/doc/frames.html +13 -0
  35. data/doc/index.html +250 -0
  36. data/doc/js/app.js +202 -0
  37. data/doc/js/full_list.js +149 -0
  38. data/doc/js/jquery.js +154 -0
  39. data/doc/method_list.html +275 -0
  40. data/doc/top-level-namespace.html +90 -0
  41. data/lib/plutus.rb +6 -0
  42. data/plutus.gemspec +116 -0
  43. data/spec/controllers/accounts_controller_spec.rb +26 -0
  44. data/spec/controllers/transactions_controller_spec.rb +26 -0
  45. data/spec/factories/account_factory.rb +31 -0
  46. data/spec/factories/transaction_factory.rb +6 -0
  47. data/spec/lib/plutus_spec.rb +0 -0
  48. data/spec/models/account_spec.rb +43 -0
  49. data/spec/models/asset_spec.rb +46 -0
  50. data/spec/models/equity_spec.rb +46 -0
  51. data/spec/models/expense_spec.rb +46 -0
  52. data/spec/models/liability_spec.rb +46 -0
  53. data/spec/models/revenue_spec.rb +46 -0
  54. data/spec/models/transaction_spec.rb +48 -0
  55. data/spec/rcov.opts +2 -0
  56. data/spec/routing/accounts_routing_spec.rb +30 -0
  57. data/spec/routing/transactions_routing_spec.rb +30 -0
  58. data/spec/schema.rb +31 -0
  59. data/spec/spec.opts +4 -0
  60. data/spec/spec_helper.rb +14 -0
  61. data/tasks/plutus_tasks.rake +4 -0
  62. metadata +204 -0
@@ -0,0 +1,156 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta name="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>Class: Transaction</title>
7
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
8
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
9
+
10
+ <script type="text/javascript" charset="utf-8">
11
+ relpath = '';
12
+ if (relpath != '') relpath += '/';
13
+ </script>
14
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
15
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
16
+
17
+ </head>
18
+ <body>
19
+ <script type="text/javascript" charset="utf-8">
20
+ if (window.top.frames.main) document.body.className = 'frames';
21
+ </script>
22
+
23
+ <div id="header">
24
+ <div id="menu">
25
+
26
+ <a href="_index.html">Index (T)</a> &raquo;
27
+
28
+
29
+ <span class="title">Transaction</span>
30
+
31
+
32
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
33
+ </div>
34
+
35
+ <div id="search">
36
+ <a id="class_list_link" href="#">Class List</a>
37
+ <a id="method_list_link" href="#">Method List</a>
38
+ <a id ="file_list_link" href="#">File List</a>
39
+ </div>
40
+
41
+ <div class="clear"></div>
42
+ </div>
43
+
44
+ <iframe id="search_frame"></iframe>
45
+
46
+ <div id="content"><h1>Class: Transaction
47
+
48
+
49
+
50
+ </h1>
51
+
52
+ <dl class="box">
53
+
54
+ <dt class="r1">Inherits:</dt>
55
+ <dd class="r1">
56
+ <span class="inheritName">ActiveRecord::Base</span>
57
+
58
+ <ul class="fullTree">
59
+ <li>Object</li>
60
+
61
+ <li class="next">ActiveRecord::Base</li>
62
+
63
+ <li class="next">Transaction</li>
64
+
65
+ </ul>
66
+ <a href="#" class="inheritanceTree">show all</a>
67
+
68
+ </dd>
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+ <dt class="r2 last">Defined in:</dt>
79
+ <dd class="r2 last">app/models/transaction.rb</dd>
80
+
81
+ </dl>
82
+ <div class="clear"></div>
83
+
84
+ <h2>Overview</h2><div class="docstring">
85
+ <div class="discussion">
86
+ <p>
87
+ Transactions are the recording of debits and credits to various accounts.
88
+ This table can be thought of as a traditional accounting Journal.
89
+ </p>
90
+ <p>
91
+ Posting to a Ledger can be considered to happen automatically, since
92
+ Accounts have the reverse &#8216;has_many&#8217; relationship to either
93
+ it&#8217;s credit or debit transactions
94
+ </p>
95
+
96
+
97
+ </div>
98
+ </div>
99
+ <div class="tags">
100
+
101
+ <div class="examples">
102
+ <h3>Examples:</h3>
103
+
104
+ <h4><div class='inline'></div></h4>
105
+ <pre class="example code"><span class='cash identifier id'>cash</span> <span class='assign token'>=</span> <span class='Asset constant id'>Asset</span><span class='dot token'>.</span><span class='find_by_name identifier id'>find_by_name</span><span class='lparen token'>(</span><span class='string val'>'Cash'</span><span class='rparen token'>)</span>
106
+ <span class='accounts_receivable identifier id'>accounts_receivable</span> <span class='assign token'>=</span> <span class='Asset constant id'>Asset</span><span class='dot token'>.</span><span class='find_by_name identifier id'>find_by_name</span><span class='lparen token'>(</span><span class='string val'>'Accounts Receivable'</span><span class='rparen token'>)</span>
107
+
108
+ <span class='Transaction constant id'>Transaction</span><span class='dot token'>.</span><span class='create identifier id'>create</span><span class='lparen token'>(</span><span class='symbol val'>:description</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='string val'>&quot;Receiving payment on an invoice&quot;</span> <span class='comma token'>,</span>
109
+ <span class='symbol val'>:debit_account</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='cash identifier id'>cash</span><span class='comma token'>,</span>
110
+ <span class='symbol val'>:credit_account</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='accounts_receivable identifier id'>accounts_receivable</span><span class='comma token'>,</span>
111
+ <span class='symbol val'>:amount</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='integer val'>1000</span><span class='rparen token'>)</span>
112
+ </pre>
113
+
114
+ </div>
115
+
116
+ <h3>See Also:</h3>
117
+ <ul class="see">
118
+
119
+ <li><a href="http://en.wikipedia.org/wiki/Journal_entry" target="_parent" title="Journal Entry">Journal Entry</a></li>
120
+
121
+ </ul>
122
+ <h3>Author:</h3>
123
+ <ul class="author">
124
+
125
+ <li>
126
+
127
+
128
+
129
+
130
+
131
+ <div class='inline'><p>
132
+ Michael Bulat
133
+ </p>
134
+ </div>
135
+
136
+ </li>
137
+
138
+ </ul>
139
+
140
+ </div>
141
+
142
+
143
+
144
+
145
+
146
+
147
+ </div>
148
+
149
+ <div id="footer">
150
+ Generated on Fri Dec 3 14:35:08 2010 by
151
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
152
+ 0.6.2 (ruby-1.8.7).
153
+ </div>
154
+
155
+ </body>
156
+ </html>
@@ -0,0 +1,317 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta name="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>Class: TransactionsController</title>
7
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
8
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
9
+
10
+ <script type="text/javascript" charset="utf-8">
11
+ relpath = '';
12
+ if (relpath != '') relpath += '/';
13
+ </script>
14
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
15
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
16
+
17
+ </head>
18
+ <body>
19
+ <script type="text/javascript" charset="utf-8">
20
+ if (window.top.frames.main) document.body.className = 'frames';
21
+ </script>
22
+
23
+ <div id="header">
24
+ <div id="menu">
25
+
26
+ <a href="_index.html">Index (T)</a> &raquo;
27
+
28
+
29
+ <span class="title">TransactionsController</span>
30
+
31
+
32
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
33
+ </div>
34
+
35
+ <div id="search">
36
+ <a id="class_list_link" href="#">Class List</a>
37
+ <a id="method_list_link" href="#">Method List</a>
38
+ <a id ="file_list_link" href="#">File List</a>
39
+ </div>
40
+
41
+ <div class="clear"></div>
42
+ </div>
43
+
44
+ <iframe id="search_frame"></iframe>
45
+
46
+ <div id="content"><h1>Class: TransactionsController
47
+
48
+
49
+
50
+ </h1>
51
+
52
+ <dl class="box">
53
+
54
+ <dt class="r1">Inherits:</dt>
55
+ <dd class="r1">
56
+ <span class="inheritName">ApplicationController</span>
57
+
58
+ <ul class="fullTree">
59
+ <li>Object</li>
60
+
61
+ <li class="next">ApplicationController</li>
62
+
63
+ <li class="next">TransactionsController</li>
64
+
65
+ </ul>
66
+ <a href="#" class="inheritanceTree">show all</a>
67
+
68
+ </dd>
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+ <dt class="r2 last">Defined in:</dt>
79
+ <dd class="r2 last">app/controllers/transactions_controller.rb</dd>
80
+
81
+ </dl>
82
+ <div class="clear"></div>
83
+
84
+ <h2>Overview</h2><div class="docstring">
85
+ <div class="discussion">
86
+ <p>
87
+ This controller provides restful route handling for Transactions.
88
+ </p>
89
+ <p>
90
+ The controller supports ActiveResource, and provides for HMTL, XML, and
91
+ JSON presentation.
92
+ </p>
93
+ <h2>Security:</h2>
94
+ <p>
95
+ Only GET requests are supported. You should ensure that your application
96
+ controller enforces its own authentication and authorization, which this
97
+ controller will inherit.
98
+ </p>
99
+
100
+
101
+ </div>
102
+ </div>
103
+ <div class="tags">
104
+ <h3>Author:</h3>
105
+ <ul class="author">
106
+
107
+ <li>
108
+
109
+
110
+
111
+
112
+
113
+ <div class='inline'><p>
114
+ Michael Bulat
115
+ </p>
116
+ </div>
117
+
118
+ </li>
119
+
120
+ </ul>
121
+
122
+ </div>
123
+
124
+
125
+
126
+
127
+ <h2>
128
+ Instance Method Summary
129
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
130
+ </h2>
131
+
132
+ <ul class="summary">
133
+
134
+ <li class="public ">
135
+ <span class="summary_signature">
136
+
137
+ <a href="#index-instance_method" title="#index (instance method)">- (Object) <strong>index</strong> </a>
138
+
139
+
140
+
141
+ </span>
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+ <span class="summary_desc"><div class='inline'></div></span>
151
+
152
+ </li>
153
+
154
+
155
+ <li class="public ">
156
+ <span class="summary_signature">
157
+
158
+ <a href="#show-instance_method" title="#show (instance method)">- (Object) <strong>show</strong> </a>
159
+
160
+
161
+
162
+ </span>
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+ <span class="summary_desc"><div class='inline'></div></span>
172
+
173
+ </li>
174
+
175
+
176
+ </ul>
177
+
178
+
179
+
180
+
181
+
182
+ <div id="instance_method_details" class="method_details_list">
183
+ <h2>Instance Method Details</h2>
184
+
185
+
186
+ <div class="method_details first">
187
+ <p class="signature first" id="index-instance_method">
188
+
189
+ - (<tt>Object</tt>) <strong>index</strong>
190
+
191
+
192
+
193
+ </p><div class="docstring">
194
+ <div class="discussion">
195
+
196
+
197
+ </div>
198
+ </div>
199
+ <div class="tags">
200
+
201
+ <div class="examples">
202
+ <h3>Examples:</h3>
203
+
204
+ <h4><div class='inline'></div></h4>
205
+ <pre class="example code"><span class='GET constant id'>GET</span> <span class='regexp val'>/transactions
206
+ GET /</span><span class='transactions identifier id'>transactions</span><span class='dot token'>.</span><span class='xml identifier id'>xml</span>
207
+ <span class='GET constant id'>GET</span> <span class='regexp val'>/transactions.json
208
+ </span></pre>
209
+
210
+ </div>
211
+
212
+ </div><table class="source_code">
213
+ <tr>
214
+ <td>
215
+ <pre class="lines">
216
+
217
+
218
+ 18
219
+ 19
220
+ 20
221
+ 21
222
+ 22
223
+ 23
224
+ 24
225
+ 25
226
+ 26</pre>
227
+ </td>
228
+ <td>
229
+ <pre class="code"><span class="info file"># File 'app/controllers/transactions_controller.rb', line 18</span>
230
+
231
+ <span class='def def kw'>def</span> <span class='index identifier id'>index</span>
232
+ <span class='@transactions ivar id'>@transactions</span> <span class='assign token'>=</span> <span class='Transaction constant id'>Transaction</span><span class='dot token'>.</span><span class='all identifier id'>all</span>
233
+
234
+ <span class='respond_to identifier id'>respond_to</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='format identifier id'>format</span><span class='bitor op'>|</span>
235
+ <span class='format identifier id'>format</span><span class='dot token'>.</span><span class='html identifier id'>html</span> <span class='comment val'># index.html.erb</span>
236
+ <span class='format identifier id'>format</span><span class='dot token'>.</span><span class='xml identifier id'>xml</span> <span class='lbrace token'>{</span> <span class='render identifier id'>render</span> <span class='symbol val'>:xml</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='@transactions ivar id'>@transactions</span> <span class='rbrace token'>}</span>
237
+ <span class='format identifier id'>format</span><span class='dot token'>.</span><span class='json identifier id'>json</span> <span class='lbrace token'>{</span> <span class='render identifier id'>render</span> <span class='symbol val'>:json</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='@transactions ivar id'>@transactions</span> <span class='rbrace token'>}</span>
238
+ <span class='end end kw'>end</span>
239
+ <span class='end end kw'>end</span>
240
+ </pre>
241
+ </td>
242
+ </tr>
243
+ </table>
244
+ </div>
245
+
246
+ <div class="method_details ">
247
+ <p class="signature " id="show-instance_method">
248
+
249
+ - (<tt>Object</tt>) <strong>show</strong>
250
+
251
+
252
+
253
+ </p><div class="docstring">
254
+ <div class="discussion">
255
+
256
+
257
+ </div>
258
+ </div>
259
+ <div class="tags">
260
+
261
+ <div class="examples">
262
+ <h3>Examples:</h3>
263
+
264
+ <h4><div class='inline'></div></h4>
265
+ <pre class="example code"><span class='GET constant id'>GET</span> <span class='regexp val'>/transactions/</span><span class='integer val'>1</span>
266
+ <span class='GET constant id'>GET</span> <span class='regexp val'>/transactions/</span><span class='float val'>1</span><span class='dot token'>.</span><span class='xml identifier id'>xml</span>
267
+ <span class='GET constant id'>GET</span> <span class='regexp val'>/transactions/</span><span class='float val'>1</span><span class='dot token'>.</span><span class='json identifier id'>json</span>
268
+ </pre>
269
+
270
+ </div>
271
+
272
+ </div><table class="source_code">
273
+ <tr>
274
+ <td>
275
+ <pre class="lines">
276
+
277
+
278
+ 32
279
+ 33
280
+ 34
281
+ 35
282
+ 36
283
+ 37
284
+ 38
285
+ 39
286
+ 40</pre>
287
+ </td>
288
+ <td>
289
+ <pre class="code"><span class="info file"># File 'app/controllers/transactions_controller.rb', line 32</span>
290
+
291
+ <span class='def def kw'>def</span> <span class='show identifier id'>show</span>
292
+ <span class='@transaction ivar id'>@transaction</span> <span class='assign token'>=</span> <span class='Transaction constant id'>Transaction</span><span class='dot token'>.</span><span class='find identifier id'>find</span><span class='lparen token'>(</span><span class='params identifier id'>params</span><span class='lbrack token'>[</span><span class='symbol val'>:id</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
293
+
294
+ <span class='respond_to identifier id'>respond_to</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='format identifier id'>format</span><span class='bitor op'>|</span>
295
+ <span class='format identifier id'>format</span><span class='dot token'>.</span><span class='html identifier id'>html</span> <span class='comment val'># show.html.erb</span>
296
+ <span class='format identifier id'>format</span><span class='dot token'>.</span><span class='xml identifier id'>xml</span> <span class='lbrace token'>{</span> <span class='render identifier id'>render</span> <span class='symbol val'>:xml</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='@transaction ivar id'>@transaction</span> <span class='rbrace token'>}</span>
297
+ <span class='format identifier id'>format</span><span class='dot token'>.</span><span class='json identifier id'>json</span> <span class='lbrace token'>{</span> <span class='render identifier id'>render</span> <span class='symbol val'>:json</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='@transaction ivar id'>@transaction</span> <span class='rbrace token'>}</span>
298
+ <span class='end end kw'>end</span>
299
+ <span class='end end kw'>end</span>
300
+ </pre>
301
+ </td>
302
+ </tr>
303
+ </table>
304
+ </div>
305
+
306
+ </div>
307
+
308
+ </div>
309
+
310
+ <div id="footer">
311
+ Generated on Fri Dec 3 14:35:08 2010 by
312
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
313
+ 0.6.2 (ruby-1.8.7).
314
+ </div>
315
+
316
+ </body>
317
+ </html>