fixy 0.0.7 → 0.0.8
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/CHANGELOG.md +4 -0
- data/lib/fixy/formatter/alphanumeric.rb +1 -1
- data/lib/fixy/version.rb +1 -1
- data/spec/fixy/record_spec.rb +17 -0
- 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: 6e07746c49b92817445207fc85916f5e647852b6
|
4
|
+
data.tar.gz: 60dfdc9542fa68975f597e1cc583cb66b55acecc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29d42d758cc2bfba96cf64fbf6a1fe2190d5c40348863b0d887dc1ec1521abc1080c116b5202d9b4361108d0050366e88013b4e71870f0fcf131278a46776a06
|
7
|
+
data.tar.gz: c6b902cc25409fbf0a340464d36e30207fe3f8de30d6c366cfcee3111bc1efeb1adc4abbde84acc769dd2e39a4e4fc2f3fa24be524679a2f66ef716af18ad4ae
|
data/CHANGELOG.md
CHANGED
@@ -10,7 +10,7 @@ module Fixy
|
|
10
10
|
#
|
11
11
|
|
12
12
|
def format_alphanumeric(input, byte_width)
|
13
|
-
input_string = String.new(input.to_s)
|
13
|
+
input_string = String.new(input.to_s).tr "#{self.class::LINE_ENDING_CRLF}#{line_ending}", ''
|
14
14
|
result = ''
|
15
15
|
|
16
16
|
if input_string.bytesize <= byte_width
|
data/lib/fixy/version.rb
CHANGED
data/spec/fixy/record_spec.rb
CHANGED
@@ -120,6 +120,23 @@ describe 'Generating a Record' do
|
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
123
|
+
context 'when a field value contains the record separator' do
|
124
|
+
it 'should strip that separator' do
|
125
|
+
class PersonRecordNewLine < Fixy::Record
|
126
|
+
include Fixy::Formatter::Alphanumeric
|
127
|
+
|
128
|
+
set_record_length 9
|
129
|
+
|
130
|
+
field :name, 9, '1-9' , :alphanumeric
|
131
|
+
|
132
|
+
field_value :name, -> { "Two\nLine" }
|
133
|
+
end
|
134
|
+
|
135
|
+
value = PersonRecordNewLine.new.generate
|
136
|
+
value.should == "TwoLine \n"
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
123
140
|
context 'when definition is incomplete (e.g. undefined columns)' do
|
124
141
|
it 'should raise an error' do
|
125
142
|
class PersonRecordF < Fixy::Record
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fixy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Omar Skalli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|