inny 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -3
  3. data/lib/inny.rb +6 -2
  4. data/lib/inny/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 230022bb5fe237f71c2c529f87772b1a7496a270
4
- data.tar.gz: 9e8700d2a71d366e6dd98466d3916d1ef3e920f5
3
+ metadata.gz: a1832093f1507e6f4b92bd68f259afec35d9d905
4
+ data.tar.gz: 2f2959ca7f95467eeec6d97f7875128fea9bea49
5
5
  SHA512:
6
- metadata.gz: 88de56660613f925ef94b41d2a442da3e2950855f15788aaef50714ce16d20ce80bc80f7e6c48d1796a2a99049823f383a6e28d86ffee2eac9e82d4c2203b352
7
- data.tar.gz: 5d731cf63e79a09c7484d072303320cc81f236d19a451114e5444ec9e68feeee54e0a8332d1fe37bc0a6dfd4b06226ce6ae158a599edf7a0f685efb8680ba542
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/[USERNAME]/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.
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?(*list)
5
- list.include?(self)
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
@@ -1,3 +1,3 @@
1
1
  module Inny
2
- VERSION = "1.0.0"
2
+ VERSION = "2.0.0"
3
3
  end
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: 1.0.0
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-21 00:00:00.000000000 Z
11
+ date: 2015-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler