nO_op 1.O.O.1 → 1.O.O.2

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.
Files changed (5) hide show
  1. data/History.txt +6 -0
  2. data/README.md +2 -0
  3. data/lib/nO_op.rb +22 -0
  4. data/spec/nO_op_spec.rb +30 -0
  5. metadata +3 -3
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ == 1.0.0.2 2011-09-23
2
+
3
+ * 2 miniscule enhancements:
4
+ * Added O.o
5
+ * Added o.O
6
+
1
7
  == 1.0.0.1 2011-09-23
2
8
 
3
9
  * 1 miniscule enhancement:
data/README.md CHANGED
@@ -24,6 +24,8 @@ I like to think of that second usage as a judgemental `tap`.
24
24
  Also available:
25
25
 
26
26
  * o_O
27
+ * O.o
28
+ * o.O
27
29
 
28
30
  ## Contributions
29
31
 
data/lib/nO_op.rb CHANGED
@@ -1,6 +1,20 @@
1
1
  module O_o
2
2
  end
3
3
 
4
+ class O
5
+ def initialize(o)
6
+ @o = o
7
+ end
8
+
9
+ def o
10
+ @o
11
+ end
12
+
13
+ def O
14
+ @o
15
+ end
16
+ end
17
+
4
18
  module Kernel
5
19
  def O_o
6
20
  self
@@ -9,4 +23,12 @@ module Kernel
9
23
  def o_O
10
24
  self
11
25
  end
26
+
27
+ def O
28
+ O.new(self)
29
+ end
30
+
31
+ def o
32
+ O.new(self)
33
+ end
12
34
  end
data/spec/nO_op_spec.rb CHANGED
@@ -42,4 +42,34 @@ describe 'methods' do
42
42
  lambda { o_O }.should.not.raise
43
43
  end
44
44
  end
45
+
46
+ it "should add an 'O' method" do
47
+ Object.new.should.respond_to(:O)
48
+ end
49
+
50
+ describe "'O' method" do
51
+ it "should return an object that responds to 'o' by returning the original calling object" do
52
+ obj = Object.new
53
+ obj.O.o.should == obj
54
+ end
55
+ end
56
+
57
+ it "should add an 'o' method" do
58
+ Object.new.should.respond_to(:o)
59
+ end
60
+
61
+ describe "'o' method" do
62
+ it "should return an object that responds to 'O' by returning the original calling object" do
63
+ obj = Object.new
64
+ obj.o.O.should == obj
65
+ end
66
+ end
67
+
68
+ it "should allow 'O.o' as a line on its own" do
69
+ lambda { O.o }.should.not.raise
70
+ end
71
+
72
+ it "should allow 'o.O' as a line on its own" do
73
+ lambda { o.O }.should.not.raise
74
+ end
45
75
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nO_op
3
3
  version: !ruby/object:Gem::Version
4
- hash: 445
4
+ hash: 443
5
5
  prerelease: 2
6
6
  segments:
7
7
  - 1
8
8
  - O
9
9
  - O
10
- - 1
11
- version: 1.O.O.1
10
+ - 2
11
+ version: 1.O.O.2
12
12
  platform: ruby
13
13
  authors:
14
14
  - Yossef Mendelssohn