kvo 0.0.4 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 84dde75ecc7b8273d645287619372ad49e308cff
4
+ data.tar.gz: e9607a6fd92f1fddb516c1c375b759291669b80b
5
+ SHA512:
6
+ metadata.gz: 4e054fdc8b1d301d798a378eab98135c552c6927e718d9cf9629994c1ca10d9ba3cf855964f3c4a139f7ca108af891726049ac76bf04d024f027a2c5801db05e
7
+ data.tar.gz: 9d13075bf278b19dd1941a79d1e2ec763ead6bb7ea6104bf3b3f0792025c3078d4a4178329425436751486593cdd3b8eb8ab4d45214beb38dd3fdef583ed8196
data/lib/kvo.rb CHANGED
@@ -11,8 +11,10 @@ module Kvo
11
11
  end
12
12
  def #{kvo}=(new_val)
13
13
  old = @kvo_#{kvo}
14
- @kvo_#{kvo}=new_val
15
- fire :#{kvo}_changed, old, new_val
14
+ unless old == new_val
15
+ @kvo_#{kvo}=new_val
16
+ fire :#{kvo}_changed, old, new_val
17
+ end
16
18
  end
17
19
  METHODS
18
20
  end
data/lib/kvo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kvo
2
- VERSION = "0.0.4"
2
+ VERSION = "0.1.0"
3
3
  end
data/spec/kvo_spec.rb CHANGED
@@ -11,12 +11,9 @@ describe '.kvo_attr_accessor' do
11
11
  end
12
12
  end
13
13
 
14
- it 'notifies on setting of same value' do
15
- old_val = @target.bar
16
- @target.bar = old_val
17
- @fired.should_not be_nil
18
- @fired[:old].should == old_val
19
- @fired[:new].should == old_val
14
+ it 'does NOT notify on setting of same value' do
15
+ @target.bar = @target.bar
16
+ @fired.should be_nil
20
17
  end
21
18
 
22
19
  it 'notifies on setting of different value' do
metadata CHANGED
@@ -1,62 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kvo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
5
- prerelease:
4
+ version: 0.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Shawn Anderson
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-12-11 00:00:00.000000000 Z
11
+ date: 2013-04-24 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: publisher
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rspec
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: mocha
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  description: KVO in ruby.
@@ -77,27 +70,26 @@ files:
77
70
  - spec/kvo_spec.rb
78
71
  homepage: ''
79
72
  licenses: []
73
+ metadata: {}
80
74
  post_install_message:
81
75
  rdoc_options: []
82
76
  require_paths:
83
77
  - lib
84
78
  required_ruby_version: !ruby/object:Gem::Requirement
85
- none: false
86
79
  requirements:
87
- - - ! '>='
80
+ - - '>='
88
81
  - !ruby/object:Gem::Version
89
82
  version: '0'
90
83
  required_rubygems_version: !ruby/object:Gem::Requirement
91
- none: false
92
84
  requirements:
93
- - - ! '>='
85
+ - - '>='
94
86
  - !ruby/object:Gem::Version
95
87
  version: '0'
96
88
  requirements: []
97
89
  rubyforge_project: kvo
98
- rubygems_version: 1.8.24
90
+ rubygems_version: 2.0.0
99
91
  signing_key:
100
- specification_version: 3
92
+ specification_version: 4
101
93
  summary: KVO in ruby
102
94
  test_files:
103
95
  - spec/helper.rb