autocode 0.9.0 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- Fri, 04 Jan 2008 21:38:39 -0800
1
+ Sat, 05 Jan 2008 21:05:10 -0800
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Fri Jan 04 21:18:31 -0800 2008</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 Autoload; extend Reloadable
124
+ extend Autocreate; extend Reloadable
125
125
  [ [ :Configurations, :configurations ],
126
126
  [ :Models, :models ],
127
127
  [ :Views, :views ],
@@ -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
@@ -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.0
7
- date: 2008-01-04 00:00:00 -08:00
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