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.
- data/History.txt +6 -0
- data/README.md +2 -0
- data/lib/nO_op.rb +22 -0
- data/spec/nO_op_spec.rb +30 -0
- metadata +3 -3
data/History.txt
CHANGED
data/README.md
CHANGED
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:
|
4
|
+
hash: 443
|
5
5
|
prerelease: 2
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- O
|
9
9
|
- O
|
10
|
-
-
|
11
|
-
version: 1.O.O.
|
10
|
+
- 2
|
11
|
+
version: 1.O.O.2
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Yossef Mendelssohn
|