dyi 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dyi.rb +1 -1
- data/lib/dyi/canvas.rb +1 -2
- data/lib/dyi/script/simple_script.rb +11 -0
- metadata +4 -4
data/lib/dyi.rb
CHANGED
data/lib/dyi/canvas.rb
CHANGED
@@ -163,8 +163,7 @@ module DYI #:nodoc:
|
|
163
163
|
# @since 1.0.0
|
164
164
|
def add_initialize_script(script_body)
|
165
165
|
if @init_script
|
166
|
-
@init_script
|
167
|
-
@init_script.instance_variable_get(:@body) + script_body, 'init')
|
166
|
+
@init_script.append_body(script_body)
|
168
167
|
else
|
169
168
|
@init_script = Script::EcmaScript::EventListener.new(script_body, 'init')
|
170
169
|
add_event_listener(:load, @init_script)
|
@@ -57,6 +57,17 @@ module DYI
|
|
57
57
|
false
|
58
58
|
end
|
59
59
|
|
60
|
+
# Appends script.
|
61
|
+
# @param [String] script_body body of client scripting that is appended
|
62
|
+
# @since 1.0.2
|
63
|
+
def append_body(script_body)
|
64
|
+
if @body.to_s[-1,1] == "\n"
|
65
|
+
@body += script_body
|
66
|
+
else
|
67
|
+
@body = [@body, "\n", script_body].join
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
60
71
|
# Writes the buffer contents of the object.
|
61
72
|
# @param [Formatter::Base] a formatter for export
|
62
73
|
# @param [IO] io a buffer that is written
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dyi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 2
|
10
|
+
version: 1.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Yuo
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-09-
|
18
|
+
date: 2011-09-30 00:00:00 Z
|
19
19
|
dependencies: []
|
20
20
|
|
21
21
|
description: " DYI is a 2D graphics library, very rich and expressive.\n DYI have been optimized for SVG format, but it is also possible\n to output other format; for example, EPS.\n"
|