demeter 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.0
1
+ 2.0.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{demeter}
8
- s.version = "2.0.0"
8
+ s.version = "2.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Emerson Macedo"]
12
- s.date = %q{2010-01-06}
12
+ s.date = %q{2010-01-13}
13
13
  s.description = %q{A simple way to apply the Law of Demeter to your Ruby objects.}
14
14
  s.email = %q{emerleite@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -32,7 +32,7 @@ module Demeter
32
32
  end
33
33
 
34
34
  def demeter_names
35
- @@demeter_names
35
+ @@demeter_names ||= []
36
36
  end
37
37
 
38
38
  def demeter_names=(names)
@@ -42,4 +42,4 @@ module Demeter
42
42
  end
43
43
 
44
44
  # ActiveRecord support
45
- require "demeter/active_record"
45
+ require "demeter/active_record"
@@ -2,7 +2,7 @@ module Demeter
2
2
  module Version
3
3
  MAJOR = "2"
4
4
  MINOR = "0"
5
- PATCH = "0"
5
+ PATCH = "1"
6
6
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
7
7
  end
8
8
  end
@@ -11,4 +11,10 @@ describe "Demeter on ActiveRecord" do
11
11
  task = Task.create!(:name => "Do the right thing", :project_attributes => {:name => "Amazing Project"})
12
12
  Task.find_by_name("Do the right thing").should == task
13
13
  end
14
+
15
+ it "should also dispatch original method missing when not demetered" do
16
+ Demeter::ClassMethods.send(:remove_class_variable, :@@demeter_names)
17
+ owner = Owner.new
18
+ owner.name.should be_nil #name uses ActiveRecord method_missing instance method
19
+ end
14
20
  end
@@ -65,4 +65,11 @@ describe "Demeter" do
65
65
 
66
66
  doing { subject.address_title }.should raise_error(NoMethodError)
67
67
  end
68
+
69
+ describe Demeter::ClassMethods do
70
+ it "should return an array of demeter_names" do
71
+ Demeter::ClassMethods.send(:remove_class_variable, :@@demeter_names)
72
+ User.demeter_names.should be_kind_of(Array)
73
+ end
74
+ end
68
75
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: demeter
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emerson Macedo
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-06 00:00:00 -02:00
12
+ date: 2010-01-13 00:00:00 -02:00
13
13
  default_executable:
14
14
  dependencies: []
15
15