gobl 0.10.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -13
  3. data/lib/gobl/version.rb +1 -1
  4. data/lib/gobl.rb +1 -0
  5. metadata +73 -73
  6. /data/lib/{gobl → generated/gobl}/bill/charge.rb +0 -0
  7. /data/lib/{gobl → generated/gobl}/bill/delivery.rb +0 -0
  8. /data/lib/{gobl → generated/gobl}/bill/discount.rb +0 -0
  9. /data/lib/{gobl → generated/gobl}/bill/document_reference.rb +0 -0
  10. /data/lib/{gobl → generated/gobl}/bill/invoice.rb +0 -0
  11. /data/lib/{gobl → generated/gobl}/bill/line.rb +0 -0
  12. /data/lib/{gobl → generated/gobl}/bill/line_charge.rb +0 -0
  13. /data/lib/{gobl → generated/gobl}/bill/line_discount.rb +0 -0
  14. /data/lib/{gobl → generated/gobl}/bill/ordering.rb +0 -0
  15. /data/lib/{gobl → generated/gobl}/bill/outlay.rb +0 -0
  16. /data/lib/{gobl → generated/gobl}/bill/payment.rb +0 -0
  17. /data/lib/{gobl → generated/gobl}/bill/preceding.rb +0 -0
  18. /data/lib/{gobl → generated/gobl}/bill/tax.rb +0 -0
  19. /data/lib/{gobl → generated/gobl}/bill/totals.rb +0 -0
  20. /data/lib/{gobl → generated/gobl}/cal/date.rb +0 -0
  21. /data/lib/{gobl → generated/gobl}/cal/period.rb +0 -0
  22. /data/lib/{gobl → generated/gobl}/cbc/code.rb +0 -0
  23. /data/lib/{gobl → generated/gobl}/cbc/key.rb +0 -0
  24. /data/lib/{gobl → generated/gobl}/cbc/meta.rb +0 -0
  25. /data/lib/{gobl → generated/gobl}/cbc/note.rb +0 -0
  26. /data/lib/{gobl → generated/gobl}/cbc/stamp.rb +0 -0
  27. /data/lib/{gobl → generated/gobl}/currency/code.rb +0 -0
  28. /data/lib/{gobl → generated/gobl}/currency/exchange_rate.rb +0 -0
  29. /data/lib/{gobl → generated/gobl}/document.rb +0 -0
  30. /data/lib/{gobl → generated/gobl}/dsig/digest.rb +0 -0
  31. /data/lib/{gobl → generated/gobl}/dsig/signature.rb +0 -0
  32. /data/lib/{gobl → generated/gobl}/envelope.rb +0 -0
  33. /data/lib/{gobl → generated/gobl}/header.rb +0 -0
  34. /data/lib/{gobl → generated/gobl}/i18n/string.rb +0 -0
  35. /data/lib/{gobl → generated/gobl}/l10n/code.rb +0 -0
  36. /data/lib/{gobl → generated/gobl}/l10n/country_code.rb +0 -0
  37. /data/lib/{gobl → generated/gobl}/note/message.rb +0 -0
  38. /data/lib/{gobl → generated/gobl}/org/address.rb +0 -0
  39. /data/lib/{gobl → generated/gobl}/org/coordinates.rb +0 -0
  40. /data/lib/{gobl → generated/gobl}/org/email.rb +0 -0
  41. /data/lib/{gobl → generated/gobl}/org/identity.rb +0 -0
  42. /data/lib/{gobl → generated/gobl}/org/image.rb +0 -0
  43. /data/lib/{gobl → generated/gobl}/org/inbox.rb +0 -0
  44. /data/lib/{gobl → generated/gobl}/org/item.rb +0 -0
  45. /data/lib/{gobl → generated/gobl}/org/name.rb +0 -0
  46. /data/lib/{gobl → generated/gobl}/org/party.rb +0 -0
  47. /data/lib/{gobl → generated/gobl}/org/person.rb +0 -0
  48. /data/lib/{gobl → generated/gobl}/org/registration.rb +0 -0
  49. /data/lib/{gobl → generated/gobl}/org/telephone.rb +0 -0
  50. /data/lib/{gobl → generated/gobl}/org/unit.rb +0 -0
  51. /data/lib/{gobl → generated/gobl}/org/website.rb +0 -0
  52. /data/lib/{gobl → generated/gobl}/pay/advance.rb +0 -0
  53. /data/lib/{gobl → generated/gobl}/pay/card.rb +0 -0
  54. /data/lib/{gobl → generated/gobl}/pay/credit_transfer.rb +0 -0
  55. /data/lib/{gobl → generated/gobl}/pay/direct_debit.rb +0 -0
  56. /data/lib/{gobl → generated/gobl}/pay/due_date.rb +0 -0
  57. /data/lib/{gobl → generated/gobl}/pay/instructions.rb +0 -0
  58. /data/lib/{gobl → generated/gobl}/pay/online.rb +0 -0
  59. /data/lib/{gobl → generated/gobl}/pay/terms.rb +0 -0
  60. /data/lib/{gobl → generated/gobl}/tax/category.rb +0 -0
  61. /data/lib/{gobl → generated/gobl}/tax/category_total.rb +0 -0
  62. /data/lib/{gobl → generated/gobl}/tax/combo.rb +0 -0
  63. /data/lib/{gobl → generated/gobl}/tax/identity.rb +0 -0
  64. /data/lib/{gobl → generated/gobl}/tax/key_definition.rb +0 -0
  65. /data/lib/{gobl → generated/gobl}/tax/preceding_definitions.rb +0 -0
  66. /data/lib/{gobl → generated/gobl}/tax/rate.rb +0 -0
  67. /data/lib/{gobl → generated/gobl}/tax/rate_total.rb +0 -0
  68. /data/lib/{gobl → generated/gobl}/tax/rate_total_surcharge.rb +0 -0
  69. /data/lib/{gobl → generated/gobl}/tax/rate_value.rb +0 -0
  70. /data/lib/{gobl → generated/gobl}/tax/regime.rb +0 -0
  71. /data/lib/{gobl → generated/gobl}/tax/scenario.rb +0 -0
  72. /data/lib/{gobl → generated/gobl}/tax/scenario_set.rb +0 -0
  73. /data/lib/{gobl → generated/gobl}/tax/set.rb +0 -0
  74. /data/lib/{gobl → generated/gobl}/tax/tag.rb +0 -0
  75. /data/lib/{gobl → generated/gobl}/tax/total.rb +0 -0
  76. /data/lib/{gobl → generated/gobl}/tax/zone.rb +0 -0
  77. /data/lib/{gobl → generated/gobl}/uuid/uuid.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 411d128fa9ef6abe37669b9cef151f814220c867e52a6293ba0d79ffd1b840fd
