in_array 0.1.4 → 0.1.5
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.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/irbt.rb +20 -0
- data/lib/in_array.rb +2 -0
- data/lib/in_array/version.rb +1 -1
- data/rakefile.rb +5 -0
- data/tests/in_array_test.rb +7 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 319f3faf520405e8675f0e6779be8b8895494ab1
|
4
|
+
data.tar.gz: 4942d3c77f61a11c162d00c97fd534ea5249678c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8634d5780c3b61bdc45f7cb0c9a951fe6fda3d3d27a489a33f5ba8303e228aa5a92845900d8c795f6fb7cf080cd028ffc99ae7a4797069ddb28443d9de00a4c
|
7
|
+
data.tar.gz: e889618b96c516cff842b1220463496dfee30681ad9459bfb118f699b94100a312224f0f1a59b4840bac7e3a11b0236c656f07ff0617d936268adfba79722d23
|
data/README.md
CHANGED
@@ -41,6 +41,7 @@ Or install it yourself as:
|
|
41
41
|
|
42
42
|
$ gem install in_array
|
43
43
|
|
44
|
+
The in_array gem itself is found at: ( https://rubygems.org/gems/in_array )
|
44
45
|
|
45
46
|
## Usage
|
46
47
|
This is as simple as:
|
@@ -55,8 +56,8 @@ my_object.in_array.each do |option| #etc, etc, etc...
|
|
55
56
|
|
56
57
|
instead of
|
57
58
|
```ruby
|
58
|
-
|
59
|
-
|
59
|
+
my_object = [my_object] unless my_object.is_a?(Array)
|
60
|
+
my_object.each do |option| #etc, etc, etc...
|
60
61
|
```
|
61
62
|
|
62
63
|
#### Extending the Protocol
|
data/irbt.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# An IRB + in_array bed
|
3
|
+
|
4
|
+
require 'irb'
|
5
|
+
$force_alias_read_line_module = true
|
6
|
+
require 'mini_readline'
|
7
|
+
|
8
|
+
puts "Starting an IRB console with in_array loaded."
|
9
|
+
|
10
|
+
if ARGV[0] == 'local'
|
11
|
+
require_relative 'lib/in_array'
|
12
|
+
puts "in_array loaded locally: #{InArray::VERSION}"
|
13
|
+
|
14
|
+
ARGV.shift
|
15
|
+
else
|
16
|
+
require 'in_array'
|
17
|
+
puts "in_array loaded from gem: #{InArray::VERSION}"
|
18
|
+
end
|
19
|
+
|
20
|
+
IRB.start
|
data/lib/in_array.rb
CHANGED
data/lib/in_array/version.rb
CHANGED
data/rakefile.rb
CHANGED
data/tests/in_array_test.rb
CHANGED
@@ -7,6 +7,13 @@ class InArrayTester < Minitest::Test
|
|
7
7
|
#Track mini-test progress.
|
8
8
|
include MinitestVisible
|
9
9
|
|
10
|
+
def test_the_basics
|
11
|
+
assert(InArray, "The module InArray should exist.")
|
12
|
+
assert(InArrayAlready, "The module InArrayAlready should exist.")
|
13
|
+
|
14
|
+
assert_equal(String, InArray::VERSION.class)
|
15
|
+
end
|
16
|
+
|
10
17
|
def test_that_it_encapsulates_in_arrays
|
11
18
|
assert_equal(nil.in_array, [nil])
|
12
19
|
assert_equal('Hello'.in_array, ['Hello'])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: in_array
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Camilleri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest_visible
|
@@ -107,6 +107,7 @@ files:
|
|
107
107
|
- bench/complex_bench.rb
|
108
108
|
- bench/simple_bench.rb
|
109
109
|
- in_array.gemspec
|
110
|
+
- irbt.rb
|
110
111
|
- lib/in_array.rb
|
111
112
|
- lib/in_array/version.rb
|
112
113
|
- license.txt
|