thoughtful 0.0.7 → 0.0.8

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.
@@ -10,6 +10,10 @@ class Object
10
10
  def not
11
11
  Not.new(self)
12
12
  end
13
+
14
+ def __negate__
15
+ !self
16
+ end
13
17
 
14
18
  class Not
15
19
  private(*instance_methods.select { |m| m !~ /(^__|^\W|^binding$)/ })
@@ -19,7 +23,7 @@ class Object
19
23
  end
20
24
 
21
25
  def method_missing(sym, *args, &blk)
22
- !@subject.send(sym,*args,&blk)
26
+ @subject.send(sym,*args,&blk).__negate__
23
27
  end
24
28
  end
25
29
  end
@@ -2,7 +2,7 @@ module Thoughtful #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 7
5
+ TINY = 8
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -24,4 +24,16 @@ Expectations do
24
24
  expect true do
25
25
  Object.not.nil?
26
26
  end
27
+
28
+ expect :custom_negate do
29
+ instance = Object.new
30
+ def instance.obj_that_responds_to_negate
31
+ result = Object.new
32
+ def result.__negate__
33
+ :custom_negate
34
+ end
35
+ result
36
+ end
37
+ instance.not.obj_that_responds_to_negate
38
+ end
27
39
  end
@@ -33,7 +33,7 @@
33
33
  <h1>thoughtful</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/thoughtful"; return false'>
35
35
  <p>Get Version</p>
36
- <a href="http://rubyforge.org/projects/thoughtful" class="numbers">0.0.7</a>
36
+ <a href="http://rubyforge.org/projects/thoughtful" class="numbers">0.0.8</a>
37
37
  </div>
38
38
  <h1>&#x2192; &#8216;thoughtful&#8217;</h1>
39
39
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thoughtful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Fields