4
- data.tar.gz: 7580b135c8bba421d242f09c6273cc9ab12a29aaef1b5766a4b2cd47b8cb6e28
3
+ metadata.gz: bff66b8750d72848acd28331e82d9c91a951d093331400a0d2942119d83b2f9b
4
+ data.tar.gz: 23d17b39a899ddc36293d2b070338bc30f4011acf08b299854f027ee06f8f758
5
5
  SHA512:
6
- metadata.gz: 90592d49b7ca8e7e52092c3c378770868efb59c07661dba09301df3bd33fab5653f3bd5ff9e9d35100d421a2894584a13221eb84e8b02fce675701aeace261eb
7
- data.tar.gz: b703c64f4c26d39dc24576c9875af0aaa4e25bfd42d46c19a6d322bc738d8d3c2aff31ddbd3e57ab4276bd2eae5aae1872622abc99f038dd7d5abf16a155ff49
6
+ metadata.gz: 2cc83e91eeefd2ef016b1a7a079e158c4b40cd1ba88b995b13ea46926dd7dbce06cc27547f755d18acb1e74b6ea1c81af99b7c6e5a190ecaeba1f596e9185a37
7
+ data.tar.gz: 22cfc2a7a0eb8c2c244bc04589033bd3f0a7e0fa6d77a76704c6775d79ba9f53bcd9ce8e84e225430a651da788a36ab8679e06e0ded107b773636479e93dec95
data/README.md CHANGED
@@ -215,28 +215,22 @@ The command `mage setup` fetches and installs all the required dependencies to u
215
215
 
