night_vision 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{LICENSE.txt → LICENSE} +1 -1
- data/README.md +54 -2
- data/lib/night_vision.rb +21 -2
- data/lib/night_vision/version.rb +1 -1
- data/night_vision.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 520f926db73c9d78ba7a890c1ce876a1a7fcb885
|
4
|
+
data.tar.gz: 9f354cb551ecdabac6032d79e76504bc4794ea65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3590d35f6a489b0dab07ada74a6fe1fa5b132371c0df9cec325e5fc08d4d9c4a2b36e5560b76165a9d36230c5fde33bceda6df58662ad92ef80e1fa5818beb7c
|
7
|
+
data.tar.gz: 0206d320d92c601a4dea212320357621c45817f0eab77d45140be49231e1403854f6abb4c2c6fb82042c7469c3467bea51e8ca1dc3c9c56d18301030a089791e
|
data/{LICENSE.txt → LICENSE}
RENAMED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# NightVision
|
2
2
|
|
3
|
-
|
3
|
+
Peer through the darkness of running code.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -18,7 +18,59 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
|
21
|
+
class OddEven
|
22
|
+
def odd? n
|
23
|
+
n.odd?
|
24
|
+
end
|
25
|
+
|
26
|
+
def even? n
|
27
|
+
not odd? n
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
> o = OddEven.new
|
32
|
+
> o.odd? 1
|
33
|
+
=> false
|
34
|
+
> o.odd? 2
|
35
|
+
=> true
|
36
|
+
> NightVision.goggles(OddEven)
|
37
|
+
> o.odd? 1
|
38
|
+
------------------------------------------------
|
39
|
+
Invoking OddEven#odd?
|
40
|
+
Actual arguments are: [1]
|
41
|
+
------------------------------------------------
|
42
|
+
------------------------------------------------
|
43
|
+
Returning from OddEven#odd?
|
44
|
+
Return value is: true
|
45
|
+
------------------------------------------------
|
46
|
+
=> true
|
47
|
+
> o.odd? 2
|
48
|
+
------------------------------------------------
|
49
|
+
Invoking OddEven#odd?
|
50
|
+
Actual arguments are: [2]
|
51
|
+
------------------------------------------------
|
52
|
+
------------------------------------------------
|
53
|
+
Returning from OddEven#odd?
|
54
|
+
Return value is: false
|
55
|
+
------------------------------------------------
|
56
|
+
=> false
|
57
|
+
> o.even? 2
|
58
|
+
------------------------------------------------
|
59
|
+
Invoking Cheese#even2?
|
60
|
+
Actual arguments are: [6]
|
61
|
+
------------------------------------------------
|
62
|
+
------------------------------------------------
|
63
|
+
Invoking Cheese#odd2?
|
64
|
+
Actual arguments are: [6]
|
65
|
+
------------------------------------------------
|
66
|
+
------------------------------------------------
|
67
|
+
Returning from Cheese#odd2?
|
68
|
+
Return value is: false
|
69
|
+
------------------------------------------------
|
70
|
+
Returning from Cheese#even2?
|
71
|
+
Return value is: true
|
72
|
+
------------------------------------------------
|
73
|
+
=> true
|
22
74
|
|
23
75
|
## Contributing
|
24
76
|
|
data/lib/night_vision.rb
CHANGED
@@ -1,5 +1,24 @@
|
|
1
1
|
require "night_vision/version"
|
2
2
|
|
3
3
|
module NightVision
|
4
|
-
|
5
|
-
|
4
|
+
DIVIDER = "------------------------------------------------"
|
5
|
+
def self.goggles(*classes)
|
6
|
+
classes.each do |klass|
|
7
|
+
klass.instance_methods.each do |method|
|
8
|
+
m = klass.instance_method(method)
|
9
|
+
klass.send(:define_method, method) do |*args, &block|
|
10
|
+
puts DIVIDER
|
11
|
+
puts "Invoking #{m.owner}##{method}"
|
12
|
+
puts "Actual arguments are: #{args}"
|
13
|
+
puts DIVIDER
|
14
|
+
val = m.bind(self).(*args, &block)
|
15
|
+
puts DIVIDER
|
16
|
+
puts "Returning from #{m.owner}##{method}"
|
17
|
+
puts "Return value is: #{val}"
|
18
|
+
puts DIVIDER
|
19
|
+
val
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/night_vision/version.rb
CHANGED
data/night_vision.gemspec
CHANGED
@@ -6,11 +6,11 @@ require 'night_vision/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "night_vision"
|
8
8
|
spec.version = NightVision::VERSION
|
9
|
-
spec.authors = ["
|
9
|
+
spec.authors = ["Kristen Mills"]
|
10
10
|
spec.email = ["kristen@kristen-mills.com"]
|
11
11
|
spec.description = %q{Peer through the darkness of running code.}
|
12
12
|
spec.summary = %q{Peer through the darkness of running code.}
|
13
|
-
spec.homepage = ""
|
13
|
+
spec.homepage = "https://github.com/kristenmills/night_vision"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: night_vision
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Kristen Mills
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
@@ -47,13 +47,13 @@ extra_rdoc_files: []
|
|
47
47
|
files:
|
48
48
|
- .gitignore
|
49
49
|
- Gemfile
|
50
|
-
- LICENSE
|
50
|
+
- LICENSE
|
51
51
|
- README.md
|
52
52
|
- Rakefile
|
53
53
|
- lib/night_vision.rb
|
54
54
|
- lib/night_vision/version.rb
|
55
55
|
- night_vision.gemspec
|
56
|
-
homepage:
|
56
|
+
homepage: https://github.com/kristenmills/night_vision
|
57
57
|
licenses:
|
58
58
|
- MIT
|
59
59
|
metadata: {}
|