kvo 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/kvo.rb +0 -3
- data/lib/kvo/version.rb +1 -1
- data/spec/kvo_spec.rb +0 -8
- metadata +2 -3
data/lib/kvo.rb
CHANGED
@@ -4,9 +4,6 @@ module Kvo
|
|
4
4
|
def kvo_attr_accessor(*kvo_symbols)
|
5
5
|
kvo_symbols.each do |kvo|
|
6
6
|
|
7
|
-
raise "the method #{kvo} already exists" if self.instance_methods.include? kvo
|
8
|
-
raise "the method #{kvo}= already exists" if self.instance_methods.include? "#{kvo}=".to_sym
|
9
|
-
|
10
7
|
class_eval <<-METHODS
|
11
8
|
can_fire :#{kvo}_changed unless published_events == :any_event_is_ok
|
12
9
|
def #{kvo}
|
data/lib/kvo/version.rb
CHANGED
data/spec/kvo_spec.rb
CHANGED
@@ -39,14 +39,6 @@ describe '.kvo_attr_accessor' do
|
|
39
39
|
@baz_fired.should be
|
40
40
|
end
|
41
41
|
|
42
|
-
it 'raises an error if attr setter is already defined' do
|
43
|
-
lambda{ ThingOne.kvo_attr_accessor :one }.should raise_exception(RuntimeError, /one= already exists/)
|
44
|
-
end
|
45
|
-
|
46
|
-
it 'raises an error if attr getter is already defined' do
|
47
|
-
lambda{ ThingTwo.kvo_attr_accessor :two }.should raise_exception(RuntimeError, /two already exists/)
|
48
|
-
end
|
49
|
-
|
50
42
|
describe "inheritance" do
|
51
43
|
before do
|
52
44
|
@target = SubFoo.new
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kvo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-12-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: publisher
|
@@ -102,4 +102,3 @@ summary: KVO in ruby
|
|
102
102
|
test_files:
|
103
103
|
- spec/helper.rb
|
104
104
|
- spec/kvo_spec.rb
|
105
|
-
has_rdoc:
|