216
216
  #### Code generation
217
217
 
218
- Ensure all the GOBL JSON Schema files are available by manually copying the base GOBL project's `build/schemas` path to the `data/schemas` path in this repository. Schemas are _.gitignored_, and you must copy them every time you want to update the generated code:
218
+ Ensure all the GOBL JSON Schema and Regime files are available by manually copying the [base GOBL project](https://github.com/invopop/gobl)'s `build/` path to the `data/` path in this repository. For example, assuming you have GOBL at `../gobl/`, you can run this:
219
219
 
220
220
  ```bash
221
- rm -rf ./data/schemas
222
- cp -r ../gobl/build/schemas ./data
221
+ rm -rf ./data/*
222
+ cp -r ../gobl/build/* ./data
223
223
  ```
224
224
 
225
- You can also update the regimes data with:
225
+ Please note that `schemas` is _.gitignored_ as we only need it to generate the code. However, the previous command also copies `regimes` which content is used by the library and so, it is part of the git repo and the gem.
226
226
 
227
- ```bash
228
- rm -rf ./data/regimes
229
- cp -r ../gobl/build/regimes ./data
230
- ```
231
-
232
- Now you can delete any previously generated code with
227
+ Now, with the help of [the GOBL generator](https://github.com/invopop/gobl.generator), you can regenerate the code. For example, assuming the GOBL generator is at `../gobl.generator`, you can run this:
233
228
 
234
229
  ```bash
235
- find lib -name "*.rb" -exec grep -l "Generated with GOBL" {} \; | xargs rm
230
+ rm -rf lib/generated/gobl
231
+ ../gobl.generator/bin/generate -l ruby -o lib/generated/gobl/
236
232
  ```
237
233
 
238
- The command `mage -v generate` generates the Ruby files from the JSON Schema. If the schema is updated, it will update the Ruby files.
239
-
240
234
  #### Tests
241
235
 
242
236
  Use the `mage spec` command to run the entire test suite.
data/lib/gobl/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GOBL
4
- VERSION = '0.10.0'
4
+ VERSION = '0.10.1'
5
5
  end
data/lib/gobl.rb CHANGED
@@ -9,6 +9,7 @@ require 'base64'
9
9
  require 'hashme'
10
10
 
11
11
  loader = Zeitwerk::Loader.for_gem
12
+ loader.push_dir("#{__dir__}/generated")
12
13
  loader.inflector.inflect(
13
14
  'gobl' => 'GOBL',
14
15
  'uuid' => 'UUID',
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gobl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Lilue
@@ -68,94 +68,94 @@ files:
68
68
  - data/regimes/it.json
69
69
  - data/regimes/nl.json
70
70
  - data/regimes/pt.json
71
+ - lib/generated/gobl/bill/charge.rb
72
+ - lib/generated/gobl/bill/delivery.rb
73
+ - lib/generated/gobl/bill/discount.rb
74
+ - lib/generated/gobl/bill/document_reference.rb
75
+ - lib/generated/gobl/bill/invoice.rb
76
+ - lib/generated/gobl/bill/line.rb
77
+ - lib/generated/gobl/bill/line_charge.rb
78
+ - lib/generated/gobl/bill/line_discount.rb
79
+ - lib/generated/gobl/bill/ordering.rb
80
+ - lib/generated/gobl/bill/outlay.rb
81
+ - lib/generated/gobl/bill/payment.rb
82
+ - lib/generated/gobl/bill/preceding.rb
83
+ - lib/generated/gobl/bill/tax.rb
84
+ - lib/generated/gobl/bill/totals.rb
85
+ - lib/generated/gobl/cal/date.rb
86
+ - lib/generated/gobl/cal/period.rb
87
+ - lib/generated/gobl/cbc/code.rb
88
+ - lib/generated/gobl/cbc/key.rb
89
+ - lib/generated/gobl/cbc/meta.rb
90
+ - lib/generated/gobl/cbc/note.rb
91
+ - lib/generated/gobl/cbc/stamp.rb
92
+ - lib/generated/gobl/currency/code.rb
93
+ - lib/generated/gobl/currency/exchange_rate.rb
94
+ - lib/generated/gobl/document.rb
95
+ - lib/generated/gobl/dsig/digest.rb
96
+ - lib/generated/gobl/dsig/signature.rb
97
+ - lib/generated/gobl/envelope.rb
98
+ - lib/generated/gobl/header.rb
99
+ - lib/generated/gobl/i18n/string.rb
100
+ - lib/generated/gobl/l10n/code.rb
101
+ - lib/generated/gobl/l10n/country_code.rb
102
+ - lib/generated/gobl/note/message.rb
103
+ - lib/generated/gobl/org/address.rb
104
+ - lib/generated/gobl/org/coordinates.rb
105
+ - lib/generated/gobl/org/email.rb
106
+ - lib/generated/gobl/org/identity.rb
107
+ - lib/generated/gobl/org/image.rb
108
+ - lib/generated/gobl/org/inbox.rb
109
+ - lib/generated/gobl/org/item.rb
110
+ - lib/generated/gobl/org/name.rb
111
+ - lib/generated/gobl/org/party.rb
112
+ - lib/generated/gobl/org/person.rb
113
+ - lib/generated/gobl/org/registration.rb
114
+ - lib/generated/gobl/org/telephone.rb
115
+ - lib/generated/gobl/org/unit.rb
116
+ - lib/generated/gobl/org/website.rb
117
+ - lib/generated/gobl/pay/advance.rb
118
+ - lib/generated/gobl/pay/card.rb
119
+ - lib/generated/gobl/pay/credit_transfer.rb
120
+ - lib/generated/gobl/pay/direct_debit.rb
121
+ - lib/generated/gobl/pay/due_date.rb
122
+ - lib/generated/gobl/pay/instructions.rb
123
+ - lib/generated/gobl/pay/online.rb
124
+ - lib/generated/gobl/pay/terms.rb
125
+ - lib/generated/gobl/tax/category.rb
126
+ - lib/generated/gobl/tax/category_total.rb
127
+ - lib/generated/gobl/tax/combo.rb
128
+ - lib/generated/gobl/tax/identity.rb
129
+ - lib/generated/gobl/tax/key_definition.rb
130
+ - lib/generated/gobl/tax/preceding_definitions.rb
131
+ - lib/generated/gobl/tax/rate.rb
132
+ - lib/generated/gobl/tax/rate_total.rb
133
+ - lib/generated/gobl/tax/rate_total_surcharge.rb
134
+ - lib/generated/gobl/tax/rate_value.rb
135
+ - lib/generated/gobl/tax/regime.rb
136
+ - lib/generated/gobl/tax/scenario.rb
137
+ - lib/generated/gobl/tax/scenario_set.rb
138
+ - lib/generated/gobl/tax/set.rb
139
+ - lib/generated/gobl/tax/tag.rb
140
+ - lib/generated/gobl/tax/total.rb
141
+ - lib/generated/gobl/tax/zone.rb
142
+ - lib/generated/gobl/uuid/uuid.rb
71
143
  - lib/gobl.rb
72
- - lib/gobl/bill/charge.rb
73
- - lib/gobl/bill/delivery.rb
74
- - lib/gobl/bill/discount.rb
75
- - lib/gobl/bill/document_reference.rb
76
- - lib/gobl/bill/invoice.rb
77
- - lib/gobl/bill/line.rb
78
- - lib/gobl/bill/line_charge.rb
79
- - lib/gobl/bill/line_discount.rb
80
- - lib/gobl/bill/ordering.rb
81
- - lib/gobl/bill/outlay.rb
82
- - lib/gobl/bill/payment.rb
83
- - lib/gobl/bill/preceding.rb
84
- - lib/gobl/bill/tax.rb
85
- - lib/gobl/bill/totals.rb
86
- - lib/gobl/cal/date.rb
87
- - lib/gobl/cal/period.rb
88
- - lib/gobl/cbc/code.rb
89
- - lib/gobl/cbc/key.rb
90
- - lib/gobl/cbc/meta.rb
91
- - lib/gobl/cbc/note.rb
92
- - lib/gobl/cbc/stamp.rb
93
144
  - lib/gobl/config.rb
94
- - lib/gobl/currency/code.rb
95
- - lib/gobl/currency/exchange_rate.rb
96
- - lib/gobl/document.rb
97
- - lib/gobl/dsig/digest.rb
98
- - lib/gobl/dsig/signature.rb
99
145
  - lib/gobl/enum.rb
100
- - lib/gobl/envelope.rb
101
146
  - lib/gobl/extensions/document_helper.rb
102
147
  - lib/gobl/extensions/envelope_helper.rb
103
148
  - lib/gobl/extensions/i18n/value_keys_helper.rb
104
149
  - lib/gobl/extensions/tax/regime_helper.rb
105
- - lib/gobl/header.rb
106
- - lib/gobl/i18n/string.rb
107
150
  - lib/gobl/id.rb
108
- - lib/gobl/l10n/code.rb
109
- - lib/gobl/l10n/country_code.rb
110
151
  - lib/gobl/map.rb
111
- - lib/gobl/note/message.rb
112
152
  - lib/gobl/num/amount.rb
113
153
  - lib/gobl/num/percentage.rb
114
154
  - lib/gobl/object.rb
115
155
  - lib/gobl/operations.rb
116
156
  - lib/gobl/operations/service_error.rb
117
157
  - lib/gobl/operations/validation_result.rb
118
- - lib/gobl/org/address.rb
119
- - lib/gobl/org/coordinates.rb
120
- - lib/gobl/org/email.rb
121
- - lib/gobl/org/identity.rb
122
- - lib/gobl/org/image.rb
123
- - lib/gobl/org/inbox.rb
124
- - lib/gobl/org/item.rb
125
- - lib/gobl/org/name.rb
126
- - lib/gobl/org/party.rb
127
- - lib/gobl/org/person.rb
128
- - lib/gobl/org/registration.rb
129
- - lib/gobl/org/telephone.rb
130
- - lib/gobl/org/unit.rb
131
- - lib/gobl/org/website.rb
132
- - lib/gobl/pay/advance.rb
133
- - lib/gobl/pay/card.rb
134
- - lib/gobl/pay/credit_transfer.rb
135
- - lib/gobl/pay/direct_debit.rb
136
- - lib/gobl/pay/due_date.rb
137
- - lib/gobl/pay/instructions.rb
138
- - lib/gobl/pay/online.rb
139
- - lib/gobl/pay/terms.rb
140
158
  - lib/gobl/struct.rb
141
- - lib/gobl/tax/category.rb
142
- - lib/gobl/tax/category_total.rb
143
- - lib/gobl/tax/combo.rb
144
- - lib/gobl/tax/identity.rb
145
- - lib/gobl/tax/key_definition.rb
146
- - lib/gobl/tax/preceding_definitions.rb
147
- - lib/gobl/tax/rate.rb
148
- - lib/gobl/tax/rate_total.rb
149
- - lib/gobl/tax/rate_total_surcharge.rb
150
- - lib/gobl/tax/rate_value.rb
151
- - lib/gobl/tax/regime.rb
152
- - lib/gobl/tax/scenario.rb
153
- - lib/gobl/tax/scenario_set.rb
154
- - lib/gobl/tax/set.rb
155
- - lib/gobl/tax/tag.rb
156
- - lib/gobl/tax/total.rb
157
- - lib/gobl/tax/zone.rb
158
- - lib/gobl/uuid/uuid.rb
159
159
  - lib/gobl/version.rb
160
160
  homepage: https://github.com/invopop/gobl.ruby
161
161
  licenses:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes