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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7531b077fcb804478c96ffb873509019684844a6
4
- data.tar.gz: b05ea07a4b5883796f027982dabebc128779b3df
3
+ metadata.gz: 520f926db73c9d78ba7a890c1ce876a1a7fcb885
4
+ data.tar.gz: 9f354cb551ecdabac6032d79e76504bc4794ea65
5
5
  SHA512:
6
- metadata.gz: 763076b2b4cef7e2741ed9c5b68d63203167dad58005084239e4e939630fd71c226cc089e5c70cf78342ce78f826199165d7010bf077c3b184523ad3290c6a92
7
- data.tar.gz: de24bb099341e3538d1cf13d2b8e371914b2bdc96aedabdb275f68a1e8bff60ffad450efae6864f321accb9361882ab8cf158fd8087f0ea4170af32319a1bc04
6
+ metadata.gz: 3590d35f6a489b0dab07ada74a6fe1fa5b132371c0df9cec325e5fc08d4d9c4a2b36e5560b76165a9d36230c5fde33bceda6df58662ad92ef80e1fa5818beb7c
7
+ data.tar.gz: 0206d320d92c601a4dea212320357621c45817f0eab77d45140be49231e1403854f6abb4c2c6fb82042c7469c3467bea51e8ca1dc3c9c56d18301030a089791e
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013 kristenmills
1
+ Copyright (c) 2013 Kristen Mills
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # NightVision
2
2
 
3
- TODO: Write a gem description
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
- TODO: Write usage instructions here
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
- # Your code goes here...
5
- end
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
@@ -1,3 +1,3 @@
1
1
  module NightVision
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
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 = ["kristenmills"]
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.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
- - kristenmills
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.txt
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: {}