rasem 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/rasem/application.rb +1 -1
- data/spec/rasem_spec.rb +31 -0
- metadata +10 -10
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.1
|
data/lib/rasem/application.rb
CHANGED
@@ -19,7 +19,7 @@ class Rasem::Application
|
|
19
19
|
end
|
20
20
|
img = Rasem::SVGImage.new("100%", "100%") do
|
21
21
|
begin
|
22
|
-
|
22
|
+
eval(File.read(File.expand_path(source_file)), binding, source_file, 1)
|
23
23
|
rescue Exception => e
|
24
24
|
# Keep the portion of stack trace that belongs to the .rasem file
|
25
25
|
backtrace = e.backtrace.grep(Regexp.new(File.expand_path(source_file)))
|
data/spec/rasem_spec.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
require 'tempfile'
|
2
3
|
|
3
4
|
describe Rasem::SVGImage do
|
4
5
|
it "should initialize an empty image" do
|
@@ -298,4 +299,34 @@ describe Rasem::SVGImage do
|
|
298
299
|
str.should =~ %r{font-size="24"}
|
299
300
|
end
|
300
301
|
|
302
|
+
it "should generate an image out of a .rasem file" do
|
303
|
+
rasem_file = Tempfile.new("temp.rasem")
|
304
|
+
rasem_file.puts "circle 50, 50, 50"
|
305
|
+
rasem_file.close
|
306
|
+
|
307
|
+
File.should_not be_exists(rasem_file.path+".svg")
|
308
|
+
Rasem::Application.run!(rasem_file.path)
|
309
|
+
|
310
|
+
File.should be_exists(rasem_file.path+".svg")
|
311
|
+
end
|
312
|
+
|
313
|
+
it "should raise an exception for a malformed .rasem file" do
|
314
|
+
rasem_file = Tempfile.new("temp.rasem")
|
315
|
+
rasem_file.puts "@x.asdf"
|
316
|
+
rasem_file.close
|
317
|
+
|
318
|
+
lambda { Rasem::Application.run!(rasem_file.path) }.should raise_error
|
319
|
+
end
|
320
|
+
|
321
|
+
it "should generate only the portion of backtrace in .rasem file" do
|
322
|
+
rasem_file = Tempfile.new("temp.rasem")
|
323
|
+
rasem_file.puts "@x.asdf"
|
324
|
+
rasem_file.close
|
325
|
+
|
326
|
+
begin
|
327
|
+
Rasem::Application.run!(rasem_file.path)
|
328
|
+
rescue Exception => e
|
329
|
+
e.backtrace.should have(1).lines
|
330
|
+
end
|
331
|
+
end
|
301
332
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rasem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ default_executable: rasem
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|
17
|
-
requirement: &
|
17
|
+
requirement: &13619364 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: 2.3.0
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *13619364
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: bundler
|
28
|
-
requirement: &
|
28
|
+
requirement: &13617108 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: 1.0.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *13617108
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: jeweler
|
39
|
-
requirement: &
|
39
|
+
requirement: &13616784 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ~>
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: 1.5.2
|
45
45
|
type: :development
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *13616784
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: rcov
|
50
|
-
requirement: &
|
50
|
+
requirement: &13616496 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
@@ -55,7 +55,7 @@ dependencies:
|
|
55
55
|
version: '0'
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *13616496
|
59
59
|
description: ! " This gem allows you to describe your images using ruby code.\n You
|
60
60
|
can use rasem to draw complex images using small portions of ruby code\n"
|
61
61
|
email: eldawy@cs.umn.edu
|
@@ -95,7 +95,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
95
95
|
version: '0'
|
96
96
|
segments:
|
97
97
|
- 0
|
98
|
-
hash:
|
98
|
+
hash: 31176897
|
99
99
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
100
|
none: false
|
101
101
|
requirements:
|