inny 1.0.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -3
- data/lib/inny.rb +6 -2
- data/lib/inny/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: a1832093f1507e6f4b92bd68f259afec35d9d905
|
4
|
+
data.tar.gz: 2f2959ca7f95467eeec6d97f7875128fea9bea49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8091f3b21576ff0076f4a92270444cfb0631f0ff5b2722366f2a41c69316584762332a17a64285e290a64cba86e7e4a982d0e9bc2e67d2dea6ef4ca0e79901a
|
7
|
+
data.tar.gz: 3c2c2635eb174a8e8aa026a90a933e935fef25282dc8a084401ba8e3545612f3d4e7d781417eafb33cde31e3235842bde63ea30e7154e925c21441d042daf7e0
|
data/README.md
CHANGED
@@ -11,7 +11,7 @@ I'd much rather ask an object if it was in a list. It just feels like it's the
|
|
11
11
|
right way round:
|
12
12
|
|
13
13
|
```ruby
|
14
|
-
thing.in?('Egg', 'Bacon', 'Sausage')
|
14
|
+
thing.in?(['Egg', 'Bacon', 'Sausage'])
|
15
15
|
```
|
16
16
|
|
17
17
|
## Installation
|
@@ -37,7 +37,14 @@ Require Inny and then start testing your objects:
|
|
37
37
|
```ruby
|
38
38
|
require 'inny'
|
39
39
|
|
40
|
-
object.in?('Foo', 'Bar')
|
40
|
+
object.in?(['Foo', 'Bar'])
|
41
|
+
|
42
|
+
'Foo'.in?('Foobar')
|
43
|
+
|
44
|
+
5.in?(1..10)
|
45
|
+
|
46
|
+
list = [1, 2, 3]
|
47
|
+
puts "Yay!" if 2.in?(list)
|
41
48
|
```
|
42
49
|
|
43
50
|
## Development
|
@@ -48,7 +55,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
48
55
|
|
49
56
|
## Contributing
|
50
57
|
|
51
|
-
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/danbee/inny. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
52
59
|
|
53
60
|
|
54
61
|
## License
|
data/lib/inny.rb
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
require "inny/version"
|
2
2
|
|
3
3
|
module Inny
|
4
|
-
def in?(
|
5
|
-
|
4
|
+
def in?(object)
|
5
|
+
begin
|
6
|
+
object.include?(self)
|
7
|
+
rescue NoMethodError
|
8
|
+
raise ArgumentError.new("The parameter passed to #in? must respond to #include?")
|
9
|
+
end
|
6
10
|
end
|
7
11
|
end
|
8
12
|
|
data/lib/inny/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inny
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Barber
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|