sie 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/sie/document.rb +2 -2
- data/lib/sie/parser/tokenizer.rb +2 -2
- data/lib/sie/version.rb +1 -1
- data/spec/unit/document_spec.rb +6 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2be3aa3c55bea68bf2195976db05d4364a057143
|
4
|
+
data.tar.gz: 9590de3fac93d328cbd90b95ae411deafbed7ba0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5742310f4a4c1fdbdd0b482fe86af38ce64be2e3d106bf8c7aa7b0567bf0e32b3534bdef35f02243c49bf7fa98e7732ea75a2f9e320303892dd8685e21e699d7
|
7
|
+
data.tar.gz: cbc0d7039a975f40863839dabd8247b03b37144428b8dc6171651a20fec05ae89e7df82ad4b8e68863d5bbb106c17a4ff268b2bfbffe91cd66679d699aa37b55
|
data/lib/sie/document.rb
CHANGED
@@ -6,7 +6,7 @@ require "active_support/core_ext/module/delegation"
|
|
6
6
|
module Sie
|
7
7
|
class Document
|
8
8
|
# Because fortnox imposes these limits
|
9
|
-
DESCRIPTION_LENGTH_MAX =
|
9
|
+
DESCRIPTION_LENGTH_MAX = 200
|
10
10
|
|
11
11
|
pattr_initialize :data_source
|
12
12
|
|
@@ -111,7 +111,7 @@ module Sie
|
|
111
111
|
amount = line.fetch(:amount)
|
112
112
|
booked_on = line.fetch(:booked_on)
|
113
113
|
dimensions = line.fetch(:dimensions, {}).flatten
|
114
|
-
# Some SIE-importers (fortnox) cannot handle descriptions longer than
|
114
|
+
# Some SIE-importers (fortnox) cannot handle descriptions longer than 200 characters,
|
115
115
|
# but the specification has no limit.
|
116
116
|
description = line.fetch(:description).slice(0, DESCRIPTION_LENGTH_MAX)
|
117
117
|
|
data/lib/sie/parser/tokenizer.rb
CHANGED
@@ -67,7 +67,7 @@ module Sie
|
|
67
67
|
match = find_quoted_string || find_unquoted_string
|
68
68
|
|
69
69
|
if match
|
70
|
-
|
70
|
+
remove_unnecessary_escapes(match)
|
71
71
|
else
|
72
72
|
nil
|
73
73
|
end
|
@@ -91,7 +91,7 @@ module Sie
|
|
91
91
|
scanner.scan(/\S+/)
|
92
92
|
end
|
93
93
|
|
94
|
-
def
|
94
|
+
def remove_unnecessary_escapes(match)
|
95
95
|
match.gsub(/\\([\\"])/, "\\1")
|
96
96
|
end
|
97
97
|
|
data/lib/sie/version.rb
CHANGED
data/spec/unit/document_spec.rb
CHANGED
@@ -202,15 +202,15 @@ describe Sie::Document, "#render" do
|
|
202
202
|
context "with really long descriptions" do
|
203
203
|
let(:accounts) {
|
204
204
|
[
|
205
|
-
number: 1500, description: "Customer ledger with really really long description
|
205
|
+
number: 1500, description: "Customer ledger with really really long description. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut. Truncated"
|
206
206
|
]
|
207
207
|
}
|
208
208
|
let(:vouchers) {
|
209
209
|
[
|
210
210
|
build_voucher(
|
211
|
-
description: "Payout 1 with really really long description
|
211
|
+
description: "Payout 1 with really really long description. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi e. Truncated",
|
212
212
|
voucher_lines: [
|
213
|
-
build_voucher_line(description: "Payout line 1 with really really long description
|
213
|
+
build_voucher_line(description: "Payout line 1 with really really long description. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wi. Truncated"),
|
214
214
|
build_voucher_line(description: "Payout line 2"),
|
215
215
|
]
|
216
216
|
)
|
@@ -218,9 +218,9 @@ describe Sie::Document, "#render" do
|
|
218
218
|
}
|
219
219
|
|
220
220
|
it "truncates the descriptions" do
|
221
|
-
expect(indexed_entry_attributes("konto", 0)).to eq("kontonr" => "1500", "kontonamn" => "Customer ledger with really
|
222
|
-
expect(indexed_entry("ver", 0).attributes["vertext"]).to eq("Payout 1 with really really
|
223
|
-
expect(indexed_voucher_entries(0)[0].attributes["transtext"]).to eq("Payout line 1 with really
|
221
|
+
expect(indexed_entry_attributes("konto", 0)).to eq("kontonr" => "1500", "kontonamn" => "Customer ledger with really really long description. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut")
|
222
|
+
expect(indexed_entry("ver", 0).attributes["vertext"]).to eq("Payout 1 with really really long description. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi e")
|
223
|
+
expect(indexed_voucher_entries(0)[0].attributes["transtext"]).to eq("Payout line 1 with really really long description. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut w")
|
224
224
|
end
|
225
225
|
end
|
226
226
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Barsoom AB
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: attr_extras
|