rails 0.9.4 → 0.9.4.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rails might be problematic. Click here for more details.

data/CHANGELOG CHANGED
@@ -1,3 +1,12 @@
1
+ *0.9.4.1* (January 18th, 2005)
2
+
3
+ * Added 5-second timeout to WordNet alternatives on creating reserved-word models #501 [Marcel Molina]
4
+
5
+ * Fixed binding of caller #496 [Alexey]
6
+
7
+ * Upgraded to Active Record 1.5.1, Action Pack 1.3.1, Action Mailer 0.6.1
8
+
9
+
1
10
  *0.9.4* (January 17th, 2005)
2
11
 
3
12
  * Added that ApplicationController will catch a ControllerNotFound exception if someone attempts to access a url pointing to an unexisting controller [Tobias Luetke]
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ require 'rbconfig'
9
9
 
10
10
  PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
11
11
  PKG_NAME = 'rails'
12
- PKG_VERSION = '0.9.4' + PKG_BUILD
12
+ PKG_VERSION = '0.9.4.1' + PKG_BUILD
13
13
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
14
14
  PKG_DESTINATION = ENV["RAILS_PKG_DESTINATION"] || "../#{PKG_NAME}"
15
15
 
@@ -245,9 +245,9 @@ spec = Gem::Specification.new do |s|
245
245
  EOF
246
246
 
247
247
  s.add_dependency('rake', '>= 0.4.15')
248
- s.add_dependency('activerecord', '>= 1.5.0')
249
- s.add_dependency('actionpack', '>= 1.3.0')
250
- s.add_dependency('actionmailer', '>= 0.6.0')
248
+ s.add_dependency('activerecord', '>= 1.5.1')
249
+ s.add_dependency('actionpack', '>= 1.3.1')
250
+ s.add_dependency('actionmailer', '>= 0.6.1')
251
251
 
252
252
  s.has_rdoc = false
253
253
 
@@ -6,14 +6,18 @@ ARGV.shift unless ARGV.empty? or not ['--help', '-h'].include?(ARGV[0])
6
6
 
7
7
  def find_synonyms(word)
8
8
  require 'open-uri'
9
+ require 'timeout'
10
+
9
11
  uri = "http://wordnet.princeton.edu/cgi-bin/webwn2.0?stage=2" +
10
12
  "&word=%s&posnumber=1&searchtypenumber=2&senses=&showglosses=1"
11
13
 
12
- open(uri % word) do |stream|
13
- data = stream.read.gsub("&nbsp;", " ").gsub("<BR>", "")
14
- data.scan(/^Sense \d+\n.+?\n\n/m)
14
+ timeout(5) do
15
+ open(uri % word) do |stream|
16
+ data = stream.read.gsub("&nbsp;", " ").gsub("<BR>", "")
17
+ data.scan(/^Sense \d+\n.+?\n\n/m)
18
+ end
15
19
  end
16
- rescue Exception
20
+ rescue Timeout::Error, Exception
17
21
  return nil
18
22
  end
19
23
 
@@ -66,4 +70,4 @@ end_usage
66
70
  #{$0} login
67
71
  end_usage
68
72
  exit 0
69
- end
73
+ end
@@ -1,81 +1,85 @@
1
1
  begin
2
2
  require 'simplecc'
3
3
  rescue LoadError
4
- def Continuation.create(*args, &block)
5
- cc = nil; result = callcc {|c| cc = c; block.call(cc) if block and args.empty?}
6
- result ||= args
7
- return *[cc, *result]
4
+ class Continuation #:nodoc:
5
+ def self.create(*args, &block)
6
+ cc = nil; result = callcc {|c| cc = c; block.call(cc) if block and args.empty?}
7
+ result ||= args
8
+ return *[cc, *result]
9
+ end
8
10
  end
9
11
  end
10
12
 
11
- # This method returns the binding of the method that called your
12
- # method. It will raise an Exception when you're not inside a method.
13
- #
14
- # It's used like this:
15
- # def inc_counter(amount = 1)
16
- # Binding.of_caller do |binding|
17
- # # Create a lambda that will increase the variable 'counter'
18
- # # in the caller of this method when called.
19
- # inc = eval("lambda { |arg| counter += arg }", binding)
20
- # # We can refer to amount from inside this block safely.
21
- # inc.call(amount)
22
- # end
23
- # # No other statements can go here. Put them inside the block.
24
- # end
25
- # counter = 0
26
- # 2.times { inc_counter }
27
- # counter # => 2
28
- #
29
- # Binding.of_caller must be the last statement in the method.
30
- # This means that you will have to put everything you want to
31
- # do after the call to Binding.of_caller into the block of it.
32
- # This should be no problem however, because Ruby has closures.
33
- # If you don't do this an Exception will be raised. Because of
34
- # the way that Binding.of_caller is implemented it has to be
35
- # done this way.
36
- def Binding.of_caller(&block)
37
- old_critical = Thread.critical
38
- Thread.critical = true
39
- count = 0
40
- cc, result, error, extra_data = Continuation.create(nil, nil)
41
- error.call if error
13
+ class Binding #:nodoc:
14
+ # This method returns the binding of the method that called your
15
+ # method. It will raise an Exception when you're not inside a method.
16
+ #
17
+ # It's used like this:
18
+ # def inc_counter(amount = 1)
19
+ # Binding.of_caller do |binding|
20
+ # # Create a lambda that will increase the variable 'counter'
21
+ # # in the caller of this method when called.
22
+ # inc = eval("lambda { |arg| counter += arg }", binding)
23
+ # # We can refer to amount from inside this block safely.
24
+ # inc.call(amount)
25
+ # end
26
+ # # No other statements can go here. Put them inside the block.
27
+ # end
28
+ # counter = 0
29
+ # 2.times { inc_counter }
30
+ # counter # => 2
31
+ #
32
+ # Binding.of_caller must be the last statement in the method.
33
+ # This means that you will have to put everything you want to
34
+ # do after the call to Binding.of_caller into the block of it.
35
+ # This should be no problem however, because Ruby has closures.
36
+ # If you don't do this an Exception will be raised. Because of
37
+ # the way that Binding.of_caller is implemented it has to be
38
+ # done this way.
39
+ def self.of_caller(&block)
40
+ old_critical = Thread.critical
41
+ Thread.critical = true
42
+ count = 0
43
+ cc, result, error, extra_data = Continuation.create(nil, nil)
44
+ error.call if error
42
45
 
43
- tracer = lambda do |*args|
44
- type, context, extra_data = args[0], args[4], args
45
- if type == "return"
46
- count += 1
47
- # First this method and then calling one will return --
48
- # the trace event of the second event gets the context
49
- # of the method which called the method that called this
50
- # method.
51
- if count == 2
52
- # It would be nice if we could restore the trace_func
53
- # that was set before we swapped in our own one, but
54
- # this is impossible without overloading set_trace_func
55
- # in current Ruby.
46
+ tracer = lambda do |*args|
47
+ type, context, extra_data = args[0], args[4], args
48
+ if type == "return"
49
+ count += 1
50
+ # First this method and then calling one will return --
51
+ # the trace event of the second event gets the context
52
+ # of the method which called the method that called this
53
+ # method.
54
+ if count == 2
55
+ # It would be nice if we could restore the trace_func
56
+ # that was set before we swapped in our own one, but
57
+ # this is impossible without overloading set_trace_func
58
+ # in current Ruby.
59
+ set_trace_func(nil)
60
+ cc.call(eval("binding", context), nil, extra_data)
61
+ end
62
+ elsif type == "line" then
63
+ nil
64
+ elsif type == "c-return" and extra_data[3] == :set_trace_func then
65
+ nil
66
+ else
56
67
  set_trace_func(nil)
57
- cc.call(eval("binding", context), nil, extra_data)
68
+ error_msg = "Binding.of_caller used in non-method context or " +
69
+ "trailing statements of method using it aren't in the block."
70
+ cc.call(nil, lambda { raise(ArgumentError, error_msg) }, nil)
58
71
  end
59
- elsif type == "line" then
60
- nil
61
- elsif type == "c-return" and extra_data[3] == :set_trace_func then
62
- nil
63
- else
64
- set_trace_func(nil)
65
- error_msg = "Binding.of_caller used in non-method context or " +
66
- "trailing statements of method using it aren't in the block."
67
- cc.call(nil, lambda { raise(ArgumentError, error_msg) }, nil)
68
72
  end
69
- end
70
73
 
71
- unless result
72
- set_trace_func(tracer)
73
- return nil
74
- else
75
- Thread.critical = old_critical
76
- case block.arity
77
- when 1 then yield(result)
78
- else yield(result, extra_data)
74
+ unless result
75
+ set_trace_func(tracer)
76
+ return nil
77
+ else
78
+ Thread.critical = old_critical
79
+ case block.arity
80
+ when 1 then yield(result)
81
+ else yield(result, extra_data)
82
+ end
79
83
  end
80
84
  end
81
- end
85
+ end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.4
3
3
  specification_version: 1
4
4
  name: rails
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.9.4
7
- date: 2005-01-17
6
+ version: 0.9.4.1
7
+ date: 2005-01-18
8
8
  summary: "Web-application framework with template engine, control-flow layer, and ORM."
9
9
  require_paths:
10
10
  - lib
@@ -138,7 +138,7 @@ dependencies:
138
138
  -
139
139
  - ">="
140
140
  - !ruby/object:Gem::Version
141
- version: 1.5.0
141
+ version: 1.5.1
142
142
  version:
143
143
  - !ruby/object:Gem::Dependency
144
144
  name: actionpack
@@ -148,7 +148,7 @@ dependencies:
148
148
  -
149
149
  - ">="
150
150
  - !ruby/object:Gem::Version
151
- version: 1.3.0
151
+ version: 1.3.1
152
152
  version:
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: actionmailer
@@ -158,5 +158,5 @@ dependencies:
158
158
  -
159
159
  - ">="
160
160
  - !ruby/object:Gem::Version
161
- version: 0.6.0
161
+ version: 0.6.1
162
162
  version: