nitro 0.10.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +4 -1
- data/ChangeLog +290 -7
- data/README +3 -3
- data/RELEASES +94 -0
- data/Rakefile +7 -7
- data/benchmark/og/bench.rb +11 -10
- data/{ChangeLog.1 → doc/ChangeLog.1} +0 -0
- data/doc/apache.txt +9 -0
- data/doc/architecture.txt +1 -27
- data/doc/bugs.txt +11 -4
- data/doc/config.txt +22 -0
- data/doc/og_config.txt +35 -0
- data/doc/og_tutorial.txt +595 -0
- data/doc/tutorial.txt +22 -0
- data/examples/blog/conf/apache.conf +30 -0
- data/examples/blog/conf/lhttpd.conf +2 -2
- data/examples/blog/lib/blog/controller.rb +11 -2
- data/examples/blog/log/apache.error_log +5528 -0
- data/examples/blog/root/fcgi.rb +1 -1
- data/examples/blog/run.rb +9 -3
- data/examples/flash/run.rb +2 -2
- data/examples/no_xsl_blog/conf/apache.conf +30 -0
- data/examples/no_xsl_blog/conf/lhttpd.conf +1 -1
- data/examples/no_xsl_blog/lib/blog/controller.rb +2 -2
- data/examples/no_xsl_blog/log/apache.error_log +68 -0
- data/examples/no_xsl_blog/root/fcgi.rb +2 -2
- data/examples/no_xsl_blog/run.rb +3 -3
- data/examples/og/run.rb +1 -1
- data/examples/tiny/conf/apache.conf +29 -4
- data/examples/tiny/conf/lhttpd.conf +1 -1
- data/examples/tiny/log/apache.error_log +30 -0
- data/examples/tiny/root/fcgi.rb +2 -2
- data/examples/tiny/root/index.xhtml +1 -1
- data/examples/tiny/run.rb +3 -2
- data/examples/wee_style/run.rb +7 -9
- data/examples/why_wiki/README +5 -0
- data/examples/why_wiki/run.rb +57 -0
- data/examples/why_wiki/wiki.yml +6 -0
- data/examples/wiki.yml +1 -0
- data/lib/glue/array.rb +14 -33
- data/lib/glue/hash.rb +32 -53
- data/lib/glue/pool.rb +9 -12
- data/lib/glue/property.rb +31 -9
- data/lib/nitro.rb +30 -8
- data/lib/nitro/adapters/cgi.rb +23 -3
- data/lib/nitro/adapters/webrick.rb +9 -3
- data/lib/nitro/builders/form.rb +21 -13
- data/lib/nitro/builders/rss.rb +20 -9
- data/lib/nitro/builders/table.rb +69 -10
- data/lib/nitro/builders/xhtml.rb +13 -4
- data/lib/nitro/component.rb +15 -0
- data/lib/nitro/conf.rb +4 -3
- data/lib/nitro/context.rb +22 -14
- data/lib/nitro/controller.rb +63 -5
- data/lib/nitro/dispatcher.rb +11 -6
- data/lib/nitro/output.rb +28 -0
- data/lib/nitro/render.rb +78 -59
- data/lib/nitro/request.rb +5 -1
- data/lib/nitro/runner.rb +20 -6
- data/lib/nitro/session.rb +89 -18
- data/lib/nitro/session/drb.rb +31 -0
- data/lib/nitro/session/drbserver.rb +71 -0
- data/lib/nitro/session/memory.rb +13 -0
- data/lib/nitro/simple.rb +7 -0
- data/lib/nitro/ui/date-select.rb +2 -5
- data/lib/nitro/ui/pager.rb +4 -4
- data/lib/nitro/ui/tabs.rb +2 -4
- data/lib/nitro/uri.rb +7 -4
- data/lib/og.rb +20 -12
- data/lib/og/adapter.rb +40 -13
- data/lib/og/adapters/filesys.rb +121 -0
- data/lib/og/adapters/mysql.rb +10 -5
- data/lib/og/adapters/oracle.rb +374 -0
- data/lib/og/adapters/psql.rb +10 -23
- data/lib/og/adapters/sqlite.rb +3 -3
- data/lib/og/backend.rb +2 -2
- data/lib/og/connection.rb +6 -6
- data/lib/og/database.rb +5 -5
- data/lib/og/enchant.rb +6 -2
- data/lib/og/meta.rb +56 -26
- data/lib/og/mock.rb +1 -1
- data/lib/og/typemacros.rb +23 -0
- data/lib/parts/content.rb +4 -10
- data/test/nitro/adapters/tc_cgi.rb +1 -1
- data/test/nitro/builders/tc_rss.rb +1 -1
- data/test/nitro/builders/tc_table.rb +30 -0
- data/test/nitro/tc_context.rb +4 -0
- data/test/nitro/tc_controller.rb +9 -2
- data/test/og/tc_filesys.rb +83 -0
- data/test/og/tc_meta.rb +55 -0
- data/test/tc_og.rb +115 -36
- data/vendor/README +11 -5
- data/vendor/breakpoint.rb +35 -38
- data/vendor/breakpoint_client.rb +119 -80
- data/vendor/composite_sexp_processor.rb +43 -0
- data/vendor/parse_tree.rb +745 -0
- data/vendor/sexp_processor.rb +453 -0
- metadata +34 -7
- data/examples/no_xsl_blog/conf/app.conf.rb +0 -47
data/test/nitro/tc_context.rb
CHANGED
data/test/nitro/tc_controller.rb
CHANGED
@@ -11,7 +11,7 @@ class TC_Controller < Test::Unit::TestCase # :nodoc: all
|
|
11
11
|
include N
|
12
12
|
|
13
13
|
class BlogController < Controller
|
14
|
-
|
14
|
+
attr_reader :aflag, :tflag
|
15
15
|
|
16
16
|
def list
|
17
17
|
@aflag = true
|
@@ -30,8 +30,9 @@ class TC_Controller < Test::Unit::TestCase # :nodoc: all
|
|
30
30
|
def test_render
|
31
31
|
ctx = Context.new(@conf)
|
32
32
|
ctx.headers = {}
|
33
|
+
ctx.params = {}
|
33
34
|
puts '=', ctx.dispatcher.root
|
34
|
-
klass, action, base = ctx.dispatcher.dispatch('/blog/list')
|
35
|
+
klass, action, base = ctx.dispatcher.dispatch('/blog/list', ctx)
|
35
36
|
c = klass.new(ctx, base)
|
36
37
|
begin
|
37
38
|
c.send(action)
|
@@ -44,4 +45,10 @@ class TC_Controller < Test::Unit::TestCase # :nodoc: all
|
|
44
45
|
assert_equal true, c.tflag
|
45
46
|
end
|
46
47
|
|
48
|
+
def test_action_methods
|
49
|
+
# aflag/tflag are counted too!
|
50
|
+
assert_equal 3, BlogController.action_methods.size
|
51
|
+
assert BlogController.action_methods.include?('list')
|
52
|
+
end
|
53
|
+
|
47
54
|
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), '..', '..', 'lib')
|
2
|
+
|
3
|
+
require 'test/unit'
|
4
|
+
require 'ostruct'
|
5
|
+
|
6
|
+
require 'og'
|
7
|
+
require 'og/adapters/filesys'
|
8
|
+
|
9
|
+
class TC_OgFilesys < Test::Unit::TestCase # :nodoc: all
|
10
|
+
include N, Og
|
11
|
+
|
12
|
+
# Forward declaration.
|
13
|
+
|
14
|
+
class Comment; end
|
15
|
+
|
16
|
+
class Article
|
17
|
+
prop_accessor :name, String
|
18
|
+
prop_accessor :age, Fixnum
|
19
|
+
has_many :comments, Comment
|
20
|
+
|
21
|
+
def initialize (name = nil, age = nil)
|
22
|
+
@name, @age = name, age
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
class Comment
|
27
|
+
prop_accessor :text, String
|
28
|
+
belongs_to :article, Article
|
29
|
+
|
30
|
+
def initialize(text = nil)
|
31
|
+
@text = text
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def setup
|
36
|
+
config = {
|
37
|
+
:adapter => 'filesys',
|
38
|
+
:database => 'fstest',
|
39
|
+
}
|
40
|
+
|
41
|
+
$DBG = true
|
42
|
+
|
43
|
+
Og::Database.drop_db!(config)
|
44
|
+
@og = Og::Database.new(config)
|
45
|
+
end
|
46
|
+
|
47
|
+
def teardown
|
48
|
+
@og.shutdown
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_all
|
52
|
+
a = Article.new('gmosx', 30)
|
53
|
+
a.save!
|
54
|
+
|
55
|
+
a1 = Article[1]
|
56
|
+
|
57
|
+
assert_equal 'gmosx', a1.name
|
58
|
+
assert_equal 30, a1.age
|
59
|
+
assert_equal 1, a1.oid
|
60
|
+
|
61
|
+
Article.create('drak', 12)
|
62
|
+
Article.create('ekarak', 34)
|
63
|
+
Article.create('mario', 53)
|
64
|
+
Article.create('elathan', 34)
|
65
|
+
=begin
|
66
|
+
articles = Article.all
|
67
|
+
|
68
|
+
assert_equal 5, articles.size
|
69
|
+
=end
|
70
|
+
a3 = Article[3]
|
71
|
+
|
72
|
+
assert_equal 'ekarak', a3.name
|
73
|
+
|
74
|
+
c1 = Comment.new('a comment')
|
75
|
+
c1.save!
|
76
|
+
a3.add_comment(c1)
|
77
|
+
=begin
|
78
|
+
a5 = Article[3]
|
79
|
+
assert_equal 1, a5.comments.size
|
80
|
+
=end
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
data/test/og/tc_meta.rb
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), '..', '..', 'lib')
|
2
|
+
|
3
|
+
require 'test/unit'
|
4
|
+
require 'ostruct'
|
5
|
+
|
6
|
+
require 'og'
|
7
|
+
|
8
|
+
class TC_OgMeta < Test::Unit::TestCase # :nodoc: all
|
9
|
+
include N
|
10
|
+
|
11
|
+
# Forward declaration.
|
12
|
+
|
13
|
+
class Comment; end
|
14
|
+
|
15
|
+
class Article
|
16
|
+
property :name, String
|
17
|
+
property :age, Fixnum
|
18
|
+
has_many :comments, Comment
|
19
|
+
|
20
|
+
def initialize (name = nil, age = nil)
|
21
|
+
@name, @age = name, age
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
class Comment
|
26
|
+
prop_accessor :text, String
|
27
|
+
belongs_to :article, Article
|
28
|
+
|
29
|
+
def initialize(text = nil)
|
30
|
+
@text = text
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def setup
|
35
|
+
end
|
36
|
+
|
37
|
+
def teardown
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_all
|
41
|
+
par = Article.__meta[:props_and_relations]
|
42
|
+
assert_equal 3, par.size
|
43
|
+
assert_equal N::Property, par[1].class
|
44
|
+
assert_equal Og::HasMany, par[2].class
|
45
|
+
|
46
|
+
par = Comment.__meta[:props_and_relations]
|
47
|
+
assert_equal 3, par.size
|
48
|
+
assert_equal N::Property, par[0].class
|
49
|
+
assert_equal Og::BelongsTo, par[1].class
|
50
|
+
assert_equal 'article_oid', par[1].meta[:property].to_s
|
51
|
+
assert_equal String, par[0].klass
|
52
|
+
assert_equal Article, par[1].foreign_class
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
data/test/tc_og.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
2
2
|
|
3
|
+
$DBG = true
|
4
|
+
|
3
5
|
require 'test/unit'
|
4
6
|
|
5
7
|
require 'og'
|
@@ -19,15 +21,24 @@ end
|
|
19
21
|
|
20
22
|
class Role
|
21
23
|
prop_accessor :title, String
|
24
|
+
property :chk_not_null, Fixnum, :default => 2
|
22
25
|
end
|
23
26
|
|
24
27
|
class Comment; end
|
28
|
+
class Article; end
|
29
|
+
|
30
|
+
class Category
|
31
|
+
prop_accessor :title, String
|
32
|
+
many_to_many :articles, Article
|
33
|
+
end
|
25
34
|
|
26
35
|
class Article
|
27
36
|
prop_accessor :title, String
|
28
37
|
prop_accessor :body, String
|
29
38
|
prop_accessor :owner_oid, Fixnum, :sql_index => true
|
30
39
|
prop_accessor :another_oid, Fixnum
|
40
|
+
property :create_time, Time
|
41
|
+
property :rate, Float
|
31
42
|
sql_index 'owner_oid, another_oid'
|
32
43
|
prop_accessor :options, Hash
|
33
44
|
has_many :comments, Test::Comment
|
@@ -80,48 +91,69 @@ class MyClass
|
|
80
91
|
end
|
81
92
|
|
82
93
|
class OrderItem
|
83
|
-
prop_accessor :
|
94
|
+
prop_accessor :onumber, Fixnum
|
84
95
|
refers_to :article, Article
|
85
96
|
end
|
86
97
|
|
87
98
|
class TC_N_OG < Test::Unit::TestCase
|
88
|
-
def test_psql
|
89
|
-
config = {
|
90
|
-
:adapter => 'psql',
|
91
|
-
# :address => 'localhost',
|
92
|
-
:database => 'test',
|
93
|
-
:user => 'postgres',
|
94
|
-
:password => 'navelrulez',
|
95
|
-
:connection_count => 2
|
96
|
-
}
|
97
|
-
|
98
|
-
run_all_tests(config)
|
99
|
-
end
|
100
99
|
|
101
|
-
=
|
102
|
-
|
103
|
-
|
104
|
-
:adapter => 'mysql',
|
105
|
-
# :address => 'localhost',
|
106
|
-
:database => 'test',
|
107
|
-
:user => 'root',
|
108
|
-
:password => 'navelrulez',
|
109
|
-
:connection_count => 2
|
110
|
-
}
|
111
|
-
|
112
|
-
run_all_tests(config)
|
113
|
-
end
|
100
|
+
@@adapter = :psql
|
101
|
+
|
102
|
+
case @@adapter
|
114
103
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
104
|
+
when :psql
|
105
|
+
def test_psql
|
106
|
+
config = {
|
107
|
+
:adapter => 'psql',
|
108
|
+
# :address => 'localhost',
|
109
|
+
:database => 'test',
|
110
|
+
:user => 'postgres',
|
111
|
+
:password => 'navelrulez',
|
112
|
+
:connection_count => 2
|
113
|
+
}
|
114
|
+
|
115
|
+
run_all_tests(config)
|
116
|
+
end
|
121
117
|
|
122
|
-
|
118
|
+
when :mysql
|
119
|
+
def test_mysql
|
120
|
+
config = {
|
121
|
+
:adapter => 'mysql',
|
122
|
+
# :address => 'localhost',
|
123
|
+
:database => 'test',
|
124
|
+
:user => 'root',
|
125
|
+
:password => 'navelrulez',
|
126
|
+
:connection_count => 2
|
127
|
+
}
|
128
|
+
|
129
|
+
run_all_tests(config)
|
130
|
+
end
|
131
|
+
|
132
|
+
when :oracle
|
133
|
+
def test_oracle
|
134
|
+
config = {
|
135
|
+
:adapter => 'oracle',
|
136
|
+
# :address => 'localhost',
|
137
|
+
:database => 'test',
|
138
|
+
:user => 'root',
|
139
|
+
:password => 'navelrulez',
|
140
|
+
:connection_count => 2
|
141
|
+
}
|
142
|
+
|
143
|
+
run_all_tests(config)
|
144
|
+
end
|
145
|
+
|
146
|
+
when :sqlite
|
147
|
+
def test_sqlite
|
148
|
+
config = {
|
149
|
+
:adapter => 'sqlite',
|
150
|
+
:database => 'test',
|
151
|
+
:connection_count => 2
|
152
|
+
}
|
153
|
+
|
154
|
+
run_all_tests(config)
|
155
|
+
end
|
123
156
|
end
|
124
|
-
=end
|
125
157
|
|
126
158
|
# gmosx: hmm, implemented in one method to enforce order.
|
127
159
|
|
@@ -132,6 +164,8 @@ class TC_N_OG < Test::Unit::TestCase
|
|
132
164
|
og.get_connection
|
133
165
|
|
134
166
|
article = Article.new("Title", "Here comes the body")
|
167
|
+
article.create_time = now = Time.now
|
168
|
+
article.rate = rate = 12.33
|
135
169
|
og << article
|
136
170
|
|
137
171
|
article.title = "Changed"
|
@@ -143,6 +177,9 @@ class TC_N_OG < Test::Unit::TestCase
|
|
143
177
|
|
144
178
|
another = Article[1]
|
145
179
|
assert_equal(1, another.oid)
|
180
|
+
assert_equal now.to_i, another.create_time.to_i
|
181
|
+
assert_equal rate, another.rate
|
182
|
+
|
146
183
|
# bug: yaml load problem.
|
147
184
|
assert_equal("world", another.options["hello"])
|
148
185
|
|
@@ -180,17 +217,44 @@ class TC_N_OG < Test::Unit::TestCase
|
|
180
217
|
comment.author = User["gmosx"]
|
181
218
|
comment.save!
|
182
219
|
|
183
|
-
# test automatically generated
|
220
|
+
# test automatically generated add_comment
|
184
221
|
comment = Comment.new("This is another comment")
|
185
222
|
comment.author = User["gmosx"]
|
186
223
|
article.add_comment(comment)
|
187
224
|
|
225
|
+
# test add_comment with block.
|
226
|
+
article.add_comment do |c|
|
227
|
+
c.body = 'Another one'
|
228
|
+
c.author = User['gmosx']
|
229
|
+
end
|
230
|
+
|
188
231
|
assert_equal(article.oid, comment.article_oid)
|
189
232
|
|
190
233
|
comments = article.comments
|
191
234
|
|
192
|
-
assert_equal(
|
235
|
+
assert_equal(3, comments.size)
|
236
|
+
|
237
|
+
# test many_to_many relations.
|
238
|
+
|
239
|
+
category = Category.create
|
240
|
+
category.add_article(article)
|
241
|
+
|
242
|
+
assert_equal 1, category.articles.size
|
243
|
+
|
244
|
+
# bug: test many_to_many with non-saved object.
|
245
|
+
|
246
|
+
ans = Article.new
|
247
|
+
ans.title = 'non saved'
|
248
|
+
category.add_article(ans)
|
249
|
+
|
250
|
+
category.add_article do |a|
|
251
|
+
a.title = 'another'
|
252
|
+
end
|
193
253
|
|
254
|
+
assert_equal 3, category.articles.size
|
255
|
+
|
256
|
+
assert_equal 1, article.categories.size
|
257
|
+
|
194
258
|
assert_equal("gmosx", comments[0].author.name)
|
195
259
|
|
196
260
|
article.delete_all_comments
|
@@ -244,6 +308,21 @@ class TC_N_OG < Test::Unit::TestCase
|
|
244
308
|
user = User['gmosx']
|
245
309
|
assert_equal true, user.banned
|
246
310
|
|
311
|
+
# test not null
|
312
|
+
|
313
|
+
role = Role.new
|
314
|
+
|
315
|
+
begin
|
316
|
+
role.save
|
317
|
+
rescue Exception, StandardError
|
318
|
+
# drink it
|
319
|
+
end
|
320
|
+
|
321
|
+
role = Role[1]
|
322
|
+
|
323
|
+
# not saved due to not nul constraint.
|
324
|
+
assert_equal nil, role
|
325
|
+
|
247
326
|
og.put_connection
|
248
327
|
og.shutdown
|
249
328
|
|
data/vendor/README
CHANGED
@@ -1,6 +1,12 @@
|
|
1
|
-
Libraries from other vendors
|
1
|
+
= Extensions and Libraries from other vendors.
|
2
|
+
|
3
|
+
Libraries from other vendors belong here. This file
|
4
|
+
|
5
|
+
=== Included libraries
|
6
|
+
|
7
|
+
* extensions
|
8
|
+
* breakpointer
|
9
|
+
* dev-utils
|
10
|
+
* postgres-pr
|
11
|
+
* ParseTree
|
2
12
|
|
3
|
-
extensions
|
4
|
-
breakpointer
|
5
|
-
dev-utils
|
6
|
-
postgres-pr
|
data/vendor/breakpoint.rb
CHANGED
@@ -21,6 +21,9 @@ require 'drb'
|
|
21
21
|
require 'drb/acl'
|
22
22
|
|
23
23
|
module Breakpoint
|
24
|
+
id = %q$Id: breakpoint.rb 92 2005-02-04 22:35:53Z flgr $
|
25
|
+
Version = id.split(" ")[2].to_i
|
26
|
+
|
24
27
|
extend self
|
25
28
|
|
26
29
|
# This will pop up an interactive ruby session at a
|
@@ -119,6 +122,7 @@ module Breakpoint
|
|
119
122
|
# in the context of the client.
|
120
123
|
class Client
|
121
124
|
def initialize(eval_handler) # :nodoc:
|
125
|
+
eval_handler.untaint
|
122
126
|
@eval_handler = eval_handler
|
123
127
|
end
|
124
128
|
|
@@ -133,15 +137,23 @@ module Breakpoint
|
|
133
137
|
end
|
134
138
|
|
135
139
|
# Will execute the specified statement at the client.
|
136
|
-
def method_missing(method, *args)
|
137
|
-
if args.empty?
|
138
|
-
result = eval
|
140
|
+
def method_missing(method, *args, &block)
|
141
|
+
if args.empty? and not block
|
142
|
+
result = eval "#{method}"
|
139
143
|
else
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
144
|
+
# This is a bit ugly. The alternative would be using an
|
145
|
+
# eval context instead of an eval handler for executing
|
146
|
+
# the code at the client. The problem with that approach
|
147
|
+
# is that we would have to handle special expressions
|
148
|
+
# like "self", "nil" or constants ourself which is hard.
|
149
|
+
remote = eval %{
|
150
|
+
result = lambda { |block, *args| #{method}(*args, &block) }
|
151
|
+
def result.call_with_block(*args, &block)
|
152
|
+
call(block, *args)
|
153
|
+
end
|
154
|
+
result
|
155
|
+
}
|
156
|
+
remote.call_with_block(*args, &block)
|
145
157
|
end
|
146
158
|
|
147
159
|
return result
|
@@ -175,6 +187,7 @@ module Breakpoint
|
|
175
187
|
# client.File.open("temp.txt", "w") { |f| f.puts "Hello" }
|
176
188
|
def client()
|
177
189
|
if Breakpoint.use_drb? then
|
190
|
+
sleep(0.5) until Breakpoint.drb_service.eval_handler
|
178
191
|
Client.new(Breakpoint.drb_service.eval_handler)
|
179
192
|
else
|
180
193
|
Client.new(lambda { |code| eval(code, TOPLEVEL_BINDING) })
|
@@ -276,10 +289,12 @@ module Breakpoint
|
|
276
289
|
def collision
|
277
290
|
sleep(0.5) until @collision_handler
|
278
291
|
|
292
|
+
@collision_handler.untaint
|
293
|
+
|
279
294
|
@collision_handler.call
|
280
295
|
end
|
281
296
|
|
282
|
-
def ping
|
297
|
+
def ping() end
|
283
298
|
|
284
299
|
def add_breakpoint(context, message)
|
285
300
|
workspace = IRB::WorkSpace.new(context)
|
@@ -287,34 +302,11 @@ module Breakpoint
|
|
287
302
|
|
288
303
|
sleep(0.5) until @handler
|
289
304
|
|
305
|
+
@handler.untaint
|
290
306
|
@handler.call(workspace, message)
|
291
307
|
end
|
292
308
|
|
293
|
-
|
294
|
-
@handler = block
|
295
|
-
end
|
296
|
-
|
297
|
-
def unregister_handler
|
298
|
-
@handler = nil
|
299
|
-
end
|
300
|
-
|
301
|
-
attr_reader :eval_handler
|
302
|
-
|
303
|
-
def register_eval_handler(&block)
|
304
|
-
@eval_handler = block
|
305
|
-
end
|
306
|
-
|
307
|
-
def unregister_eval_handler
|
308
|
-
@eval_handler = lambda { }
|
309
|
-
end
|
310
|
-
|
311
|
-
def register_collision_handler(&block)
|
312
|
-
@collision_handler = block
|
313
|
-
end
|
314
|
-
|
315
|
-
def unregister_collision_handler
|
316
|
-
@collision_handler = lambda { }
|
317
|
-
end
|
309
|
+
attr_accessor :handler, :eval_handler, :collision_handler
|
318
310
|
end
|
319
311
|
|
320
312
|
# Will run Breakpoint in DRb mode. This will spawn a server
|
@@ -441,7 +433,11 @@ module IRB # :nodoc:
|
|
441
433
|
@CONF[:MAIN_CONTEXT] = irb.context
|
442
434
|
|
443
435
|
old_sigint = trap("SIGINT") do
|
444
|
-
|
436
|
+
begin
|
437
|
+
irb.signal_handle
|
438
|
+
rescue RubyLex::TerminateLineInput
|
439
|
+
# ignored
|
440
|
+
end
|
445
441
|
end
|
446
442
|
|
447
443
|
catch(:IRB_EXIT) do
|
@@ -464,6 +460,7 @@ module IRB # :nodoc:
|
|
464
460
|
old_CurrentContext
|
465
461
|
end
|
466
462
|
end
|
463
|
+
def IRB.parse_opts() end
|
467
464
|
|
468
465
|
class Context
|
469
466
|
alias :old_evaluate :evaluate
|
@@ -485,7 +482,7 @@ module IRB # :nodoc:
|
|
485
482
|
if args[0] != :no_proxy and
|
486
483
|
not [true, false, nil].include?(result)
|
487
484
|
then
|
488
|
-
result.extend(DRbUndumped)
|
485
|
+
result.extend(DRbUndumped) rescue nil
|
489
486
|
end
|
490
487
|
return result
|
491
488
|
else
|
@@ -506,8 +503,8 @@ end
|
|
506
503
|
|
507
504
|
module DRb # :nodoc:
|
508
505
|
class DRbObject
|
509
|
-
undef :inspect
|
510
|
-
undef :clone
|
506
|
+
undef :inspect if method_defined?(:inspect)
|
507
|
+
undef :clone if method_defined?(:clone)
|
511
508
|
end
|
512
509
|
end
|
513
510
|
|