naniyatsu 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/Gemfile.lock +1 -1
- data/README.md +29 -6
- data/lib/naniyatsu.rb +1 -0
- data/lib/naniyatsu/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: 34f792814d78a10d1130ece45d24061e4c946c74
|
4
|
+
data.tar.gz: b5fc33cdb159f52f8a0a56d79c5a5448952beb99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c1ea796eec2740625b5957e15456bc54041daf0a1badeba97fcd60f29f3378793dd5d3e20cd5f7ee0db975203ce2b7e1ad9e53e239cedd47f48d53f9ea8bfcd
|
7
|
+
data.tar.gz: 96143065dbabe60868b93a9edae993913e00ebcf870af5c9a5700b95d7de780ff4a5c8375cd2b2eb6f43a85124997c43f3baf24f70969df7cfc6c6e2d4f85ae9
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
# Naniyatsu
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
We are stupid.
|
4
|
+
We can't remember `instance_of?`, `kind_of?` and `is_a?` method.
|
6
5
|
|
7
6
|
## Installation
|
8
7
|
|
@@ -22,7 +21,31 @@ Or install it yourself as:
|
|
22
21
|
|
23
22
|
## Usage
|
24
23
|
|
25
|
-
|
24
|
+
```ruby
|
25
|
+
require 'naniyatsu'
|
26
|
+
|
27
|
+
class Hoge
|
28
|
+
extend Naniyatsu
|
29
|
+
end
|
30
|
+
|
31
|
+
class Fuga < Hoge
|
32
|
+
end
|
33
|
+
|
34
|
+
class Piyo < Fuga
|
35
|
+
end
|
36
|
+
|
37
|
+
Hoge.new.hoge? # => true
|
38
|
+
Fuga.new.hoge? # => true
|
39
|
+
Piyo.new.hoge? # => true
|
40
|
+
|
41
|
+
Hoge.new.fuga? # => false
|
42
|
+
Fuga.new.fuga? # => true
|
43
|
+
Piyo.new.fuga? # => true
|
44
|
+
|
45
|
+
Hoge.new.piyo? # => false
|
46
|
+
Fuga.new.piyo? # => false
|
47
|
+
Piyo.new.piyo? # => true
|
48
|
+
```
|
26
49
|
|
27
50
|
## Development
|
28
51
|
|
@@ -32,7 +55,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
55
|
|
33
56
|
## Contributing
|
34
57
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
58
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/takuan-oishii/naniyatsu. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
59
|
|
37
60
|
## License
|
38
61
|
|
@@ -40,4 +63,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
40
63
|
|
41
64
|
## Code of Conduct
|
42
65
|
|
43
|
-
Everyone interacting in the Naniyatsu project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
66
|
+
Everyone interacting in the Naniyatsu project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/takuan-oishii/naniyatsu/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/naniyatsu.rb
CHANGED
@@ -14,6 +14,7 @@ module Naniyatsu
|
|
14
14
|
klass.instance_variable_set :@root_naniyatsu_class, root_naniyatsu_class
|
15
15
|
klass.send(:define_method, naniyatsu_method_name(klass), -> { true })
|
16
16
|
root_naniyatsu_class.send(:define_method, naniyatsu_method_name(klass), -> { false })
|
17
|
+
super
|
17
18
|
end
|
18
19
|
|
19
20
|
def naniyatsu_method_name(klass)
|
data/lib/naniyatsu/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: naniyatsu
|
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
|
- takuan-oishii
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|