madeline 0.1.3 → 0.1.4
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.
- data/Rakefile +1 -1
- data/lib/madeline.rb +1 -1
- data/lib/madeline/interface.rb +6 -1
- data/madeline.gemspec +1 -1
- data/test/madeline_test.rb +6 -0
- metadata +1 -1
data/Rakefile
CHANGED
@@ -4,7 +4,7 @@ require 'echoe'
|
|
4
4
|
require 'rake/testtask'
|
5
5
|
require 'rake/rdoctask'
|
6
6
|
|
7
|
-
Echoe.new('madeline','0.1.
|
7
|
+
Echoe.new('madeline','0.1.4') do |p|
|
8
8
|
p.description = "Interface to Madeline2"
|
9
9
|
p.url = "http://github.com/dmauldin/madeline"
|
10
10
|
p.author = "Denise Mauldin"
|
data/lib/madeline.rb
CHANGED
data/lib/madeline/interface.rb
CHANGED
@@ -54,7 +54,12 @@ module Madeline
|
|
54
54
|
warnings.push(line.match(/Warning:.*/)[0]) if line.match(/Warning:/)
|
55
55
|
end
|
56
56
|
warn = warnings.join("; ")
|
57
|
-
|
57
|
+
if block_given? then
|
58
|
+
f = File.new(filename)
|
59
|
+
contents = f.read
|
60
|
+
File.delete(filename)
|
61
|
+
yield(StringIO.new(contents), warn)
|
62
|
+
end
|
58
63
|
return filename, warn
|
59
64
|
end
|
60
65
|
|
data/madeline.gemspec
CHANGED
data/test/madeline_test.rb
CHANGED
@@ -17,6 +17,7 @@ class MadelineTest < Test::Unit::TestCase
|
|
17
17
|
pedigree_file, warnings = artist.draw(File.open('test/pedigree.txt','r'))
|
18
18
|
pedigree = File.read(pedigree_file)
|
19
19
|
assert_equal(@@fixtures["pedigree"], pedigree)
|
20
|
+
File.delete(pedigree_file)
|
20
21
|
end
|
21
22
|
|
22
23
|
def test_madeline_location
|
@@ -24,6 +25,7 @@ class MadelineTest < Test::Unit::TestCase
|
|
24
25
|
pedigree_file, warnings = artist.draw(File.open('test/pedigree.txt','r'))
|
25
26
|
pedigree = File.read(pedigree_file)
|
26
27
|
assert_equal(@@fixtures["pedigree"], pedigree)
|
28
|
+
File.delete(pedigree_file)
|
27
29
|
end
|
28
30
|
|
29
31
|
def test_bad_madeline_location
|
@@ -38,6 +40,7 @@ class MadelineTest < Test::Unit::TestCase
|
|
38
40
|
pedigree_file, warnings = artist.draw(File.open('test/pedigree.txt','r'))
|
39
41
|
pedigree = File.read(pedigree_file)
|
40
42
|
assert_equal(@@fixtures["arial_out"], pedigree)
|
43
|
+
File.delete(pedigree_file)
|
41
44
|
end
|
42
45
|
|
43
46
|
def test_embedded
|
@@ -45,6 +48,7 @@ class MadelineTest < Test::Unit::TestCase
|
|
45
48
|
pedigree_file, warnings = artist.draw(File.open('test/pedigree.txt','r'))
|
46
49
|
pedigree = File.read(pedigree_file)
|
47
50
|
assert_equal(@@fixtures["embedded_out"], pedigree)
|
51
|
+
File.delete(pedigree_file)
|
48
52
|
end
|
49
53
|
|
50
54
|
def test_bad_file_location
|
@@ -59,6 +63,7 @@ class MadelineTest < Test::Unit::TestCase
|
|
59
63
|
pedigree_file, warnings = artist.draw(File.open('test/labels.txt','r'))
|
60
64
|
pedigree = File.read(pedigree_file)
|
61
65
|
assert_equal(@@fixtures["single_label_out"], pedigree)
|
66
|
+
File.delete(pedigree_file)
|
62
67
|
end
|
63
68
|
|
64
69
|
def test_multiple_labels
|
@@ -66,6 +71,7 @@ class MadelineTest < Test::Unit::TestCase
|
|
66
71
|
pedigree_file, warnings = artist.draw(File.open('test/labels.txt','r'))
|
67
72
|
pedigree = File.read(pedigree_file)
|
68
73
|
assert_equal(@@fixtures["label_out"], pedigree)
|
74
|
+
File.delete(pedigree_file)
|
69
75
|
end
|
70
76
|
|
71
77
|
def test_block
|