jsgoecke-echi_files 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +12 -0
- data/echi_files.gemspec +9 -2
- data/lib/echi_files.rb +10 -6
- data/test/proper_ascii.yml +1044 -0
- data/test/proper_stripped.yml +105799 -0
- data/test/proper_unstripped.yml +52900 -0
- data/test/test_echi_files.rb +53 -0
- metadata +8 -1
data/History.txt
ADDED
data/echi_files.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "echi_files"
|
3
|
-
s.version = "0.
|
3
|
+
s.version = "0.2.0"
|
4
4
|
s.date = "2009-01-19"
|
5
5
|
s.summary = "Ruby Library for Processing Avaya ECHI Files"
|
6
6
|
s.description = "Ruby Library for processing External Call History (ECHI) files from the Avaya CMS"
|
@@ -12,7 +12,14 @@ Gem::Specification.new do |s|
|
|
12
12
|
|
13
13
|
s.files = ["lib/echi_files.rb",
|
14
14
|
"lib/extended-definition.yml",
|
15
|
-
"lib/standard-definition.yml",
|
15
|
+
"lib/standard-definition.yml",
|
16
|
+
"test/example_ascii_file",
|
17
|
+
"test/example_binary_file",
|
18
|
+
"test/proper_ascii.yml",
|
19
|
+
"test/proper_stripped.yml",
|
20
|
+
"test/proper_unstripped.yml",
|
21
|
+
"test/test_echi_files.rb",
|
22
|
+
"History.txt",
|
16
23
|
"LICENSE",
|
17
24
|
"README.textile",
|
18
25
|
"echi_files.gemspec"]
|
data/lib/echi_files.rb
CHANGED
@@ -27,7 +27,6 @@ class EchiFiles
|
|
27
27
|
case length
|
28
28
|
when 4
|
29
29
|
value = filehandle.read(length).unpack("l").first.to_i
|
30
|
-
puts value.inspect
|
31
30
|
value = Time.at(value)
|
32
31
|
end
|
33
32
|
#Process strings
|
@@ -168,13 +167,18 @@ class EchiFiles
|
|
168
167
|
|
169
168
|
#Method used to strip special characters
|
170
169
|
#@data An Array of Hashes to be processed
|
171
|
-
#@
|
172
|
-
|
173
|
-
|
170
|
+
#@fields An array of fields to strip characters from
|
171
|
+
#@characters An Array of characters to be stripped
|
172
|
+
def strip_special_characters(data, fields, characters)
|
173
|
+
|
174
174
|
stripped_data = Array.new
|
175
175
|
data.each do |row|
|
176
|
-
|
177
|
-
row[
|
176
|
+
fields.each do |field|
|
177
|
+
if field == row[0]
|
178
|
+
characters.each do |character|
|
179
|
+
row[1].gsub!(character.chr, "")
|
180
|
+
end
|
181
|
+
end
|
178
182
|
end
|
179
183
|
stripped_data << row
|
180
184
|
end
|