rasem 0.6.1 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +3 -4
- data/LICENSE.txt +2 -0
- data/README.rdoc +108 -16
- data/Rakefile +5 -7
- data/VERSION +1 -1
- data/bin/rasem +0 -0
- data/lib/rasem.rb +1 -0
- data/lib/rasem/application.rb +10 -11
- data/lib/rasem/download_documentation.rb +77 -0
- data/lib/rasem/svg_documentation.rb +5334 -0
- data/lib/rasem/svg_image.rb +689 -161
- data/spec/defs_spec.rb +103 -0
- data/spec/gradient_spec.rb +53 -0
- data/spec/path_spec.rb +227 -0
- data/spec/rasem_spec.rb +324 -116
- data/spec/spec_helper.rb +13 -0
- data/spec/transform_spec.rb +112 -0
- metadata +43 -46
data/spec/spec_helper.rb
CHANGED
@@ -2,6 +2,8 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
2
2
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
3
|
require 'rspec'
|
4
4
|
require 'rasem'
|
5
|
+
require 'simplecov'
|
6
|
+
SimpleCov.start
|
5
7
|
|
6
8
|
# Requires supporting files with custom matchers and macros, etc,
|
7
9
|
# in ./support/ and its subdirectories.
|
@@ -10,3 +12,14 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
|
10
12
|
RSpec.configure do |config|
|
11
13
|
|
12
14
|
end
|
15
|
+
|
16
|
+
|
17
|
+
def class_hierarchy(obj)
|
18
|
+
classes = []
|
19
|
+
c = obj.class
|
20
|
+
while c != Object
|
21
|
+
classes << c
|
22
|
+
c = c.superclass
|
23
|
+
end
|
24
|
+
classes
|
25
|
+
end
|
@@ -0,0 +1,112 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe Rasem::SVGTag do
|
4
|
+
|
5
|
+
it "should maintain compatibility with transformations given in attributes" do
|
6
|
+
tag = Rasem::SVGTag.new("g", :translate => [5, 5], :scale => 2)
|
7
|
+
tag.translate(10, 10)
|
8
|
+
|
9
|
+
tag.to_s.should =~ %r{.*transform=\"translate\(5\s*,5\)\s*scale\(2\)\s*translate\(10,\s*10\)}
|
10
|
+
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should add a translate transformation" do
|
14
|
+
tag = Rasem::SVGTag.new("g")
|
15
|
+
tag.translate(10, 10)
|
16
|
+
|
17
|
+
tag.to_s.should =~ %r{.*transform=\"translate\(10,\s*10\)}
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should return the instance after translate call" do
|
21
|
+
tag = Rasem::SVGTag.new("g")
|
22
|
+
tag.translate(10, 10).should == tag
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
it "should add a scale transformation" do
|
27
|
+
tag = Rasem::SVGTag.new("g")
|
28
|
+
tag.scale(10, 10)
|
29
|
+
|
30
|
+
tag.to_s.should =~ %r{.*transform=\"scale\(10,\s*10\)}
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should return the instance after scale call" do
|
34
|
+
tag = Rasem::SVGTag.new("g")
|
35
|
+
tag.scale(10, 10).should == tag
|
36
|
+
end
|
37
|
+
|
38
|
+
|
39
|
+
it "should add a rotate transformation" do
|
40
|
+
tag = Rasem::SVGTag.new("g")
|
41
|
+
tag.rotate(45, 0, 0)
|
42
|
+
|
43
|
+
tag.to_s.should =~ %r{.*transform=\"rotate\(45,\s*0,\s*0\)}
|
44
|
+
end
|
45
|
+
|
46
|
+
|
47
|
+
it "should only give angle for rotation unless both coordinate are specified" do
|
48
|
+
tag = Rasem::SVGTag.new("g")
|
49
|
+
|
50
|
+
tag.rotate(45, 0)
|
51
|
+
tag.to_s.should =~ %r{.*transform=\"rotate\(45\)}
|
52
|
+
|
53
|
+
tag.rotate(45)
|
54
|
+
tag.to_s.should =~ %r{.*transform=\"rotate\(45\)}
|
55
|
+
end
|
56
|
+
|
57
|
+
|
58
|
+
it "should return the instance after rotate call" do
|
59
|
+
tag = Rasem::SVGTag.new("g")
|
60
|
+
tag.rotate(10, 10).should == tag
|
61
|
+
end
|
62
|
+
|
63
|
+
|
64
|
+
it "should add a skewX transformation" do
|
65
|
+
tag = Rasem::SVGTag.new("g")
|
66
|
+
tag.skewX(45)
|
67
|
+
|
68
|
+
tag.to_s.should =~ %r{.*transform=\"skewX\(45\)}
|
69
|
+
end
|
70
|
+
|
71
|
+
it "should return the instance after skewX call" do
|
72
|
+
tag = Rasem::SVGTag.new("g")
|
73
|
+
tag.skewX(45).should == tag
|
74
|
+
end
|
75
|
+
|
76
|
+
|
77
|
+
it "should add a skewY transformation" do
|
78
|
+
tag = Rasem::SVGTag.new("g")
|
79
|
+
tag.skewY(45)
|
80
|
+
|
81
|
+
tag.to_s.should =~ %r{.*transform=\"skewY\(45\)}
|
82
|
+
end
|
83
|
+
|
84
|
+
it "should return the instance after skewY call" do
|
85
|
+
tag = Rasem::SVGTag.new("g")
|
86
|
+
tag.skewY(45).should == tag
|
87
|
+
end
|
88
|
+
|
89
|
+
|
90
|
+
it "should add a matrix transformation" do
|
91
|
+
tag = Rasem::SVGTag.new("g")
|
92
|
+
tag.matrix(1, 2, 3, 4, 5, 6)
|
93
|
+
|
94
|
+
tag.to_s.should =~ %r{.*transform=\"matrix\(1,\s*2,\s*3,\s*4,\s*5,\s*6\)}
|
95
|
+
end
|
96
|
+
|
97
|
+
it "should return the instance after matrix call" do
|
98
|
+
tag = Rasem::SVGTag.new("g")
|
99
|
+
tag.matrix(1, 2, 3, 4, 5, 6).should == tag
|
100
|
+
end
|
101
|
+
|
102
|
+
|
103
|
+
it "should combine transformation" do
|
104
|
+
tag = Rasem::SVGTag.new("g")
|
105
|
+
tag.translate(0, 0).scale(2, 1).rotate(45).skewX(3).skewY(4).matrix(1,1,1,1,1,1)
|
106
|
+
|
107
|
+
tag.to_s.should =~ %r{.*transform=\"translate\(0,\s*0\)\s*scale\(2,\s*1\)\s*rotate\(45\)\s*skewX\(3\)\s*skewY\(4\)\s*matrix\(1, 1, 1, 1, 1, 1\)}
|
108
|
+
end
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
end
|
metadata
CHANGED
@@ -1,63 +1,61 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rasem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.7.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Ahmed Eldawy
|
8
|
+
- Vytis Valentinavičius
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
default_executable: rasem
|
12
|
+
date: 2016-08-21 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: rspec
|
17
|
-
requirement:
|
18
|
-
none: false
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
19
17
|
requirements:
|
20
|
-
- - ~>
|
18
|
+
- - "~>"
|
21
19
|
- !ruby/object:Gem::Version
|
22
|
-
version: 2.
|
20
|
+
version: 2.10.0
|
23
21
|
type: :development
|
24
22
|
prerelease: false
|
25
|
-
version_requirements:
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
|
-
name: bundler
|
28
|
-
requirement: &13617108 !ruby/object:Gem::Requirement
|
29
|
-
none: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
24
|
requirements:
|
31
|
-
- - ~>
|
25
|
+
- - "~>"
|
32
26
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: *13617108
|
27
|
+
version: 2.10.0
|
37
28
|
- !ruby/object:Gem::Dependency
|
38
29
|
name: jeweler
|
39
|
-
requirement:
|
40
|
-
none: false
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
41
31
|
requirements:
|
42
|
-
- - ~>
|
32
|
+
- - "~>"
|
43
33
|
- !ruby/object:Gem::Version
|
44
|
-
version: 1.
|
34
|
+
version: 1.8.2
|
45
35
|
type: :development
|
46
36
|
prerelease: false
|
47
|
-
version_requirements:
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 1.8.2
|
48
42
|
- !ruby/object:Gem::Dependency
|
49
|
-
name:
|
50
|
-
requirement:
|
51
|
-
none: false
|
43
|
+
name: simplecov
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
52
45
|
requirements:
|
53
|
-
- -
|
46
|
+
- - "~>"
|
54
47
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
48
|
+
version: 0.6.4
|
56
49
|
type: :development
|
57
50
|
prerelease: false
|
58
|
-
version_requirements:
|
59
|
-
|
60
|
-
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "~>"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 0.6.4
|
56
|
+
description: |2
|
57
|
+
This gem allows you to describe your images using ruby code.
|
58
|
+
You can use rasem to draw complex images using small portions of ruby code
|
61
59
|
email: eldawy@cs.umn.edu
|
62
60
|
executables:
|
63
61
|
- rasem
|
@@ -66,8 +64,8 @@ extra_rdoc_files:
|
|
66
64
|
- LICENSE.txt
|
67
65
|
- README.rdoc
|
68
66
|
files:
|
69
|
-
- .document
|
70
|
-
- .rspec
|
67
|
+
- ".document"
|
68
|
+
- ".rspec"
|
71
69
|
- Gemfile
|
72
70
|
- LICENSE.txt
|
73
71
|
- README.rdoc
|
@@ -76,38 +74,37 @@ files:
|
|
76
74
|
- bin/rasem
|
77
75
|
- lib/rasem.rb
|
78
76
|
- lib/rasem/application.rb
|
77
|
+
- lib/rasem/download_documentation.rb
|
78
|
+
- lib/rasem/svg_documentation.rb
|
79
79
|
- lib/rasem/svg_image.rb
|
80
|
+
- spec/defs_spec.rb
|
81
|
+
- spec/gradient_spec.rb
|
82
|
+
- spec/path_spec.rb
|
80
83
|
- spec/rasem_spec.rb
|
81
84
|
- spec/spec_helper.rb
|
82
|
-
|
85
|
+
- spec/transform_spec.rb
|
83
86
|
homepage: http://github.com/aseldawy/rasem
|
84
87
|
licenses:
|
85
88
|
- MIT
|
89
|
+
metadata: {}
|
86
90
|
post_install_message:
|
87
91
|
rdoc_options: []
|
88
92
|
require_paths:
|
89
93
|
- lib
|
90
94
|
required_ruby_version: !ruby/object:Gem::Requirement
|
91
|
-
none: false
|
92
95
|
requirements:
|
93
|
-
- -
|
96
|
+
- - ">="
|
94
97
|
- !ruby/object:Gem::Version
|
95
98
|
version: '0'
|
96
|
-
segments:
|
97
|
-
- 0
|
98
|
-
hash: 31176897
|
99
99
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
|
-
none: false
|
101
100
|
requirements:
|
102
|
-
- -
|
101
|
+
- - ">="
|
103
102
|
- !ruby/object:Gem::Version
|
104
103
|
version: '0'
|
105
104
|
requirements: []
|
106
105
|
rubyforge_project:
|
107
|
-
rubygems_version:
|
106
|
+
rubygems_version: 2.5.1
|
108
107
|
signing_key:
|
109
|
-
specification_version:
|
108
|
+
specification_version: 4
|
110
109
|
summary: A gem to generate images from ruby files
|
111
|
-
test_files:
|
112
|
-
- spec/rasem_spec.rb
|
113
|
-
- spec/spec_helper.rb
|
110
|
+
test_files: []
|