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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b64461993e49705e2ac1a9509fbf66c1d34aeeb7
4
- data.tar.gz: 11a7b65b5d911d6bc6aa944d493890d9072ad1d9
3
+ metadata.gz: 2ee8004fcc78added957db525abb922976b3e594
4
+ data.tar.gz: 414bb32db8dabf5cf4927f7afc5aef732d981046
5
5
  SHA512:
6
- metadata.gz: ad1aa88ac2fdf270363852c8b5b70681b4e56f47b9852cc859b868c6a0d8472568e401b3f276b517502840573c37cb4d36e891af0ed2b02f42ebae3581787790
7
- data.tar.gz: 531684e72e7a6666d3b76c40b42aec2824cb9b13c43c42ded03434fbe09315bc6703af4a7adac20e73f1ac55572b068c6b00b836384f86f3787f58b3f658daf8
6
+ metadata.gz: aefa519fc683e8ef8c3c607f21349b33c95b60aa377c59521f3de713fb18af0c4dce6111ac98bb68f6ac96fe139da070fdde11acbbe48b57ea9670ebb5b85fb4
7
+ data.tar.gz: 35f86a2ec0cdbb3b9bc0223244236b9508259f8c018aa2430bc449f2b8b1eaffb0212fc97eb0c502bd0616c238f7dd406f7c86003c90368631b0586c84576fc1
data/Rakefile CHANGED
@@ -5,6 +5,7 @@ Rake::TestTask.new(:test) do |t|
5
5
  t.libs << "test"
6
6
  t.libs << "lib"
7
7
  t.test_files = FileList["test/**/*_test.rb"]
8
+ t.warning = true
8
9
  end
9
10
 
10
11
  task :default => :test
@@ -1,3 +1,3 @@
1
1
  module Tapper
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/tapper.rb CHANGED
@@ -1,5 +1,27 @@
1
1
  require "tapper/version"
2
2
 
3
3
  module Tapper
4
- # Your code goes here...
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{Write a short summary, because Rubygems requires one.}
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.1
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: Write a short summary, because Rubygems requires one.
97
+ summary: Tap all methods.
98
98
  test_files: []