eancom 0.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/.DS_Store +0 -0
  3. data/.gitignore +187 -6
  4. data/.gitlab-ci.yml +27 -0
  5. data/.rspec_status +225 -0
  6. data/.rubocop.yml +2 -0
  7. data/.ruby-version +1 -0
  8. data/Gemfile +4 -2
  9. data/Gemfile.lock +87 -3
  10. data/bin/console +3 -2
  11. data/definitions/desadv/d01b.rb +205 -0
  12. data/definitions/desadv/d96a.rb +108 -73
  13. data/definitions/segments/alc.rb +236 -0
  14. data/definitions/segments/ali.rb +93 -0
  15. data/definitions/segments/bgm.rb +267 -0
  16. data/definitions/segments/cav.rb +122 -0
  17. data/definitions/segments/cci.rb +136 -0
  18. data/definitions/segments/cnt.rb +78 -0
  19. data/definitions/segments/cps.rb +76 -0
  20. data/definitions/segments/cux.rb +167 -0
  21. data/definitions/segments/dtm.rb +159 -0
  22. data/definitions/segments/ftx.rb +143 -0
  23. data/definitions/segments/imd.rb +356 -0
  24. data/definitions/segments/lin.rb +113 -0
  25. data/definitions/segments/loc.rb +89 -0
  26. data/definitions/segments/mea.rb +189 -0
  27. data/definitions/segments/moa.rb +144 -0
  28. data/definitions/segments/nad.rb +254 -0
  29. data/definitions/segments/pac.rb +250 -0
  30. data/definitions/segments/pgi.rb +148 -0
  31. data/definitions/segments/pia.rb +501 -0
  32. data/definitions/segments/pri.rb +188 -0
  33. data/definitions/segments/qty.rb +79 -0
  34. data/definitions/segments/rff.rb +166 -0
  35. data/definitions/segments/tax.rb +259 -0
  36. data/definitions/segments/tdt.rb +254 -0
  37. data/definitions/segments/una.rb +85 -0
  38. data/definitions/segments/unb.rb +284 -0
  39. data/definitions/segments/unh.rb +118 -0
  40. data/definitions/segments/uns.rb +40 -0
  41. data/definitions/segments/unt.rb +48 -0
  42. data/definitions/segments/unz.rb +48 -0
  43. data/definitions/slsrpt/d01b.rb +201 -0
  44. data/definitions/slsrpt/d96a.rb +194 -0
  45. data/eancom.gemspec +9 -5
  46. data/lib/eancom/definition.rb +1 -1
  47. data/lib/eancom/edifact/body.rb +63 -0
  48. data/lib/eancom/edifact/composite.rb +38 -0
  49. data/lib/eancom/edifact/data.rb +108 -0
  50. data/lib/eancom/edifact/document.rb +43 -11
  51. data/lib/eancom/edifact/document_element.rb +26 -0
  52. data/lib/eancom/edifact/footer.rb +6 -0
  53. data/lib/eancom/edifact/header.rb +15 -0
  54. data/lib/eancom/edifact/item.rb +40 -0
  55. data/lib/eancom/edifact/message.rb +24 -16
  56. data/lib/eancom/edifact/segment.rb +131 -12
  57. data/lib/eancom/edifact/segments/alc.rb +61 -0
  58. data/lib/eancom/edifact/segments/ali.rb +52 -0
  59. data/lib/eancom/edifact/segments/bgm.rb +45 -0
  60. data/lib/eancom/edifact/segments/cav.rb +47 -0
  61. data/lib/eancom/edifact/segments/cci.rb +53 -0
  62. data/lib/eancom/edifact/segments/cnt.rb +33 -0
  63. data/lib/eancom/edifact/segments/cps.rb +30 -0
  64. data/lib/eancom/edifact/segments/cux.rb +60 -0
  65. data/lib/eancom/edifact/segments/dtm.rb +43 -0
  66. data/lib/eancom/edifact/segments/ftx.rb +63 -0
  67. data/lib/eancom/edifact/segments/imd.rb +69 -0
  68. data/lib/eancom/edifact/segments/lin.rb +43 -0
  69. data/lib/eancom/edifact/segments/loc.rb +43 -0
  70. data/lib/eancom/edifact/segments/mea.rb +53 -0
  71. data/lib/eancom/edifact/segments/moa.rb +45 -0
  72. data/lib/eancom/edifact/segments/nad.rb +107 -0
  73. data/lib/eancom/edifact/segments/pac.rb +54 -0
  74. data/lib/eancom/edifact/segments/pgi.rb +45 -0
  75. data/lib/eancom/edifact/segments/pia.rb +107 -0
  76. data/lib/eancom/edifact/segments/pri.rb +54 -0
  77. data/lib/eancom/edifact/segments/qty.rb +40 -0
  78. data/lib/eancom/edifact/segments/rff.rb +41 -0
  79. data/lib/eancom/edifact/segments/tax.rb +72 -0
  80. data/lib/eancom/edifact/segments/tdt.rb +54 -0
  81. data/lib/eancom/edifact/segments/una.rb +51 -0
  82. data/lib/eancom/edifact/segments/unb.rb +69 -0
  83. data/lib/eancom/edifact/segments/unh.rb +46 -0
  84. data/lib/eancom/edifact/segments/uns.rb +29 -0
  85. data/lib/eancom/edifact/segments/unt.rb +28 -0
  86. data/lib/eancom/edifact/segments/unz.rb +28 -0
  87. data/lib/eancom/edifact/structure.rb +91 -0
  88. data/lib/eancom/edifact.rb +45 -12
  89. data/lib/eancom/factory.rb +8 -7
  90. data/lib/eancom/parser/document.rb +68 -0
  91. data/lib/eancom/parser/segment.rb +71 -0
  92. data/lib/eancom/parser.rb +7 -0
  93. data/lib/eancom/version.rb +1 -1
  94. data/lib/eancom.rb +59 -16
  95. metadata +138 -5
  96. data/lib/eancom/edifact/element.rb +0 -16
  97. data/lib/eancom/edifact/envelope.rb +0 -24
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eancom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fadendaten GmbH
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-27 00:00:00.000000000 Z
11
+ date: 2022-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: pry-nav
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: pry-remote
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +53,35 @@ dependencies:
39
53
  - !ruby/object:Gem::Version
40
54
  version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
- name: pry-nav
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop
43
85
  requirement: !ruby/object:Gem::Requirement
44
86
  requirements:
45
87
  - - ">="
@@ -66,6 +108,20 @@ dependencies:
66
108
  - - ">="
67
109
  - !ruby/object:Gem::Version
68
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: timecop
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
69
125
  description:
70
126
  email:
71
127
  - support@fadendaten.ch
@@ -73,8 +129,13 @@ executables: []
73
129
  extensions: []
74
130
  extra_rdoc_files: []
75
131
  files:
132
+ - ".DS_Store"
76
133
  - ".gitignore"
134
+ - ".gitlab-ci.yml"
77
135
  - ".rspec"
136
+ - ".rspec_status"
137
+ - ".rubocop.yml"
138
+ - ".ruby-version"
78
139
  - ".travis.yml"
79
140
  - Gemfile
80
141
  - Gemfile.lock
@@ -83,17 +144,89 @@ files:
83
144
  - Rakefile
84
145
  - bin/console
85
146
  - bin/setup
147
+ - definitions/desadv/d01b.rb
86
148
  - definitions/desadv/d96a.rb
149
+ - definitions/segments/alc.rb
150
+ - definitions/segments/ali.rb
151
+ - definitions/segments/bgm.rb
152
+ - definitions/segments/cav.rb
153
+ - definitions/segments/cci.rb
154
+ - definitions/segments/cnt.rb
155
+ - definitions/segments/cps.rb
156
+ - definitions/segments/cux.rb
157
+ - definitions/segments/dtm.rb
158
+ - definitions/segments/ftx.rb
159
+ - definitions/segments/imd.rb
160
+ - definitions/segments/lin.rb
161
+ - definitions/segments/loc.rb
162
+ - definitions/segments/mea.rb
163
+ - definitions/segments/moa.rb
164
+ - definitions/segments/nad.rb
165
+ - definitions/segments/pac.rb
166
+ - definitions/segments/pgi.rb
167
+ - definitions/segments/pia.rb
168
+ - definitions/segments/pri.rb
169
+ - definitions/segments/qty.rb
170
+ - definitions/segments/rff.rb
171
+ - definitions/segments/tax.rb
172
+ - definitions/segments/tdt.rb
173
+ - definitions/segments/una.rb
174
+ - definitions/segments/unb.rb
175
+ - definitions/segments/unh.rb
176
+ - definitions/segments/uns.rb
177
+ - definitions/segments/unt.rb
178
+ - definitions/segments/unz.rb
179
+ - definitions/slsrpt/d01b.rb
180
+ - definitions/slsrpt/d96a.rb
87
181
  - eancom.gemspec
88
182
  - lib/eancom.rb
89
183
  - lib/eancom/definition.rb
90
184
  - lib/eancom/edifact.rb
185
+ - lib/eancom/edifact/body.rb
186
+ - lib/eancom/edifact/composite.rb
187
+ - lib/eancom/edifact/data.rb
91
188
  - lib/eancom/edifact/document.rb
92
- - lib/eancom/edifact/element.rb
93
- - lib/eancom/edifact/envelope.rb
189
+ - lib/eancom/edifact/document_element.rb
190
+ - lib/eancom/edifact/footer.rb
191
+ - lib/eancom/edifact/header.rb
192
+ - lib/eancom/edifact/item.rb
94
193
  - lib/eancom/edifact/message.rb
95
194
  - lib/eancom/edifact/segment.rb
195
+ - lib/eancom/edifact/segments/alc.rb
196
+ - lib/eancom/edifact/segments/ali.rb
197
+ - lib/eancom/edifact/segments/bgm.rb
198
+ - lib/eancom/edifact/segments/cav.rb
199
+ - lib/eancom/edifact/segments/cci.rb
200
+ - lib/eancom/edifact/segments/cnt.rb
201
+ - lib/eancom/edifact/segments/cps.rb
202
+ - lib/eancom/edifact/segments/cux.rb
203
+ - lib/eancom/edifact/segments/dtm.rb
204
+ - lib/eancom/edifact/segments/ftx.rb
205
+ - lib/eancom/edifact/segments/imd.rb
206
+ - lib/eancom/edifact/segments/lin.rb
207
+ - lib/eancom/edifact/segments/loc.rb
208
+ - lib/eancom/edifact/segments/mea.rb
209
+ - lib/eancom/edifact/segments/moa.rb
210
+ - lib/eancom/edifact/segments/nad.rb
211
+ - lib/eancom/edifact/segments/pac.rb
212
+ - lib/eancom/edifact/segments/pgi.rb
213
+ - lib/eancom/edifact/segments/pia.rb
214
+ - lib/eancom/edifact/segments/pri.rb
215
+ - lib/eancom/edifact/segments/qty.rb
216
+ - lib/eancom/edifact/segments/rff.rb
217
+ - lib/eancom/edifact/segments/tax.rb
218
+ - lib/eancom/edifact/segments/tdt.rb
219
+ - lib/eancom/edifact/segments/una.rb
220
+ - lib/eancom/edifact/segments/unb.rb
221
+ - lib/eancom/edifact/segments/unh.rb
222
+ - lib/eancom/edifact/segments/uns.rb
223
+ - lib/eancom/edifact/segments/unt.rb
224
+ - lib/eancom/edifact/segments/unz.rb
225
+ - lib/eancom/edifact/structure.rb
96
226
  - lib/eancom/factory.rb
227
+ - lib/eancom/parser.rb
228
+ - lib/eancom/parser/document.rb
229
+ - lib/eancom/parser/segment.rb
97
230
  - lib/eancom/version.rb
98
231
  homepage: https://fadendaten.ch
99
232
  licenses:
@@ -1,16 +0,0 @@
1
- module Eancom
2
- module Edifact
3
- class Element
4
-
5
- def segment(name = nil, &block)
6
- segment = Segment.new(name)
7
- yield(segment) if block
8
- add_segment(segment)
9
- end
10
-
11
- def add_segment(segment)
12
- raise NotImplementedError
13
- end
14
- end
15
- end
16
- end
@@ -1,24 +0,0 @@
1
- module Eancom
2
- module Edifact
3
- class Envelope < Element
4
-
5
- def initialize
6
- @segments = []
7
- end
8
-
9
- def add_segment(segment)
10
- @segments << segment
11
- end
12
-
13
- def to_s
14
- stream = ""
15
- @segments.each do |segment|
16
- stream << segment.to_s
17
- stream << DELIMITERS[:segment]
18
- end
19
- stream
20
- end
21
-
22
- end
23
- end
24
- end