cxml-ruby 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/ruby.yml +23 -0
  3. data/.gitignore +14 -0
  4. data/.rspec +1 -0
  5. data/.rubocop.yml +175 -0
  6. data/Gemfile +2 -0
  7. data/LICENSE +18 -0
  8. data/README.md +94 -0
  9. data/Rakefile +6 -0
  10. data/cxml-ruby.gemspec +27 -0
  11. data/lib/cxml/accounting.rb +27 -0
  12. data/lib/cxml/additional_cost.rb +10 -0
  13. data/lib/cxml/additional_deduction.rb +12 -0
  14. data/lib/cxml/address.rb +16 -0
  15. data/lib/cxml/bill_to.rb +10 -0
  16. data/lib/cxml/browser_form_post.rb +13 -0
  17. data/lib/cxml/charge.rb +9 -0
  18. data/lib/cxml/classification.rb +9 -0
  19. data/lib/cxml/confirmation_header.rb +16 -0
  20. data/lib/cxml/confirmation_item.rb +14 -0
  21. data/lib/cxml/confirmation_request.rb +25 -0
  22. data/lib/cxml/confirmation_status.rb +32 -0
  23. data/lib/cxml/contact.rb +16 -0
  24. data/lib/cxml/country.rb +9 -0
  25. data/lib/cxml/credential.rb +49 -0
  26. data/lib/cxml/credential_mac.rb +26 -0
  27. data/lib/cxml/deducted_price.rb +9 -0
  28. data/lib/cxml/deduction_amount.rb +9 -0
  29. data/lib/cxml/description.rb +9 -0
  30. data/lib/cxml/discount.rb +10 -0
  31. data/lib/cxml/discount_percent.rb +9 -0
  32. data/lib/cxml/distribution.rb +11 -0
  33. data/lib/cxml/document.rb +71 -0
  34. data/lib/cxml/document_node.rb +126 -0
  35. data/lib/cxml/document_reference.rb +9 -0
  36. data/lib/cxml/due_amount.rb +9 -0
  37. data/lib/cxml/email.rb +10 -0
  38. data/lib/cxml/errors.rb +7 -0
  39. data/lib/cxml/extrinsic.rb +10 -0
  40. data/lib/cxml/from.rb +9 -0
  41. data/lib/cxml/gross_amount.rb +9 -0
  42. data/lib/cxml/header.rb +29 -0
  43. data/lib/cxml/id_reference.rb +13 -0
  44. data/lib/cxml/invoice_detail_discount.rb +13 -0
  45. data/lib/cxml/invoice_detail_header_indicator.rb +11 -0
  46. data/lib/cxml/invoice_detail_header_order.rb +24 -0
  47. data/lib/cxml/invoice_detail_item.rb +55 -0
  48. data/lib/cxml/invoice_detail_item_reference.rb +17 -0
  49. data/lib/cxml/invoice_detail_line_indicator.rb +14 -0
  50. data/lib/cxml/invoice_detail_line_shipping.rb +11 -0
  51. data/lib/cxml/invoice_detail_line_special_handling.rb +11 -0
  52. data/lib/cxml/invoice_detail_order.rb +24 -0
  53. data/lib/cxml/invoice_detail_order_info.rb +10 -0
  54. data/lib/cxml/invoice_detail_order_summary.rb +32 -0
  55. data/lib/cxml/invoice_detail_request.rb +40 -0
  56. data/lib/cxml/invoice_detail_request_header.rb +54 -0
  57. data/lib/cxml/invoice_detail_shipping.rb +27 -0
  58. data/lib/cxml/invoice_detail_summary.rb +18 -0
  59. data/lib/cxml/invoice_id_info.rb +10 -0
  60. data/lib/cxml/invoice_partner.rb +10 -0
  61. data/lib/cxml/item_detail.rb +27 -0
  62. data/lib/cxml/item_id.rb +10 -0
  63. data/lib/cxml/item_in.rb +14 -0
  64. data/lib/cxml/item_out.rb +17 -0
  65. data/lib/cxml/master_agreement_reference.rb +9 -0
  66. data/lib/cxml/message.rb +13 -0
  67. data/lib/cxml/modification.rb +15 -0
  68. data/lib/cxml/modification_detail.rb +16 -0
  69. data/lib/cxml/modifications.rb +23 -0
  70. data/lib/cxml/money.rb +35 -0
  71. data/lib/cxml/name.rb +9 -0
  72. data/lib/cxml/net_amount.rb +9 -0
  73. data/lib/cxml/order_reference.rb +12 -0
  74. data/lib/cxml/order_request.rb +33 -0
  75. data/lib/cxml/order_request_header.rb +66 -0
  76. data/lib/cxml/parser.rb +37 -0
  77. data/lib/cxml/payment_term.rb +28 -0
  78. data/lib/cxml/period.rb +10 -0
  79. data/lib/cxml/postal_address.rb +35 -0
  80. data/lib/cxml/protocol.rb +57 -0
  81. data/lib/cxml/punch_out_order_message.rb +33 -0
  82. data/lib/cxml/punch_out_order_message_header.rb +20 -0
  83. data/lib/cxml/punch_out_setup_request.rb +31 -0
  84. data/lib/cxml/punch_out_setup_response.rb +9 -0
  85. data/lib/cxml/request.rb +21 -0
  86. data/lib/cxml/response.rb +20 -0
  87. data/lib/cxml/segment.rb +12 -0
  88. data/lib/cxml/sender.rb +10 -0
  89. data/lib/cxml/ship_to.rb +10 -0
  90. data/lib/cxml/shipping.rb +10 -0
  91. data/lib/cxml/shipping_amount.rb +10 -0
  92. data/lib/cxml/special_handling_amount.rb +11 -0
  93. data/lib/cxml/start_page.rb +13 -0
  94. data/lib/cxml/state.rb +9 -0
  95. data/lib/cxml/status.rb +27 -0
  96. data/lib/cxml/subtotal_amount.rb +9 -0
  97. data/lib/cxml/supplier_setup.rb +13 -0
  98. data/lib/cxml/tax.rb +42 -0
  99. data/lib/cxml/tax_adjustment_amount.rb +9 -0
  100. data/lib/cxml/tax_amount.rb +9 -0
  101. data/lib/cxml/tax_detail.rb +44 -0
  102. data/lib/cxml/tax_location.rb +9 -0
  103. data/lib/cxml/taxable_amount.rb +9 -0
  104. data/lib/cxml/to.rb +9 -0
  105. data/lib/cxml/total.rb +10 -0
  106. data/lib/cxml/total_allowances.rb +9 -0
  107. data/lib/cxml/total_amount_without_tax.rb +9 -0
  108. data/lib/cxml/total_charges.rb +9 -0
  109. data/lib/cxml/unit_price.rb +9 -0
  110. data/lib/cxml/version.rb +5 -0
  111. data/lib/cxml.rb +39 -0
  112. data/spec/credential_spec.rb +37 -0
  113. data/spec/cxml_spec.rb +6 -0
  114. data/spec/document_spec.rb +155 -0
  115. data/spec/fixtures/.gitkeep +0 -0
  116. data/spec/fixtures/envelope.xml +31 -0
  117. data/spec/fixtures/envelope2.xml +36 -0
  118. data/spec/fixtures/invoice_backed_and_unbacked_by_pos.xml +106 -0
  119. data/spec/fixtures/invoice_backed_by_multiple_pos.xml +97 -0
  120. data/spec/fixtures/invoice_taxes_at_line.xml +82 -0
  121. data/spec/fixtures/invoice_taxes_at_line_multiple_taxes.xml +403 -0
  122. data/spec/fixtures/invoice_taxes_at_total.xml +78 -0
  123. data/spec/fixtures/item_in.xml +11 -0
  124. data/spec/fixtures/order_request.cxml +121 -0
  125. data/spec/fixtures/punch_out_order_message_doc.xml +32 -0
  126. data/spec/fixtures/punch_out_setup_request_doc.xml +32 -0
  127. data/spec/fixtures/punch_out_setup_request_doc_coupa.xml +42 -0
  128. data/spec/fixtures/punch_out_setup_request_doc_with_ship_to.xml +46 -0
  129. data/spec/fixtures/purchase_order_request_200.xml +132 -0
  130. data/spec/fixtures/request_doc.xml +79 -0
  131. data/spec/fixtures/response_status_200.xml +11 -0
  132. data/spec/fixtures/response_status_400.xml +5 -0
  133. data/spec/header_spec.rb +54 -0
  134. data/spec/invoice_detail_request_spec.rb +88 -0
  135. data/spec/item_detail_spec.rb +44 -0
  136. data/spec/item_id_spec.rb +40 -0
  137. data/spec/item_in_spec.rb +41 -0
  138. data/spec/money_spec.rb +44 -0
  139. data/spec/parser_spec.rb +6 -0
  140. data/spec/protocol_spec.rb +16 -0
  141. data/spec/punch_out_order_message_header_spec.rb +36 -0
  142. data/spec/punch_out_order_message_spec.rb +43 -0
  143. data/spec/punch_out_setup_request_spec.rb +60 -0
  144. data/spec/purchase_order_request_spec.rb +40 -0
  145. data/spec/request_spec.rb +36 -0
  146. data/spec/response_spec.rb +58 -0
  147. data/spec/sender_spec.rb +32 -0
  148. data/spec/spec_helper.rb +21 -0
  149. data/spec/status_spec.rb +44 -0
  150. data/spec/support/helpers.rb +5 -0
  151. metadata +317 -0
metadata ADDED
@@ -0,0 +1,317 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cxml-ruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Josh Beckman
8
+ - Eleni Chappen
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2020-04-15 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: pry
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '0.12'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '0.12'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rake
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '13.0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '13.0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rspec
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '3.9'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '3.9'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rubocop
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '0.81'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '0.81'
70
+ - !ruby/object:Gem::Dependency
71
+ name: nokogiri
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: '1.10'
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: '1.10'
84
+ - !ruby/object:Gem::Dependency
85
+ name: xml-simple
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - "~>"
89
+ - !ruby/object:Gem::Version
90
+ version: '1.1'
91
+ type: :runtime
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - "~>"
96
+ - !ruby/object:Gem::Version
97
+ version: '1.1'
98
+ description: Ruby library to parse/generate documents with the cXML protocol
99
+ email:
100
+ - josh@officeluv.com
101
+ - eleni@officeluv.com
102
+ executables: []
103
+ extensions: []
104
+ extra_rdoc_files: []
105
+ files:
106
+ - ".github/workflows/ruby.yml"
107
+ - ".gitignore"
108
+ - ".rspec"
109
+ - ".rubocop.yml"
110
+ - Gemfile
111
+ - LICENSE
112
+ - README.md
113
+ - Rakefile
114
+ - cxml-ruby.gemspec
115
+ - lib/cxml.rb
116
+ - lib/cxml/accounting.rb
117
+ - lib/cxml/additional_cost.rb
118
+ - lib/cxml/additional_deduction.rb
119
+ - lib/cxml/address.rb
120
+ - lib/cxml/bill_to.rb
121
+ - lib/cxml/browser_form_post.rb
122
+ - lib/cxml/charge.rb
123
+ - lib/cxml/classification.rb
124
+ - lib/cxml/confirmation_header.rb
125
+ - lib/cxml/confirmation_item.rb
126
+ - lib/cxml/confirmation_request.rb
127
+ - lib/cxml/confirmation_status.rb
128
+ - lib/cxml/contact.rb
129
+ - lib/cxml/country.rb
130
+ - lib/cxml/credential.rb
131
+ - lib/cxml/credential_mac.rb
132
+ - lib/cxml/deducted_price.rb
133
+ - lib/cxml/deduction_amount.rb
134
+ - lib/cxml/description.rb
135
+ - lib/cxml/discount.rb
136
+ - lib/cxml/discount_percent.rb
137
+ - lib/cxml/distribution.rb
138
+ - lib/cxml/document.rb
139
+ - lib/cxml/document_node.rb
140
+ - lib/cxml/document_reference.rb
141
+ - lib/cxml/due_amount.rb
142
+ - lib/cxml/email.rb
143
+ - lib/cxml/errors.rb
144
+ - lib/cxml/extrinsic.rb
145
+ - lib/cxml/from.rb
146
+ - lib/cxml/gross_amount.rb
147
+ - lib/cxml/header.rb
148
+ - lib/cxml/id_reference.rb
149
+ - lib/cxml/invoice_detail_discount.rb
150
+ - lib/cxml/invoice_detail_header_indicator.rb
151
+ - lib/cxml/invoice_detail_header_order.rb
152
+ - lib/cxml/invoice_detail_item.rb
153
+ - lib/cxml/invoice_detail_item_reference.rb
154
+ - lib/cxml/invoice_detail_line_indicator.rb
155
+ - lib/cxml/invoice_detail_line_shipping.rb
156
+ - lib/cxml/invoice_detail_line_special_handling.rb
157
+ - lib/cxml/invoice_detail_order.rb
158
+ - lib/cxml/invoice_detail_order_info.rb
159
+ - lib/cxml/invoice_detail_order_summary.rb
160
+ - lib/cxml/invoice_detail_request.rb
161
+ - lib/cxml/invoice_detail_request_header.rb
162
+ - lib/cxml/invoice_detail_shipping.rb
163
+ - lib/cxml/invoice_detail_summary.rb
164
+ - lib/cxml/invoice_id_info.rb
165
+ - lib/cxml/invoice_partner.rb
166
+ - lib/cxml/item_detail.rb
167
+ - lib/cxml/item_id.rb
168
+ - lib/cxml/item_in.rb
169
+ - lib/cxml/item_out.rb
170
+ - lib/cxml/master_agreement_reference.rb
171
+ - lib/cxml/message.rb
172
+ - lib/cxml/modification.rb
173
+ - lib/cxml/modification_detail.rb
174
+ - lib/cxml/modifications.rb
175
+ - lib/cxml/money.rb
176
+ - lib/cxml/name.rb
177
+ - lib/cxml/net_amount.rb
178
+ - lib/cxml/order_reference.rb
179
+ - lib/cxml/order_request.rb
180
+ - lib/cxml/order_request_header.rb
181
+ - lib/cxml/parser.rb
182
+ - lib/cxml/payment_term.rb
183
+ - lib/cxml/period.rb
184
+ - lib/cxml/postal_address.rb
185
+ - lib/cxml/protocol.rb
186
+ - lib/cxml/punch_out_order_message.rb
187
+ - lib/cxml/punch_out_order_message_header.rb
188
+ - lib/cxml/punch_out_setup_request.rb
189
+ - lib/cxml/punch_out_setup_response.rb
190
+ - lib/cxml/request.rb
191
+ - lib/cxml/response.rb
192
+ - lib/cxml/segment.rb
193
+ - lib/cxml/sender.rb
194
+ - lib/cxml/ship_to.rb
195
+ - lib/cxml/shipping.rb
196
+ - lib/cxml/shipping_amount.rb
197
+ - lib/cxml/special_handling_amount.rb
198
+ - lib/cxml/start_page.rb
199
+ - lib/cxml/state.rb
200
+ - lib/cxml/status.rb
201
+ - lib/cxml/subtotal_amount.rb
202
+ - lib/cxml/supplier_setup.rb
203
+ - lib/cxml/tax.rb
204
+ - lib/cxml/tax_adjustment_amount.rb
205
+ - lib/cxml/tax_amount.rb
206
+ - lib/cxml/tax_detail.rb
207
+ - lib/cxml/tax_location.rb
208
+ - lib/cxml/taxable_amount.rb
209
+ - lib/cxml/to.rb
210
+ - lib/cxml/total.rb
211
+ - lib/cxml/total_allowances.rb
212
+ - lib/cxml/total_amount_without_tax.rb
213
+ - lib/cxml/total_charges.rb
214
+ - lib/cxml/unit_price.rb
215
+ - lib/cxml/version.rb
216
+ - spec/credential_spec.rb
217
+ - spec/cxml_spec.rb
218
+ - spec/document_spec.rb
219
+ - spec/fixtures/.gitkeep
220
+ - spec/fixtures/envelope.xml
221
+ - spec/fixtures/envelope2.xml
222
+ - spec/fixtures/invoice_backed_and_unbacked_by_pos.xml
223
+ - spec/fixtures/invoice_backed_by_multiple_pos.xml
224
+ - spec/fixtures/invoice_taxes_at_line.xml
225
+ - spec/fixtures/invoice_taxes_at_line_multiple_taxes.xml
226
+ - spec/fixtures/invoice_taxes_at_total.xml
227
+ - spec/fixtures/item_in.xml
228
+ - spec/fixtures/order_request.cxml
229
+ - spec/fixtures/punch_out_order_message_doc.xml
230
+ - spec/fixtures/punch_out_setup_request_doc.xml
231
+ - spec/fixtures/punch_out_setup_request_doc_coupa.xml
232
+ - spec/fixtures/punch_out_setup_request_doc_with_ship_to.xml
233
+ - spec/fixtures/purchase_order_request_200.xml
234
+ - spec/fixtures/request_doc.xml
235
+ - spec/fixtures/response_status_200.xml
236
+ - spec/fixtures/response_status_400.xml
237
+ - spec/header_spec.rb
238
+ - spec/invoice_detail_request_spec.rb
239
+ - spec/item_detail_spec.rb
240
+ - spec/item_id_spec.rb
241
+ - spec/item_in_spec.rb
242
+ - spec/money_spec.rb
243
+ - spec/parser_spec.rb
244
+ - spec/protocol_spec.rb
245
+ - spec/punch_out_order_message_header_spec.rb
246
+ - spec/punch_out_order_message_spec.rb
247
+ - spec/punch_out_setup_request_spec.rb
248
+ - spec/purchase_order_request_spec.rb
249
+ - spec/request_spec.rb
250
+ - spec/response_spec.rb
251
+ - spec/sender_spec.rb
252
+ - spec/spec_helper.rb
253
+ - spec/status_spec.rb
254
+ - spec/support/helpers.rb
255
+ homepage: https://github.com/officeluv/cxml
256
+ licenses:
257
+ - MIT
258
+ metadata: {}
259
+ post_install_message:
260
+ rdoc_options: []
261
+ require_paths:
262
+ - lib
263
+ required_ruby_version: !ruby/object:Gem::Requirement
264
+ requirements:
265
+ - - ">="
266
+ - !ruby/object:Gem::Version
267
+ version: '0'
268
+ required_rubygems_version: !ruby/object:Gem::Requirement
269
+ requirements:
270
+ - - ">="
271
+ - !ruby/object:Gem::Version
272
+ version: '0'
273
+ requirements: []
274
+ rubygems_version: 3.0.3
275
+ signing_key:
276
+ specification_version: 4
277
+ summary: Parse/generate documents with the cXML protocol
278
+ test_files:
279
+ - spec/credential_spec.rb
280
+ - spec/cxml_spec.rb
281
+ - spec/document_spec.rb
282
+ - spec/fixtures/.gitkeep
283
+ - spec/fixtures/envelope.xml
284
+ - spec/fixtures/envelope2.xml
285
+ - spec/fixtures/invoice_backed_and_unbacked_by_pos.xml
286
+ - spec/fixtures/invoice_backed_by_multiple_pos.xml
287
+ - spec/fixtures/invoice_taxes_at_line.xml
288
+ - spec/fixtures/invoice_taxes_at_line_multiple_taxes.xml
289
+ - spec/fixtures/invoice_taxes_at_total.xml
290
+ - spec/fixtures/item_in.xml
291
+ - spec/fixtures/order_request.cxml
292
+ - spec/fixtures/punch_out_order_message_doc.xml
293
+ - spec/fixtures/punch_out_setup_request_doc.xml
294
+ - spec/fixtures/punch_out_setup_request_doc_coupa.xml
295
+ - spec/fixtures/punch_out_setup_request_doc_with_ship_to.xml
296
+ - spec/fixtures/purchase_order_request_200.xml
297
+ - spec/fixtures/request_doc.xml
298
+ - spec/fixtures/response_status_200.xml
299
+ - spec/fixtures/response_status_400.xml
300
+ - spec/header_spec.rb
301
+ - spec/invoice_detail_request_spec.rb
302
+ - spec/item_detail_spec.rb
303
+ - spec/item_id_spec.rb
304
+ - spec/item_in_spec.rb
305
+ - spec/money_spec.rb
306
+ - spec/parser_spec.rb
307
+ - spec/protocol_spec.rb
308
+ - spec/punch_out_order_message_header_spec.rb
309
+ - spec/punch_out_order_message_spec.rb
310
+ - spec/punch_out_setup_request_spec.rb
311
+ - spec/purchase_order_request_spec.rb
312
+ - spec/request_spec.rb
313
+ - spec/response_spec.rb
314
+ - spec/sender_spec.rb
315
+ - spec/spec_helper.rb
316
+ - spec/status_spec.rb
317
+ - spec/support/helpers.rb