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 CHANGED
@@ -1 +1 @@
1
- 0.6.0
1
+ 0.6.1
@@ -19,7 +19,7 @@ class Rasem::Application
19
19
  end
20
20
  img = Rasem::SVGImage.new("100%", "100%") do
21
21
  begin
22
- load File.expand_path(source_file)
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)))
@@ -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.0
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: &13580532 !ruby/object:Gem::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: *13580532
25
+ version_requirements: *13619364
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: bundler
28
- requirement: &13578168 !ruby/object:Gem::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: *13578168
36
+ version_requirements: *13617108
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: jeweler
39
- requirement: &13577844 !ruby/object:Gem::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: *13577844
47
+ version_requirements: *13616784
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: rcov
50
- requirement: &13577544 !ruby/object:Gem::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: *13577544
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: -491594989
98
+ hash: 31176897
99
99
  required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  none: false
101
101
  requirements: