activesupport 1.1.0 → 1.1.1

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

Potentially problematic release.


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

data/CHANGELOG CHANGED
@@ -1,4 +1,9 @@
1
- *SVN*
1
+ *1.1.1* (11 July, 2005)
2
+
3
+ * Added more efficient implementation of the development mode reset of classes #1638 [Chris McGrath]
4
+
5
+
6
+ *1.1.0* (6 July, 2005)
2
7
 
3
8
  * Fixed conflict with Glue gem #1606 [Rick Olson]
4
9
 
@@ -1,20 +1,24 @@
1
1
  class Object #:nodoc:
2
- def remove_subclasses_of(superclass)
3
- subclasses_of(superclass).each do |subclass|
4
- ObjectSpace.each_object(Class) do |k|
5
- if k.to_s == subclass
6
- k.instance_variables.each { |v| k.send(:remove_instance_variable, v) }
7
- end
8
- end
9
- Object.send(:remove_const, subclass) rescue nil
10
- end
2
+ def remove_subclasses_of(*superclasses)
3
+ subclasses_of(*superclasses).each do |subclass|
4
+ subclass.instance_variables.each { |v| subclass.send(:remove_instance_variable, v) }
5
+ Object.send(:remove_const, subclass.to_s) rescue nil
6
+ end
7
+ end
8
+
9
+ def remove_instance_variables_of(klass)
10
+ ObjectSpace.each_object(Class) do |k|
11
+ if k.to_s == klass
12
+ k.instance_variables.each { |v| k.send(:remove_instance_variable, v) }
13
+ end
14
+ end
11
15
  end
12
16
 
13
- def subclasses_of(superclass)
17
+ def subclasses_of(*superclasses)
14
18
  subclasses = []
15
19
  ObjectSpace.each_object(Class) do |k|
16
- next if !k.ancestors.include?(superclass) || superclass == k || k.to_s.include?("::") || subclasses.include?(k.to_s)
17
- subclasses << k.to_s
20
+ next if (k.ancestors & superclasses).empty? || superclasses.include?(k) || k.to_s.include?("::") || subclasses.include?(k)
21
+ subclasses << k
18
22
  end
19
23
  subclasses
20
24
  end
@@ -46,6 +50,6 @@ class Class #:nodoc:
46
50
  end
47
51
 
48
52
  def subclasses
49
- Object.subclasses_of(self)
53
+ Object.subclasses_of(self).map { |o| o.to_s }
50
54
  end
51
55
  end
@@ -39,7 +39,7 @@ module Dependencies #:nodoc:
39
39
  end
40
40
 
41
41
  def remove_subclasses_for(*classes)
42
- classes.each { |klass| klass.remove_subclasses }
42
+ Object.remove_subclasses_of(*classes)
43
43
  end
44
44
 
45
45
  # LoadingModules implement namespace-safe dynamic loading.
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.10
3
3
  specification_version: 1
4
4
  name: activesupport
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.1.0
7
- date: 2005-07-06
6
+ version: 1.1.1
7
+ date: 2005-07-11
8
8
  summary: Support and utility classes used by the Rails framework.
9
9
  require_paths:
10
10
  - lib