quickbooks 0.4.0 → 0.9.9
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/History.txt +23 -0
- data/License.txt +54 -0
- data/Manifest.txt +73 -0
- data/README.txt +79 -0
- data/Rakefile +17 -78
- data/lib/quickbooks.rb +153 -7
- data/lib/quickbooks/adaptability.rb +67 -0
- data/lib/quickbooks/adapters/http_adapter.rb +94 -0
- data/lib/quickbooks/adapters/https_adapter.rb +57 -0
- data/lib/quickbooks/adapters/ole_adapter.rb +141 -110
- data/lib/quickbooks/adapters/spew_adapter.rb +39 -0
- data/lib/quickbooks/adapters/tcp_adapter.rb +71 -0
- data/lib/quickbooks/adapters/test_adapter.rb +62 -0
- data/lib/quickbooks/element.rb +385 -0
- data/lib/quickbooks/element_collection.rb +105 -0
- data/lib/quickbooks/extlib.rb +8 -0
- data/lib/quickbooks/extlib/assertions.rb +8 -0
- data/lib/quickbooks/extlib/class.rb +98 -0
- data/lib/quickbooks/extlib/days_and_times.rb +10 -0
- data/lib/quickbooks/extlib/days_and_times/duration.rb +362 -0
- data/lib/quickbooks/extlib/days_and_times/numeric.rb +48 -0
- data/lib/quickbooks/extlib/days_and_times/object.rb +19 -0
- data/lib/quickbooks/extlib/days_and_times/time.rb +137 -0
- data/lib/quickbooks/extlib/hash.rb +327 -0
- data/lib/quickbooks/extlib/hook.rb +366 -0
- data/lib/quickbooks/extlib/inflection.rb +436 -0
- data/lib/quickbooks/extlib/logger.rb +202 -0
- data/lib/quickbooks/extlib/object.rb +162 -0
- data/lib/quickbooks/extlib/pathname.rb +15 -0
- data/lib/quickbooks/extlib/rubygems.rb +38 -0
- data/lib/quickbooks/extlib/string.rb +32 -0
- data/lib/quickbooks/extlib/time.rb +41 -0
- data/lib/quickbooks/model.rb +503 -121
- data/lib/quickbooks/option.rb +95 -0
- data/lib/quickbooks/property.rb +69 -0
- data/lib/quickbooks/ruby_ext.rb +251 -0
- data/lib/quickbooks/type.rb +75 -0
- data/lib/quickbooks/types.rb +58 -0
- data/lib/quickbooks/version.rb +10 -0
- data/lib/quickbooks/xsd.rb +243 -0
- data/lib/quickbooks/xsd/attribute.rb +57 -0
- data/lib/quickbooks/xsd/choice.rb +94 -0
- data/lib/quickbooks/xsd/complex_type.rb +77 -0
- data/lib/quickbooks/xsd/element.rb +214 -0
- data/lib/quickbooks/xsd/group.rb +94 -0
- data/lib/quickbooks/xsd/restriction.rb +51 -0
- data/lib/quickbooks/xsd/sequence.rb +85 -0
- data/lib/quickbooks/xsd/simple_type.rb +87 -0
- data/lib/quickbooks/xsd/union.rb +70 -0
- data/lib/quickbooks/xsd/validation.rb +89 -0
- data/lib/quickbooks/xsd/xml_parse.rb +80 -0
- data/quickbooks.gemspec +36 -0
- data/source/qbxml21_demo.xsd +2223 -0
- data/source/qbxmlops_demo.xsd +483 -0
- data/source/qbxmltypes.xsd +160 -0
- data/spec/association_spec.rb +5 -0
- data/spec/element_collection_spec.rb +8 -0
- data/spec/find_spec.rb +30 -0
- data/spec/lib/quickbooks/element_spec.rb +83 -0
- data/spec/lib/quickbooks/elements/sales_order_add_spec.rb +14 -0
- data/spec/lib/quickbooks/elements/vendor_add_spec.rb +78 -0
- data/spec/lib/quickbooks/model_spec.rb +89 -0
- data/spec/lib/quickbooks/models/customer_spec.rb +52 -0
- data/spec/lib/quickbooks/models/invoice_spec.rb +12 -0
- data/spec/lib/quickbooks/models/sales_order_line_spec.rb +0 -0
- data/spec/lib/quickbooks/models/sales_order_spec.rb +145 -0
- data/spec/lib/quickbooks/xsd/choice_spec.rb +18 -0
- data/spec/pending_spec.rb +11 -0
- data/spec/quickbooks_spec.rb +38 -0
- data/spec/repeatable_spec.rb +20 -0
- data/spec/requires_spec.rb +10 -0
- data/spec/spec_helper.rb +5 -0
- data/spec/validation_spec.rb +24 -0
- metadata +133 -285
- metadata.gz.sig +0 -0
- data/LICENSE +0 -16
- data/README +0 -49
- data/doc/classes/Array.html +0 -368
- data/doc/classes/Array.src/M000026.html +0 -18
- data/doc/classes/Array.src/M000027.html +0 -21
- data/doc/classes/Array.src/M000028.html +0 -18
- data/doc/classes/Array.src/M000029.html +0 -19
- data/doc/classes/Array.src/M000030.html +0 -18
- data/doc/classes/Array.src/M000031.html +0 -23
- data/doc/classes/Array.src/M000032.html +0 -18
- data/doc/classes/Array.src/M000033.html +0 -18
- data/doc/classes/Array.src/M000034.html +0 -18
- data/doc/classes/Array.src/M000035.html +0 -19
- data/doc/classes/Array.src/M000036.html +0 -18
- data/doc/classes/Array.src/M000037.html +0 -23
- data/doc/classes/Array.src/M000038.html +0 -18
- data/doc/classes/Array.src/M000039.html +0 -21
- data/doc/classes/Array.src/M000040.html +0 -18
- data/doc/classes/Array.src/M000041.html +0 -18
- data/doc/classes/Class.html +0 -171
- data/doc/classes/Class.src/M000042.html +0 -18
- data/doc/classes/Class.src/M000043.html +0 -18
- data/doc/classes/Hash.html +0 -516
- data/doc/classes/Hash.src/M000001.html +0 -18
- data/doc/classes/Hash.src/M000002.html +0 -21
- data/doc/classes/Hash.src/M000003.html +0 -18
- data/doc/classes/Hash.src/M000004.html +0 -21
- data/doc/classes/Hash.src/M000005.html +0 -18
- data/doc/classes/Hash.src/M000006.html +0 -20
- data/doc/classes/Hash.src/M000007.html +0 -18
- data/doc/classes/Hash.src/M000008.html +0 -22
- data/doc/classes/Hash.src/M000009.html +0 -18
- data/doc/classes/Hash.src/M000010.html +0 -21
- data/doc/classes/Hash.src/M000011.html +0 -24
- data/doc/classes/Hash.src/M000012.html +0 -18
- data/doc/classes/Hash.src/M000013.html +0 -21
- data/doc/classes/Hash.src/M000014.html +0 -18
- data/doc/classes/Hash.src/M000015.html +0 -21
- data/doc/classes/Hash.src/M000016.html +0 -18
- data/doc/classes/Hash.src/M000017.html +0 -21
- data/doc/classes/Hash.src/M000018.html +0 -27
- data/doc/classes/Hash.src/M000019.html +0 -20
- data/doc/classes/Hash.src/M000020.html +0 -18
- data/doc/classes/Hash.src/M000021.html +0 -18
- data/doc/classes/Hash.src/M000022.html +0 -18
- data/doc/classes/Hash.src/M000023.html +0 -18
- data/doc/classes/Hash.src/M000024.html +0 -18
- data/doc/classes/Hash.src/M000025.html +0 -28
- data/doc/classes/Object.html +0 -278
- data/doc/classes/Object.src/M000044.html +0 -24
- data/doc/classes/Object.src/M000045.html +0 -19
- data/doc/classes/Object.src/M000046.html +0 -24
- data/doc/classes/Object.src/M000047.html +0 -18
- data/doc/classes/Object.src/M000048.html +0 -19
- data/doc/classes/Object.src/M000049.html +0 -18
- data/doc/classes/Object.src/M000050.html +0 -18
- data/doc/classes/Object.src/M000051.html +0 -18
- data/doc/classes/Qbxml.html +0 -131
- data/doc/classes/Qbxml/Request.html +0 -224
- data/doc/classes/Qbxml/Request.src/M000132.html +0 -66
- data/doc/classes/Qbxml/Request.src/M000133.html +0 -19
- data/doc/classes/Qbxml/Request.src/M000134.html +0 -83
- data/doc/classes/Qbxml/RequestSet.html +0 -199
- data/doc/classes/Qbxml/RequestSet.src/M000135.html +0 -22
- data/doc/classes/Qbxml/RequestSet.src/M000136.html +0 -26
- data/doc/classes/Qbxml/RequestSet.src/M000137.html +0 -18
- data/doc/classes/Qbxml/RequestSet.src/M000138.html +0 -22
- data/doc/classes/Qbxml/Response.html +0 -302
- data/doc/classes/Qbxml/Response.src/M000123.html +0 -24
- data/doc/classes/Qbxml/Response.src/M000124.html +0 -19
- data/doc/classes/Qbxml/Response.src/M000125.html +0 -55
- data/doc/classes/Qbxml/Response.src/M000126.html +0 -18
- data/doc/classes/Qbxml/Response.src/M000127.html +0 -18
- data/doc/classes/Qbxml/Response.src/M000128.html +0 -18
- data/doc/classes/Qbxml/Response.src/M000129.html +0 -18
- data/doc/classes/Qbxml/Response.src/M000130.html +0 -18
- data/doc/classes/Qbxml/Response.src/M000131.html +0 -63
- data/doc/classes/Qbxml/ResponseSet.html +0 -244
- data/doc/classes/Qbxml/ResponseSet.src/M000116.html +0 -22
- data/doc/classes/Qbxml/ResponseSet.src/M000117.html +0 -26
- data/doc/classes/Qbxml/ResponseSet.src/M000118.html +0 -24
- data/doc/classes/Qbxml/ResponseSet.src/M000119.html +0 -20
- data/doc/classes/Qbxml/ResponseSet.src/M000120.html +0 -27
- data/doc/classes/Qbxml/ResponseSet.src/M000121.html +0 -18
- data/doc/classes/Qbxml/ResponseSet.src/M000122.html +0 -18
- data/doc/classes/Quickbooks.html +0 -196
- data/doc/classes/Quickbooks/Address.html +0 -139
- data/doc/classes/Quickbooks/Address.src/M000115.html +0 -19
- data/doc/classes/Quickbooks/Base.html +0 -567
- data/doc/classes/Quickbooks/Base.src/M000095.html +0 -18
- data/doc/classes/Quickbooks/Base.src/M000096.html +0 -20
- data/doc/classes/Quickbooks/Base.src/M000097.html +0 -19
- data/doc/classes/Quickbooks/Base.src/M000098.html +0 -18
- data/doc/classes/Quickbooks/Base.src/M000099.html +0 -19
- data/doc/classes/Quickbooks/Base.src/M000100.html +0 -30
- data/doc/classes/Quickbooks/Base.src/M000101.html +0 -22
- data/doc/classes/Quickbooks/Base.src/M000102.html +0 -30
- data/doc/classes/Quickbooks/Base.src/M000103.html +0 -19
- data/doc/classes/Quickbooks/Base.src/M000104.html +0 -19
- data/doc/classes/Quickbooks/Base.src/M000105.html +0 -18
- data/doc/classes/Quickbooks/Base.src/M000106.html +0 -18
- data/doc/classes/Quickbooks/Base.src/M000107.html +0 -19
- data/doc/classes/Quickbooks/Base.src/M000108.html +0 -18
- data/doc/classes/Quickbooks/Base.src/M000109.html +0 -45
- data/doc/classes/Quickbooks/Base.src/M000110.html +0 -18
- data/doc/classes/Quickbooks/Base.src/M000111.html +0 -18
- data/doc/classes/Quickbooks/Base.src/M000112.html +0 -20
- data/doc/classes/Quickbooks/BillAddress.html +0 -113
- data/doc/classes/Quickbooks/CreditCardInfo.html +0 -113
- data/doc/classes/Quickbooks/Customer.html +0 -113
- data/doc/classes/Quickbooks/CustomerTypeRef.html +0 -113
- data/doc/classes/Quickbooks/Deleted.html +0 -113
- data/doc/classes/Quickbooks/ItemSalesTaxRef.html +0 -113
- data/doc/classes/Quickbooks/JobTypeRef.html +0 -113
- data/doc/classes/Quickbooks/ListDeleted.html +0 -139
- data/doc/classes/Quickbooks/ListDeleted.src/M000114.html +0 -18
- data/doc/classes/Quickbooks/ListItem.html +0 -170
- data/doc/classes/Quickbooks/ListItem.src/M000093.html +0 -20
- data/doc/classes/Quickbooks/ListItem.src/M000094.html +0 -18
- data/doc/classes/Quickbooks/Model.html +0 -462
- data/doc/classes/Quickbooks/Model.src/M000073.html +0 -24
- data/doc/classes/Quickbooks/Model.src/M000074.html +0 -19
- data/doc/classes/Quickbooks/Model.src/M000075.html +0 -18
- data/doc/classes/Quickbooks/Model.src/M000076.html +0 -18
- data/doc/classes/Quickbooks/Model.src/M000077.html +0 -18
- data/doc/classes/Quickbooks/Model.src/M000078.html +0 -22
- data/doc/classes/Quickbooks/Model.src/M000079.html +0 -32
- data/doc/classes/Quickbooks/Model.src/M000080.html +0 -32
- data/doc/classes/Quickbooks/Model.src/M000081.html +0 -18
- data/doc/classes/Quickbooks/Model.src/M000082.html +0 -18
- data/doc/classes/Quickbooks/Model.src/M000083.html +0 -22
- data/doc/classes/Quickbooks/Model.src/M000084.html +0 -23
- data/doc/classes/Quickbooks/Model.src/M000085.html +0 -18
- data/doc/classes/Quickbooks/Model.src/M000086.html +0 -21
- data/doc/classes/Quickbooks/Model.src/M000087.html +0 -26
- data/doc/classes/Quickbooks/Model.src/M000088.html +0 -26
- data/doc/classes/Quickbooks/Model.src/M000089.html +0 -26
- data/doc/classes/Quickbooks/Model.src/M000090.html +0 -21
- data/doc/classes/Quickbooks/Model.src/M000091.html +0 -23
- data/doc/classes/Quickbooks/OleAdapter.html +0 -129
- data/doc/classes/Quickbooks/OleAdapter/Connection.html +0 -343
- data/doc/classes/Quickbooks/OleAdapter/Connection.src/M000058.html +0 -18
- data/doc/classes/Quickbooks/OleAdapter/Connection.src/M000059.html +0 -19
- data/doc/classes/Quickbooks/OleAdapter/Connection.src/M000060.html +0 -24
- data/doc/classes/Quickbooks/OleAdapter/Connection.src/M000061.html +0 -18
- data/doc/classes/Quickbooks/OleAdapter/Connection.src/M000062.html +0 -18
- data/doc/classes/Quickbooks/OleAdapter/Connection.src/M000063.html +0 -21
- data/doc/classes/Quickbooks/OleAdapter/Connection.src/M000064.html +0 -24
- data/doc/classes/Quickbooks/OleAdapter/Connection.src/M000065.html +0 -20
- data/doc/classes/Quickbooks/OleAdapter/Connection.src/M000066.html +0 -24
- data/doc/classes/Quickbooks/OleAdapter/Connection.src/M000067.html +0 -24
- data/doc/classes/Quickbooks/OleAdapter/Ole.html +0 -209
- data/doc/classes/Quickbooks/OleAdapter/Ole.src/M000068.html +0 -21
- data/doc/classes/Quickbooks/OleAdapter/Ole.src/M000069.html +0 -22
- data/doc/classes/Quickbooks/OleAdapter/Ole.src/M000070.html +0 -18
- data/doc/classes/Quickbooks/ParentRef.html +0 -113
- data/doc/classes/Quickbooks/PreferredPaymentMethodRef.html +0 -113
- data/doc/classes/Quickbooks/PriceLevelRef.html +0 -113
- data/doc/classes/Quickbooks/QbxmlDebugAdapter.html +0 -111
- data/doc/classes/Quickbooks/QbxmlDebugAdapter/Connection.html +0 -139
- data/doc/classes/Quickbooks/QbxmlDebugAdapter/Connection.src/M000057.html +0 -18
- data/doc/classes/Quickbooks/Ref.html +0 -146
- data/doc/classes/Quickbooks/Ref.src/M000113.html +0 -18
- data/doc/classes/Quickbooks/SalesRepRef.html +0 -113
- data/doc/classes/Quickbooks/SalesTaxCodeRef.html +0 -113
- data/doc/classes/Quickbooks/ShipAddress.html +0 -113
- data/doc/classes/Quickbooks/TermsRef.html +0 -113
- data/doc/classes/Quickbooks/Transaction.html +0 -154
- data/doc/classes/Quickbooks/Transaction.src/M000071.html +0 -19
- data/doc/classes/Quickbooks/Transaction.src/M000072.html +0 -18
- data/doc/classes/Quickbooks/TxnDeleted.html +0 -139
- data/doc/classes/Quickbooks/TxnDeleted.src/M000092.html +0 -18
- data/doc/classes/String.html +0 -203
- data/doc/classes/String.src/M000052.html +0 -18
- data/doc/classes/String.src/M000053.html +0 -18
- data/doc/classes/String.src/M000054.html +0 -18
- data/doc/classes/String.src/M000055.html +0 -18
- data/doc/classes/String.src/M000056.html +0 -18
- data/doc/created.rid +0 -1
- data/doc/files/LICENSE.html +0 -129
- data/doc/files/README.html +0 -225
- data/doc/files/lib/qbxml/request_rb.html +0 -110
- data/doc/files/lib/qbxml/response_rb.html +0 -109
- data/doc/files/lib/qbxml/support_rb.html +0 -101
- data/doc/files/lib/qbxml_rb.html +0 -122
- data/doc/files/lib/quickbooks/adapters/ole_adapter_rb.html +0 -108
- data/doc/files/lib/quickbooks/adapters/qbxml_debug_adapter_rb.html +0 -108
- data/doc/files/lib/quickbooks/base_rb.html +0 -327
- data/doc/files/lib/quickbooks/model_rb.html +0 -108
- data/doc/files/lib/quickbooks/models/common/address_rb.html +0 -101
- data/doc/files/lib/quickbooks/models/common/all_refs_rb.html +0 -101
- data/doc/files/lib/quickbooks/models/customer/credit_card_info_rb.html +0 -101
- data/doc/files/lib/quickbooks/models/customer_rb.html +0 -110
- data/doc/files/lib/quickbooks/models/deleted_rb.html +0 -101
- data/doc/files/lib/quickbooks/models/list_item_rb.html +0 -101
- data/doc/files/lib/quickbooks/models/transaction_rb.html +0 -101
- data/doc/files/lib/quickbooks/ruby_magic_rb.html +0 -120
- data/doc/files/lib/quickbooks_rb.html +0 -125
- data/doc/fr_class_index.html +0 -64
- data/doc/fr_file_index.html +0 -45
- data/doc/fr_method_index.html +0 -164
- data/doc/index.html +0 -24
- data/doc/rdoc-style.css +0 -208
- data/lib/qbxml.rb +0 -3
- data/lib/qbxml/request.rb +0 -207
- data/lib/qbxml/response.rb +0 -197
- data/lib/qbxml/support.rb +0 -130
- data/lib/quickbooks/adapters/qbxml_debug_adapter.rb +0 -10
- data/lib/quickbooks/base.rb +0 -277
- data/lib/quickbooks/models/common/address.rb +0 -14
- data/lib/quickbooks/models/common/all_refs.rb +0 -37
- data/lib/quickbooks/models/customer.rb +0 -70
- data/lib/quickbooks/models/customer/credit_card_info.rb +0 -5
- data/lib/quickbooks/models/deleted.rb +0 -22
- data/lib/quickbooks/models/list_item.rb +0 -41
- data/lib/quickbooks/models/transaction.rb +0 -49
- data/lib/quickbooks/ruby_magic.rb +0 -213
data.tar.gz.sig
ADDED
Binary file
|
data/History.txt
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
=== 0.9.0 / 2008-10-08
|
2
|
+
|
3
|
+
* First Release
|
4
|
+
|
5
|
+
=== 0.9.2 / 2009-01-08
|
6
|
+
|
7
|
+
* Patches and updates
|
8
|
+
|
9
|
+
=== 0.9.5 / 2009-02-20
|
10
|
+
|
11
|
+
* Restructured gem to generate from XSD dynamically instead of from DTD statically.
|
12
|
+
|
13
|
+
=== 0.9.6 / 2009-03-10
|
14
|
+
|
15
|
+
* Fixed a couple bugs related to collection elements in responses.
|
16
|
+
|
17
|
+
=== 0.9.7 / 2009-04-15
|
18
|
+
|
19
|
+
* Fixed conflicts with Rails / ActiveRecord / ActiveSupport.
|
20
|
+
|
21
|
+
=== 0.9.8 / 2009-05-06
|
22
|
+
|
23
|
+
* A few minor enhancements; Made the :spew adapter default for ease of use in irb.
|
data/License.txt
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
Copyright (c) 2008 BehindLogic <gems@behindlogic.com>
|
2
|
+
|
3
|
+
* THIS IS NOT FREE SOFTWARE!
|
4
|
+
Although I'd love for it to be free, the truth is it just took
|
5
|
+
SO MUCH WORK that I absolutely must get something out of it.
|
6
|
+
Please understand that in my opinion, to try to integrate with
|
7
|
+
QuickBooks from scratch would be nothing short of proposterous
|
8
|
+
with this ready-made gem looking you straight in the eye. I'll
|
9
|
+
just leave it at that. :)
|
10
|
+
|
11
|
+
* Use of the Trial Version
|
12
|
+
This is a trial version. For the most part, this is a working
|
13
|
+
copy that is restricted to working with a small set of QuickBooks
|
14
|
+
objects.
|
15
|
+
|
16
|
+
Use of the full version of this QuickBooks Rubygem is subject to a
|
17
|
+
fee. BehindLogic has developed this QuickBooks Rubygem out of its
|
18
|
+
own necessity and the necessity of others; and because of the large
|
19
|
+
number of hours required to complete such a task, BehindLogic has
|
20
|
+
decided to provide it to others for use at a decent fee. For the
|
21
|
+
current fee, visit behindlogic.com or contact gems@behindlogic.com.
|
22
|
+
|
23
|
+
* Extent of permission
|
24
|
+
This QuickBooks Rubygem shall only be used for its packaged
|
25
|
+
capabilities. It is provided as-is. You MAY NOT redistribute any
|
26
|
+
code contained within this library. You MAY NOT include any code
|
27
|
+
contained within this library within an open source project, when
|
28
|
+
in doing so effectively releases the code to the public. Remember,
|
29
|
+
the purpose of this License is to allow you to fully use this gem,
|
30
|
+
after you have paid your due. BehindLogic has spent countless
|
31
|
+
hours on this work, and seeks to be compensated over time for its
|
32
|
+
work.
|
33
|
+
|
34
|
+
* Support, Upgrades and Bugfixes
|
35
|
+
Agreement for Support will be discussed elsewhere, such as when you
|
36
|
+
communicate your purchase of a license from BehindLogic. Upgrades
|
37
|
+
are to be granted upon request at a fraction of the initial fee
|
38
|
+
paid. Upgrades are not guaranteed to be created for new versions of
|
39
|
+
QuickBooks, and the timeliness of this service is not guaranteed
|
40
|
+
since newer versions of QuickBooks aren't guaranteed by Intuit to
|
41
|
+
follow patterns of their predecessors. Incentive monies, to a
|
42
|
+
certain point, help to speed up the work when necessary. Bugfixes
|
43
|
+
will be treated with care and will be worked on for free; however,
|
44
|
+
again, timeliness is not guaranteed, but incentive monies can be
|
45
|
+
offered to expedite the bug squashing.
|
46
|
+
|
47
|
+
* PROVIDED AS IS!
|
48
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
49
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
50
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
51
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
52
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
53
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
54
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Manifest.txt
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
History.txt
|
2
|
+
License.txt
|
3
|
+
Manifest.txt
|
4
|
+
README.txt
|
5
|
+
Rakefile
|
6
|
+
lib/quickbooks.rb
|
7
|
+
lib/quickbooks/adaptability.rb
|
8
|
+
lib/quickbooks/adapters/http_adapter.rb
|
9
|
+
lib/quickbooks/adapters/https_adapter.rb
|
10
|
+
lib/quickbooks/adapters/ole_adapter.rb
|
11
|
+
lib/quickbooks/adapters/spew_adapter.rb
|
12
|
+
lib/quickbooks/adapters/tcp_adapter.rb
|
13
|
+
lib/quickbooks/adapters/test_adapter.rb
|
14
|
+
lib/quickbooks/element.rb
|
15
|
+
lib/quickbooks/element_collection.rb
|
16
|
+
lib/quickbooks/extlib.rb
|
17
|
+
lib/quickbooks/extlib/assertions.rb
|
18
|
+
lib/quickbooks/extlib/class.rb
|
19
|
+
lib/quickbooks/extlib/days_and_times.rb
|
20
|
+
lib/quickbooks/extlib/days_and_times/duration.rb
|
21
|
+
lib/quickbooks/extlib/days_and_times/numeric.rb
|
22
|
+
lib/quickbooks/extlib/days_and_times/object.rb
|
23
|
+
lib/quickbooks/extlib/days_and_times/time.rb
|
24
|
+
lib/quickbooks/extlib/hash.rb
|
25
|
+
lib/quickbooks/extlib/hook.rb
|
26
|
+
lib/quickbooks/extlib/inflection.rb
|
27
|
+
lib/quickbooks/extlib/logger.rb
|
28
|
+
lib/quickbooks/extlib/object.rb
|
29
|
+
lib/quickbooks/extlib/pathname.rb
|
30
|
+
lib/quickbooks/extlib/rubygems.rb
|
31
|
+
lib/quickbooks/extlib/string.rb
|
32
|
+
lib/quickbooks/extlib/time.rb
|
33
|
+
lib/quickbooks/model.rb
|
34
|
+
lib/quickbooks/option.rb
|
35
|
+
lib/quickbooks/property.rb
|
36
|
+
lib/quickbooks/ruby_ext.rb
|
37
|
+
lib/quickbooks/type.rb
|
38
|
+
lib/quickbooks/types.rb
|
39
|
+
lib/quickbooks/version.rb
|
40
|
+
lib/quickbooks/xsd.rb
|
41
|
+
lib/quickbooks/xsd/attribute.rb
|
42
|
+
lib/quickbooks/xsd/choice.rb
|
43
|
+
lib/quickbooks/xsd/complex_type.rb
|
44
|
+
lib/quickbooks/xsd/element.rb
|
45
|
+
lib/quickbooks/xsd/group.rb
|
46
|
+
lib/quickbooks/xsd/restriction.rb
|
47
|
+
lib/quickbooks/xsd/sequence.rb
|
48
|
+
lib/quickbooks/xsd/simple_type.rb
|
49
|
+
lib/quickbooks/xsd/union.rb
|
50
|
+
lib/quickbooks/xsd/validation.rb
|
51
|
+
lib/quickbooks/xsd/xml_parse.rb
|
52
|
+
quickbooks.gemspec
|
53
|
+
source/qbxml21_demo.xsd
|
54
|
+
source/qbxmlops_demo.xsd
|
55
|
+
source/qbxmltypes.xsd
|
56
|
+
spec/association_spec.rb
|
57
|
+
spec/element_collection_spec.rb
|
58
|
+
spec/find_spec.rb
|
59
|
+
spec/lib/quickbooks/element_spec.rb
|
60
|
+
spec/lib/quickbooks/elements/sales_order_add_spec.rb
|
61
|
+
spec/lib/quickbooks/elements/vendor_add_spec.rb
|
62
|
+
spec/lib/quickbooks/model_spec.rb
|
63
|
+
spec/lib/quickbooks/models/customer_spec.rb
|
64
|
+
spec/lib/quickbooks/models/invoice_spec.rb
|
65
|
+
spec/lib/quickbooks/models/sales_order_line_spec.rb
|
66
|
+
spec/lib/quickbooks/models/sales_order_spec.rb
|
67
|
+
spec/lib/quickbooks/xsd/choice_spec.rb
|
68
|
+
spec/pending_spec.rb
|
69
|
+
spec/quickbooks_spec.rb
|
70
|
+
spec/repeatable_spec.rb
|
71
|
+
spec/requires_spec.rb
|
72
|
+
spec/spec_helper.rb
|
73
|
+
spec/validation_spec.rb
|
data/README.txt
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
= quickbooks
|
2
|
+
|
3
|
+
* http://behindlogic.com
|
4
|
+
* http://behindlogic.lighthouseapp.com/projects/32776
|
5
|
+
|
6
|
+
== DESCRIPTION:
|
7
|
+
|
8
|
+
The only comprehensive Ruby interface to Quickbooks. THIS IS A DEMO VERSION. Visit behindlogic.com for the full version, which works with all versions of QuickBooks.
|
9
|
+
|
10
|
+
== SYNOPSIS:
|
11
|
+
|
12
|
+
jim = QB::Customer.first(:fullname => ["Jim Stout"])
|
13
|
+
jim.destroy # Note that you cannot delete items in QuickBooks
|
14
|
+
# but you CAN delete them using the API.
|
15
|
+
|
16
|
+
== REQUIREMENTS:
|
17
|
+
|
18
|
+
NONE
|
19
|
+
|
20
|
+
== INSTALL:
|
21
|
+
|
22
|
+
gem install quickbooks
|
23
|
+
|
24
|
+
== LICENSE:
|
25
|
+
|
26
|
+
Copyright (c) 2008 BehindLogic <gems@behindlogic.com>
|
27
|
+
|
28
|
+
* THIS IS NOT FREE SOFTWARE!
|
29
|
+
Although I'd love for it to be free, the truth is it just took
|
30
|
+
SO MUCH WORK that I absolutely must get something out of it.
|
31
|
+
Please understand that in my opinion, to try to integrate with
|
32
|
+
QuickBooks from scratch would be nothing short of proposterous
|
33
|
+
with this ready-made gem looking you straight in the eye. I'll
|
34
|
+
just leave it at that. :)
|
35
|
+
|
36
|
+
* Use of the Trial Version
|
37
|
+
This is a trial version. For the most part, this is a working
|
38
|
+
copy that is restricted to working with a small set of QuickBooks
|
39
|
+
objects.
|
40
|
+
|
41
|
+
Use of the full version of this QuickBooks Rubygem is subject to a
|
42
|
+
fee. BehindLogic has developed this QuickBooks Rubygem out of its
|
43
|
+
own necessity and the necessity of others; and because of the large
|
44
|
+
number of hours required to complete such a task, BehindLogic has
|
45
|
+
decided to provide it to others for use at a decent fee. For the
|
46
|
+
current fee, visit behindlogic.com or contact gems@behindlogic.com.
|
47
|
+
|
48
|
+
* Extent of permission
|
49
|
+
This QuickBooks Rubygem shall only be used for its packaged
|
50
|
+
capabilities. It is provided as-is. You MAY NOT redistribute any
|
51
|
+
code contained within this library. You MAY NOT include any code
|
52
|
+
contained within this library within an open source project, when
|
53
|
+
in doing so effectively releases the code to the public. Remember,
|
54
|
+
the purpose of this License is to allow you to fully use this gem,
|
55
|
+
after you have paid your due. BehindLogic has spent countless
|
56
|
+
hours on this work, and seeks to be compensated over time for its
|
57
|
+
work.
|
58
|
+
|
59
|
+
* Support, Upgrades and Bugfixes
|
60
|
+
Agreement for Support will be discussed elsewhere, such as when you
|
61
|
+
communicate your purchase of a license from BehindLogic. Upgrades
|
62
|
+
are to be granted upon request at a fraction of the initial fee
|
63
|
+
paid. Upgrades are not guaranteed to be created for new versions of
|
64
|
+
QuickBooks, and the timeliness of this service is not guaranteed
|
65
|
+
since newer versions of QuickBooks aren't guaranteed by Intuit to
|
66
|
+
follow patterns of their predecessors. Incentive monies, to a
|
67
|
+
certain point, help to speed up the work when necessary. Bugfixes
|
68
|
+
will be treated with care and will be worked on for free; however,
|
69
|
+
again, timeliness is not guaranteed, but incentive monies can be
|
70
|
+
offered to expedite the bug squashing.
|
71
|
+
|
72
|
+
* PROVIDED AS IS!
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
74
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
75
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
76
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
77
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
78
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
79
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
CHANGED
@@ -1,82 +1,21 @@
|
|
1
|
-
|
2
|
-
require 'rake'
|
3
|
-
require 'rake/testtask'
|
4
|
-
require 'rake/rdoctask'
|
5
|
-
require 'rake/gempackagetask'
|
6
|
-
require 'rake/contrib/rubyforgepublisher'
|
7
|
-
|
8
|
-
PKG_NAME = 'quickbooks'
|
9
|
-
PKG_VERSION = "0.4.0"
|
10
|
-
|
11
|
-
PKG_FILES = FileList[
|
12
|
-
"lib/**/*", "rspec/**/*", "[A-Z]*", "Rakefile", "doc/**/*"
|
13
|
-
]
|
14
|
-
|
15
|
-
desc "Default Task"
|
16
|
-
task :default => [ :test ] do
|
17
|
-
# Run the unit tests
|
18
|
-
desc "Run all rspec tests (rake task not yet implemented!)"
|
19
|
-
end
|
20
|
-
|
21
|
-
# Make a console, useful when working on tests
|
22
|
-
desc "Generate a test console"
|
23
|
-
task :console do
|
24
|
-
verbose( false ) { sh "irb -I lib -r 'quickbooks'" }
|
25
|
-
end
|
26
|
-
|
27
|
-
# Genereate the RDoc documentation
|
28
|
-
desc "Create documentation"
|
29
|
-
Rake::RDocTask.new("doc") { |rdoc|
|
30
|
-
rdoc.title = "QuickBooks for Ruby"
|
31
|
-
rdoc.rdoc_dir = 'doc'
|
32
|
-
rdoc.rdoc_files.include('README')
|
33
|
-
rdoc.rdoc_files.include('LICENSE')
|
34
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
35
|
-
}
|
1
|
+
# -*- ruby -*-
|
36
2
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
#### Which files are to be included in this gem? Everything! (Except CVS directories.)
|
50
|
-
s.files = PKG_FILES
|
51
|
-
|
52
|
-
#### Load-time details: library and application (you will need one or both).
|
53
|
-
s.require_path = 'lib'
|
54
|
-
|
55
|
-
#### Documentation and testing.
|
56
|
-
s.has_rdoc = true
|
57
|
-
s.extra_rdoc_files = ["README", "LICENSE"]
|
58
|
-
|
59
|
-
#### Author and project details.
|
60
|
-
s.author = "Daniel Parker"
|
61
|
-
s.email = "gems@behindlogic.com"
|
62
|
-
s.homepage = "http://quickbooks.rubyforge.org"
|
63
|
-
s.rubyforge_project = 'quickbooks'
|
64
|
-
end
|
65
|
-
|
66
|
-
Rake::GemPackageTask.new(spec) do |pkg|
|
67
|
-
pkg.need_zip = false
|
68
|
-
pkg.need_tar = false
|
3
|
+
require 'rubygems'
|
4
|
+
gem 'hoe', '1.8.3'
|
5
|
+
require 'hoe'
|
6
|
+
require './lib/quickbooks.rb'
|
7
|
+
require './lib/quickbooks/version.rb'
|
8
|
+
|
9
|
+
hoe = Hoe.new('quickbooks', Quickbooks::VERSION::STRING) do |p|
|
10
|
+
p.developer('BehindLogic', 'gems@behindlogic.com')
|
11
|
+
p.test_globs = ["test/**/test_*.rb", "spec/**/*_spec.rb"]
|
12
|
+
p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
|
13
|
+
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
14
|
+
# p.extra_deps << ['extlib', '>= 0.9.6']
|
69
15
|
end
|
70
16
|
|
71
|
-
|
72
|
-
task :
|
73
|
-
|
74
|
-
|
75
|
-
["Library", "lib"]
|
76
|
-
).to_s
|
17
|
+
# vim: syntax=Ruby
|
18
|
+
task :cultivate do
|
19
|
+
system "touch Manifest.txt; rake check_manifest | grep -v \"(in \" | patch"
|
20
|
+
system "rake debug_gem | grep -v \"(in \" > #{hoe.name}.gemspec"
|
77
21
|
end
|
78
|
-
|
79
|
-
desc "Publish new documentation"
|
80
|
-
task :publish => [:doc] do
|
81
|
-
`scp -r doc/* dcparker@rubyforge.org:/var/www/gforge-projects/quickbooks`
|
82
|
-
end
|
data/lib/quickbooks.rb
CHANGED
@@ -1,7 +1,153 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
require 'quickbooks/
|
7
|
-
require 'quickbooks/
|
1
|
+
require 'time'
|
2
|
+
gem_path = File.dirname(__FILE__)
|
3
|
+
$:.unshift(File.expand_path(gem_path)) unless $:.include?(gem_path) || $:.include?(File.expand_path(gem_path))
|
4
|
+
|
5
|
+
require 'quickbooks/extlib'
|
6
|
+
require 'quickbooks/ruby_ext'
|
7
|
+
require 'quickbooks/xsd'
|
8
|
+
require 'quickbooks/element_collection'
|
9
|
+
require 'quickbooks/element'
|
10
|
+
require 'quickbooks/model'
|
11
|
+
require 'quickbooks/adaptability'
|
12
|
+
|
13
|
+
# Use the QB constant to access any model or element class. QB::Customer will get the Customer model class,
|
14
|
+
# autogenerating it from the parsed specs if necessary. You can also access a class constant using the
|
15
|
+
# accessor method: QB['Customer']. Use QB.xsd if you want to browse the XSD data structure parsed from the
|
16
|
+
# specs at the current Quickbooks.qbxml_version.
|
17
|
+
module QB
|
18
|
+
class << self
|
19
|
+
def const_missing(const)
|
20
|
+
Quickbooks.get_constant(const)
|
21
|
+
end
|
22
|
+
alias :[] :const_missing
|
23
|
+
|
24
|
+
# Returns the XSD data structure parsed from the specs at the current Quickbooks.qbxml_version.
|
25
|
+
def xsd
|
26
|
+
Quickbooks.xsd(true)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
module Quickbooks
|
32
|
+
# Just a placeholder for all Model classes.
|
33
|
+
module Models
|
34
|
+
end
|
35
|
+
# Just a placeholder for all Element classes.
|
36
|
+
module Elements
|
37
|
+
end
|
38
|
+
# Just a placeholder for all Property classes.
|
39
|
+
module Properties
|
40
|
+
end
|
41
|
+
|
42
|
+
ValidationError = Class.new(RuntimeError)
|
43
|
+
AttributeAssignmentError = Class.new(RuntimeError)
|
44
|
+
InvalidAttributeError = Class.new(AttributeAssignmentError)
|
45
|
+
QuickbooksAPIError = Class.new(RuntimeError)
|
46
|
+
HTTPConnectorError = Class.new(RuntimeError)
|
47
|
+
|
48
|
+
extend Adaptability
|
49
|
+
|
50
|
+
class << self
|
51
|
+
|
52
|
+
# Set or retrieve the current qbxml_version the gem is running at. If autoload is true, it will ask Quickbooks
|
53
|
+
# (via the current connection) for the qbxml versions it supports, then choose the latest that the gem also supports.
|
54
|
+
def qbxml_version(autoload=false)
|
55
|
+
@qbxml_version ||= if autoload
|
56
|
+
'2.1'
|
57
|
+
else
|
58
|
+
nil
|
59
|
+
end
|
60
|
+
end
|
61
|
+
def qbxml_version=(version)
|
62
|
+
warn "Only a subset of QBXML Version 2.1 is available in the demo."
|
63
|
+
@qbxml_version = '2.1'
|
64
|
+
# Load xsd right away?
|
65
|
+
# Also, could run a separate thread for loading this,
|
66
|
+
# then join it when needed and harvest the xsd from it.
|
67
|
+
# xsd(true)
|
68
|
+
end
|
69
|
+
|
70
|
+
# Returns the XSD data structure parsed from the current qbxml_version. If autoload is true, it will go ahead and parse the XSD for
|
71
|
+
# the current version if it is not already parsed and cached.
|
72
|
+
def xsd(autoload=false)
|
73
|
+
@xsd ||= {}
|
74
|
+
@xsd[qbxml_version(true)] || begin
|
75
|
+
@xsd[qbxml_version] = (autoload ? Quickbooks::XSD.parse_file("qbxmlops_demo.xsd", File.dirname(__FILE__) + "/../source/") : nil)
|
76
|
+
connector_error_xsd = <<ENDXSD
|
77
|
+
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
|
78
|
+
<xsd:element name="ErrorMessage">
|
79
|
+
<xsd:simpleType>
|
80
|
+
<xsd:restriction base="STRTYPE" />
|
81
|
+
</xsd:simpleType>
|
82
|
+
</xsd:element>
|
83
|
+
|
84
|
+
<xsd:element name="ConnectorError">
|
85
|
+
<xsd:complexType>
|
86
|
+
<xsd:sequence>
|
87
|
+
<xsd:element ref="ErrorMessage" />
|
88
|
+
</xsd:sequence>
|
89
|
+
</xsd:complexType>
|
90
|
+
</xsd:element>
|
91
|
+
ENDXSD
|
92
|
+
@xsd[qbxml_version].parse(connector_error_xsd)
|
93
|
+
end
|
94
|
+
@xsd[qbxml_version]
|
95
|
+
end
|
96
|
+
|
97
|
+
# Quickbooks.get_constant. See QB.
|
98
|
+
def get_constant(const)
|
99
|
+
const = const.to_s
|
100
|
+
return loaded_classes[const] if loaded_classes.has_key?(const)
|
101
|
+
# TODO: Need to auto-generate Models too!
|
102
|
+
# If const+'Ret' exists, generate a Model class for const.
|
103
|
+
if const_xsd = xsd(true)[const] || xsd(true)[const+'Ret'] || xsd(true)[const+'Add'] || xsd(true)[const+'Mod']
|
104
|
+
loaded_classes[const] = const_xsd.to_class(const)
|
105
|
+
else
|
106
|
+
raise RuntimeError, "The Quickbooks class '#{const}' could not be found (called from #{caller[1]}) in QBXML Version #{qbxml_version}. Please report to gems@behindlogic.com if you think this is a BUG! (#{xsd.inspect} : #{const.inspect} => #{xsd[const]})"
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
def send_qbxml(qbxml)
|
111
|
+
@last_response_xml = connection.send_xml("<?xml version=\"1.0\" ?>\n<?qbxml version=\"#{qbxml_version(true)}\" ?>\n#{qbxml}")
|
112
|
+
end
|
113
|
+
|
114
|
+
def send_request(request)
|
115
|
+
Quickbooks::Support.parse_xml(send_qbxml(request.to_xml))
|
116
|
+
end
|
117
|
+
|
118
|
+
def requestify(requestish)
|
119
|
+
QB::QBXMLMsgsRq.options[:onError].default = 'stopOnError'
|
120
|
+
request = requestish.class.name =~ /Rq$/ ? QB::QBXML.new(:QBXMLMsgsRq => [requestish]) : requestish
|
121
|
+
raise ValidationError, request.to_xml + "\n" + request.errors.join(', ') if !request.valid?
|
122
|
+
return request
|
123
|
+
end
|
124
|
+
|
125
|
+
def qbxml(&block)
|
126
|
+
raise ArgumentError unless block_given?
|
127
|
+
yield
|
128
|
+
end
|
129
|
+
|
130
|
+
# Execute a Request to Quickbooks and parse the answer back into QB gem objects.
|
131
|
+
def execute(requestish)
|
132
|
+
request = requestify(requestish)
|
133
|
+
response_klass_name = request[:QBXMLMsgsRq].attributes[0].class.short_name.gsub(/Rq/, 'Rs')
|
134
|
+
@last_response = send_request(request)
|
135
|
+
raise RuntimeError, "Response invalid!" unless @last_response.respond_to?(:[])
|
136
|
+
# Here, if the response we got was an error (<ConnectorError><ErrorMessage>...</ErrorMessage></ConnectorError>), deal with it now.
|
137
|
+
raise HTTPConnectorError, @last_response[:ConnectorError][:ErrorMessage] if @last_response[:ConnectorError]
|
138
|
+
raise RuntimeError, "Response did not include QBXMLMsgsRs." unless @last_response[:QBXMLMsgsRs]
|
139
|
+
raise RuntimeError, "Response not the right type (#{response_klass_name})." unless @last_response[:QBXMLMsgsRs][response_klass_name]
|
140
|
+
# raise RuntimeError, "Response has no results." unless @last_response[:QBXMLMsgsRs][response_klass_name][0].nil?
|
141
|
+
rs = @last_response[:QBXMLMsgsRs][response_klass_name][0]
|
142
|
+
if rs && rs['statusSeverity'] == 'Error'
|
143
|
+
raise QuickbooksAPIError, "##{rs['statusCode']}: #{rs['statusMessage']}"
|
144
|
+
end
|
145
|
+
@last_response
|
146
|
+
end
|
147
|
+
|
148
|
+
def loaded_classes
|
149
|
+
@loaded_classes ||= {}
|
150
|
+
@loaded_classes[qbxml_version(true)] ||= {}
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|