izzy 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.coveralls.yml +1 -0
- data/.travis.yml +1 -0
- data/Gemfile +1 -0
- data/README.md +10 -6
- data/Rakefile +5 -0
- data/lib/izzy/version.rb +1 -1
- data/lib/izzy.rb +3 -3
- data/spec/izzy_spec.rb +6 -6
- data/spec/spec_helper.rb +3 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d409324bf13472589d93245426c13935e5a414ec
|
4
|
+
data.tar.gz: 54afefd23a8a6bf6fdc5d5bb95060255038b2fed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48a23c6a6ccc82003e5b4633b1cc6b5f0d802bb5c8fc123eb85ce2591597764f9c2b0de482ddbb6cdfa002a6cad47ad7e144717b63f5022f08b5ae6a75084cdf
|
7
|
+
data.tar.gz: 46ff3fc60270dc12790b088d8f9dd97c5e4dea81c8411dc5a58a6e655c0e4aedb35bb53f49b886b8584e7511b11b620d77e0af7391080b68019dfaa29c93480d
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service_name: travis-ci
|
data/.travis.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
language: ruby
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
# Izzy
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/baweaver/izzy.png?branch=master)](https://travis-ci.org/baweaver/izzy)
|
4
|
+
[![Coverage Status](https://coveralls.io/repos/baweaver/izzy/badge.png?branch=master)](https://coveralls.io/r/baweaver/izzy?branch=master)
|
5
|
+
|
3
6
|
Monkey patch to object to make for a nicer time of conditionals! Just install the gem and you're ready to go!
|
4
7
|
|
8
|
+
|
5
9
|
Let's take our class, Person:
|
6
10
|
|
7
11
|
```ruby
|
@@ -12,27 +16,27 @@ class Person
|
|
12
16
|
@sex = sex
|
13
17
|
end
|
14
18
|
|
15
|
-
def
|
19
|
+
def older_than_18?
|
16
20
|
@age > 18
|
17
21
|
end
|
18
22
|
|
19
|
-
def
|
23
|
+
def younger_than_18?
|
20
24
|
@age < 18
|
21
25
|
end
|
22
26
|
|
23
|
-
def
|
27
|
+
def male?
|
24
28
|
@sex == 'm'
|
25
29
|
end
|
26
30
|
|
27
|
-
def
|
31
|
+
def female?
|
28
32
|
@sex == 'f'
|
29
33
|
end
|
30
34
|
|
31
|
-
def
|
35
|
+
def me?
|
32
36
|
@name == 'brandon' && @sex == 'm'
|
33
37
|
end
|
34
38
|
|
35
|
-
def
|
39
|
+
def geek?
|
36
40
|
@name == 'brandon'
|
37
41
|
end
|
38
42
|
end
|
data/Rakefile
CHANGED
data/lib/izzy/version.rb
CHANGED
data/lib/izzy.rb
CHANGED
@@ -2,14 +2,14 @@ require 'izzy/version'
|
|
2
2
|
|
3
3
|
class Object
|
4
4
|
def all_of?(*methods)
|
5
|
-
methods.all? { |method| (m = "
|
5
|
+
methods.all? { |method| (m = "#{method}?".to_sym) && self.respond_to?(m) && self.send(m) }
|
6
6
|
end
|
7
7
|
|
8
8
|
def any_of?(*methods)
|
9
|
-
methods.any? { |method| (m = "
|
9
|
+
methods.any? { |method| (m = "#{method}?".to_sym) && self.respond_to?(m) && self.send(m) }
|
10
10
|
end
|
11
11
|
|
12
12
|
def none_of?(*methods)
|
13
|
-
methods.none? { |method| (m = "
|
13
|
+
methods.none? { |method| (m = "#{method}?".to_sym) && self.respond_to?(m) && self.send(m) }
|
14
14
|
end
|
15
15
|
end
|
data/spec/izzy_spec.rb
CHANGED
@@ -7,27 +7,27 @@ class Person
|
|
7
7
|
@sex = sex
|
8
8
|
end
|
9
9
|
|
10
|
-
def
|
10
|
+
def older_than_18?
|
11
11
|
@age > 18
|
12
12
|
end
|
13
13
|
|
14
|
-
def
|
14
|
+
def younger_than_18?
|
15
15
|
@age < 18
|
16
16
|
end
|
17
17
|
|
18
|
-
def
|
18
|
+
def male?
|
19
19
|
@sex.eql? 'm'
|
20
20
|
end
|
21
21
|
|
22
|
-
def
|
22
|
+
def female?
|
23
23
|
@sex.eql? 'f'
|
24
24
|
end
|
25
25
|
|
26
|
-
def
|
26
|
+
def me?
|
27
27
|
@name.eql?('brandon') && @sex.eql?('m')
|
28
28
|
end
|
29
29
|
|
30
|
-
def
|
30
|
+
def geek?
|
31
31
|
@name.eql? 'brandon'
|
32
32
|
end
|
33
33
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: izzy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Weaver
|
@@ -59,8 +59,10 @@ executables: []
|
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
+
- .coveralls.yml
|
62
63
|
- .gitignore
|
63
64
|
- .rspec
|
65
|
+
- .travis.yml
|
64
66
|
- Gemfile
|
65
67
|
- LICENSE.txt
|
66
68
|
- README.md
|