tapper 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -0
- data/lib/tapper/version.rb +1 -1
- data/lib/tapper.rb +23 -1
- data/tapper.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ee8004fcc78added957db525abb922976b3e594
|
4
|
+
data.tar.gz: 414bb32db8dabf5cf4927f7afc5aef732d981046
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aefa519fc683e8ef8c3c607f21349b33c95b60aa377c59521f3de713fb18af0c4dce6111ac98bb68f6ac96fe139da070fdde11acbbe48b57ea9670ebb5b85fb4
|
7
|
+
data.tar.gz: 35f86a2ec0cdbb3b9bc0223244236b9508259f8c018aa2430bc449f2b8b1eaffb0212fc97eb0c502bd0616c238f7dd406f7c86003c90368631b0586c84576fc1
|
data/Rakefile
CHANGED
data/lib/tapper/version.rb
CHANGED
data/lib/tapper.rb
CHANGED
@@ -1,5 +1,27 @@
|
|
1
1
|
require "tapper/version"
|
2
2
|
|
3
3
|
module Tapper
|
4
|
-
|
4
|
+
def self.included(base)
|
5
|
+
base.extend ClassMethods
|
6
|
+
end
|
7
|
+
|
8
|
+
module ClassMethods
|
9
|
+
def method_added(name)
|
10
|
+
return if private_method_defined?(name) || /_tap/.match?(name.to_s) || method_defined?("#{name}_without_tap")
|
11
|
+
|
12
|
+
method = <<-EOS
|
13
|
+
def #{name}_tap
|
14
|
+
tap { #{name}_without_tap }
|
15
|
+
end
|
16
|
+
EOS
|
17
|
+
|
18
|
+
self.class_eval(method)
|
19
|
+
|
20
|
+
aliased_method = "alias #{name}_without_tap #{name}"
|
21
|
+
self.class_eval(aliased_method)
|
22
|
+
|
23
|
+
aliased_method = "alias #{name} #{name}_tap"
|
24
|
+
self.class_eval(aliased_method)
|
25
|
+
end
|
26
|
+
end
|
5
27
|
end
|
data/tapper.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Yuji Yaginuma"]
|
10
10
|
spec.email = ["yuuji.yaginuma@gmail.com"]
|
11
11
|
|
12
|
-
spec.summary = %q{
|
12
|
+
spec.summary = %q{Tap all methods.}
|
13
13
|
spec.homepage = "https://github.com/y-yagi/tapper"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuji Yaginuma
|
@@ -94,5 +94,5 @@ rubyforge_project:
|
|
94
94
|
rubygems_version: 2.6.12
|
95
95
|
signing_key:
|
96
96
|
specification_version: 4
|
97
|
-
summary:
|
97
|
+
summary: Tap all methods.
|
98
98
|
test_files: []
|