autocode 0.9.0 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/README.html +2 -2
- data/lib/autocreate.rb +2 -1
- data/lib/autoload.rb +1 -1
- metadata +2 -2
data/doc/rdoc/created.rid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Sat, 05 Jan 2008 21:05:10 -0800
|
data/doc/rdoc/files/README.html
CHANGED
@@ -56,7 +56,7 @@
|
|
56
56
|
</tr>
|
57
57
|
<tr class="top-aligned-row">
|
58
58
|
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>
|
59
|
+
<td>Sat Jan 05 21:04:30 -0800 2008</td>
|
60
60
|
</tr>
|
61
61
|
</table>
|
62
62
|
</div>
|
@@ -121,7 +121,7 @@ combination with autoloading.
|
|
121
121
|
require 'autocode'
|
122
122
|
|
123
123
|
module Application
|
124
|
-
extend
|
124
|
+
extend Autocreate; extend Reloadable
|
125
125
|
[ [ :Configurations, :configurations ],
|
126
126
|
[ :Models, :models ],
|
127
127
|
[ :Views, :views ],
|
data/lib/autocreate.rb
CHANGED
@@ -37,9 +37,10 @@ module Autocreate
|
|
37
37
|
# if we found it, set the const and return it
|
38
38
|
if key
|
39
39
|
object = exemplar.clone
|
40
|
-
object.instance_eval( &block ) if block
|
41
40
|
( @reloadable ||= [] ) << cname;
|
42
41
|
const_set( cname, object )
|
42
|
+
object.instance_eval( &block ) if block
|
43
|
+
return object
|
43
44
|
else
|
44
45
|
old.call(cname)
|
45
46
|
end
|
data/lib/autoload.rb
CHANGED
@@ -49,7 +49,7 @@ module Autoload
|
|
49
49
|
define_method :const_missing do | cname | #:nodoc:
|
50
50
|
|
51
51
|
return old.call(cname) unless autoload?( cname )
|
52
|
-
fname = cname.to_s.gsub(/([a-z\d])([A-Z])/){ "#{$1}_#{$2.downcase}"} + '.rb'
|
52
|
+
fname = ( cname.to_s.gsub(/([a-z\d])([A-Z])/){ "#{$1}_#{$2.downcase}"} + '.rb' ).downcase
|
53
53
|
dir = ( @directories ||= ['.'] ).find do |dir|
|
54
54
|
File.exist?( dir / fname )
|
55
55
|
end
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: autocode
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.9.
|
7
|
-
date: 2008-01-
|
6
|
+
version: 0.9.2
|
7
|
+
date: 2008-01-26 00:00:00 -08:00
|
8
8
|
summary: Utility for auto-including, reloading, and generating classes and modules.
|
9
9
|
require_paths:
|
10
10
|
- lib
|