lafcadio 0.7.4 → 0.7.5

Sign up to get free protection for your applications and to get access to all the features.
data/lib/lafcadio.rb CHANGED
@@ -16,7 +16,7 @@
16
16
  # http://lafcadio.rubyforge.org/tutorial.html.
17
17
 
18
18
  module Lafcadio
19
- Version = "0.7.4"
19
+ Version = "0.7.5"
20
20
 
21
21
  require 'lafcadio/depend'
22
22
  require 'lafcadio/domain'
data/lib/lafcadio.rb~ CHANGED
@@ -16,7 +16,7 @@
16
16
  # http://lafcadio.rubyforge.org/tutorial.html.
17
17
 
18
18
  module Lafcadio
19
- Version = "0.7.3"
19
+ Version = "0.7.4"
20
20
 
21
21
  require 'lafcadio/depend'
22
22
  require 'lafcadio/domain'
@@ -499,7 +499,7 @@ module Lafcadio
499
499
  # postal code.
500
500
  class StateField < EnumField
501
501
  def initialize( domain_class, name = "state" )
502
- super( domain_class, name, UsCommerce::UsStates.states )
502
+ super( domain_class, name, USCommerce::UsStates.states )
503
503
  end
504
504
  end
505
505
 
@@ -499,7 +499,7 @@ module Lafcadio
499
499
  # postal code.
500
500
  class StateField < EnumField
501
501
  def initialize( domain_class, name = "state" )
502
- super( domain_class, name, UsStates.states )
502
+ super( domain_class, name, UsCommerce::UsStates.states )
503
503
  end
504
504
  end
505
505
 
@@ -482,11 +482,11 @@ module Lafcadio
482
482
 
483
483
  def get_regexp
484
484
  if @matchType == PRE_AND_POST
485
- Regexp.new(@searchTerm)
485
+ Regexp.new( @searchTerm, Regexp::IGNORECASE )
486
486
  elsif @matchType == PRE_ONLY
487
- Regexp.new(@searchTerm.to_s + "$")
487
+ Regexp.new( @searchTerm.to_s + "$", Regexp::IGNORECASE )
488
488
  elsif @matchType == POST_ONLY
489
- Regexp.new("^" + @searchTerm)
489
+ Regexp.new( "^" + @searchTerm, Regexp::IGNORECASE )
490
490
  end
491
491
  end
492
492
 
@@ -354,25 +354,32 @@ module Lafcadio
354
354
  def self.impostor( domain_class )
355
355
  unless @@impostor_classes[domain_class]
356
356
  i_class = Class.new
357
- i_class.module_eval {
357
+ i_class.module_eval <<-CLASS_DEF
358
358
  attr_reader :domain_class
359
359
 
360
- def initialize; @domain_class = domain_class; end
360
+ def initialize; @domain_class = #{ domain_class.name }; end
361
361
 
362
362
  def method_missing( methId, *args )
363
363
  fieldName = methId.id2name
364
364
  begin
365
- classField = @@domain_class.get_field( fieldName )
365
+ classField = self.domain_class.get_field( fieldName )
366
366
  ObjectFieldImpostor.new( self, classField )
367
367
  rescue MissingError
368
368
  super( methId, *args )
369
369
  end
370
370
  end
371
- }
371
+
372
+ #{ domain_class.name }.class_fields.each do |class_field|
373
+ begin
374
+ undef_method class_field.name.to_sym
375
+ rescue NameError
376
+ # not defined globally or in an included Module, skip it
377
+ end
378
+ end
379
+ CLASS_DEF
372
380
  @@impostor_classes[domain_class] = i_class
373
381
  end
374
382
  i_class = @@impostor_classes[domain_class]
375
- puts i_class.new.domain_class.name
376
383
  i_class.new
377
384
  end
378
385
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.6
3
3
  specification_version: 1
4
4
  name: lafcadio
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.7.4
7
- date: 2005-07-17
6
+ version: 0.7.5
7
+ date: 2005-08-14
8
8
  summary: Lafcadio is an object-relational mapping layer
9
9
  require_paths:
10
10
  - lib