tapper 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +26 -4
- data/lib/tapper.rb +1 -1
- data/lib/tapper/version.rb +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: 686b5b9d1736e360cbde35bb0390921320b725e0
|
4
|
+
data.tar.gz: b4696b2dba3112fb01b9c09271cde0050a7a09a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f453bd2d92021a34592c9e35a484640096bede5ec65f488bc79d481f2accfecfd782530aa3fc2224a54ebe4967c8c70215227373012ff773af0b5dc8c09b0c44
|
7
|
+
data.tar.gz: 3a394e052381b59e559a68e8b1f8e5a0410ac3ccb1fa9e380d0ec0afdc355d1605e6bcb6a2ad8f20d4142987556c7b13439593236a33543027a4898b925e8ac6
|
data/README.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# Tapper
|
2
2
|
|
3
|
-
|
3
|
+
[![Build Status](https://travis-ci.org/y-yagi/tapper.svg?branch=master)](https://travis-ci.org/y-yagi/tapper)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/tapper.svg)](http://badge.fury.io/rb/tapper)
|
5
|
+
|
6
|
+
`Tapper` taps the invocation of the public method. This means that all methods can be used with chain.
|
4
7
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
8
|
|
7
9
|
## Installation
|
8
10
|
|
@@ -22,7 +24,27 @@ Or install it yourself as:
|
|
22
24
|
|
23
25
|
## Usage
|
24
26
|
|
25
|
-
|
27
|
+
```ruby
|
28
|
+
class User
|
29
|
+
attr_accessor :name, :gender
|
30
|
+
|
31
|
+
include Tapper
|
32
|
+
|
33
|
+
def taro
|
34
|
+
self.name = "taro"
|
35
|
+
end
|
36
|
+
|
37
|
+
def man
|
38
|
+
self.gender = :man
|
39
|
+
end
|
40
|
+
end
|
41
|
+
```
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
user = User.new.taro.man
|
45
|
+
user.name # => "taro"
|
46
|
+
```
|
47
|
+
|
26
48
|
|
27
49
|
## Development
|
28
50
|
|
@@ -40,4 +62,4 @@ The gem is available as open source under the terms of the [MIT License](http://
|
|
40
62
|
|
41
63
|
## Code of Conduct
|
42
64
|
|
43
|
-
Everyone interacting in the Tapper project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
65
|
+
Everyone interacting in the Tapper project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/y-yagi/tapper/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/tapper.rb
CHANGED
@@ -7,7 +7,7 @@ module Tapper
|
|
7
7
|
|
8
8
|
module ClassMethods
|
9
9
|
def method_added(name)
|
10
|
-
return if private_method_defined?(name) || /_tap/.match
|
10
|
+
return if private_method_defined?(name) || /_tap/.match(name.to_s) || method_defined?("#{name}_without_tap")
|
11
11
|
|
12
12
|
method = <<-EOS
|
13
13
|
def #{name}_tap
|
data/lib/tapper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuji Yaginuma
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|