sie 3.2.0 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 82618d146dcca7af3a358baa84ebabc1349d4e20
4
- data.tar.gz: cbaa13f1ca6a9eaeb7aa043635df08c25e7f127f
3
+ metadata.gz: 2be3aa3c55bea68bf2195976db05d4364a057143
4
+ data.tar.gz: 9590de3fac93d328cbd90b95ae411deafbed7ba0
5
5
  SHA512:
6
- metadata.gz: 0eb13e5a90a1437c06454f43a3e4d4397aa6010487241fe803c92e73fc9fc32fde59054ce762cfc73e09c1c88433eec048fe6d5851887f7c076cd7fb8bfe19ac
7
- data.tar.gz: e1bbfe37c0f369312b63bc55fcc9a9efe69566e8bb514384b4790a9743105eeab4aeb105343964510d97bc46130b07b21c561ab1d2a164ff58eda5d12e148635
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 = 30
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 30 characters,
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
 
@@ -67,7 +67,7 @@ module Sie
67
67
  match = find_quoted_string || find_unquoted_string
68
68
 
69
69
  if match
70
- remove_unnessesary_escapes(match)
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 remove_unnessesary_escapes(match)
94
+ def remove_unnecessary_escapes(match)
95
95
  match.gsub(/\\([\\"])/, "\\1")
96
96
  end
97
97
 
data/lib/sie/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Sie
2
2
  # For versioning see: http://semver.org/
3
- VERSION = "3.2.0"
3
+ VERSION = "3.3.0"
4
4
  end
@@ -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 blablabla"
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 blablabla",
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 blablabla"),
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 re")
222
- expect(indexed_entry("ver", 0).attributes["vertext"]).to eq("Payout 1 with really really lo")
223
- expect(indexed_voucher_entries(0)[0].attributes["transtext"]).to eq("Payout line 1 with really real")
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.2.0
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-10-27 00:00:00.000000000 Z
11
+ date: 2015-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: attr_extras