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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c50a4a5a4470841c239dee6447b289e83c9a796
4
- data.tar.gz: ba55942db205601a0a3f7bd81f04d203f23b6180
3
+ metadata.gz: d409324bf13472589d93245426c13935e5a414ec
4
+ data.tar.gz: 54afefd23a8a6bf6fdc5d5bb95060255038b2fed
5
5
  SHA512:
6
- metadata.gz: f260a577433a028da3017aee22ddae4008587ffbb29fc7a52010aac9137060723004178887367cba8765f446bf0738e73d1bf44d79a00aba6806846b143ed989
7
- data.tar.gz: 1178efe9a6c7b04af9880a0d263edab852fe9dc0c69e9890ccf5684654860632ed9d486478ea8d5023f59f679c40594f8055028369962cad3a4375e5d44330ab
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
@@ -2,3 +2,4 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in izzy.gemspec
4
4
  gemspec
5
+ gem 'coveralls', require: false
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 is_older_than_18?
19
+ def older_than_18?
16
20
  @age > 18
17
21
  end
18
22
 
19
- def is_younger_than_18?
23
+ def younger_than_18?
20
24
  @age < 18
21
25
  end
22
26
 
23
- def is_male?
27
+ def male?
24
28
  @sex == 'm'
25
29
  end
26
30
 
27
- def is_female?
31
+ def female?
28
32
  @sex == 'f'
29
33
  end
30
34
 
31
- def is_me?
35
+ def me?
32
36
  @name == 'brandon' && @sex == 'm'
33
37
  end
34
38
 
35
- def is_geek?
39
+ def geek?
36
40
  @name == 'brandon'
37
41
  end
38
42
  end
data/Rakefile CHANGED
@@ -1 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/lib/izzy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Izzy
2
- VERSION = '1.0.0'
2
+ VERSION = '1.1.0'
3
3
  end
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 = "is_#{method}?".to_sym) && self.respond_to?(m) && self.send(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 = "is_#{method}?".to_sym) && self.respond_to?(m) && self.send(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 = "is_#{method}?".to_sym) && self.respond_to?(m) && self.send(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 is_older_than_18?
10
+ def older_than_18?
11
11
  @age > 18
12
12
  end
13
13
 
14
- def is_younger_than_18?
14
+ def younger_than_18?
15
15
  @age < 18
16
16
  end
17
17
 
18
- def is_male?
18
+ def male?
19
19
  @sex.eql? 'm'
20
20
  end
21
21
 
22
- def is_female?
22
+ def female?
23
23
  @sex.eql? 'f'
24
24
  end
25
25
 
26
- def is_me?
26
+ def me?
27
27
  @name.eql?('brandon') && @sex.eql?('m')
28
28
  end
29
29
 
30
- def is_geek?
30
+ def geek?
31
31
  @name.eql? 'brandon'
32
32
  end
33
33
  end
data/spec/spec_helper.rb CHANGED
@@ -3,6 +3,9 @@ require 'bundler/setup'
3
3
 
4
4
  require 'izzy'
5
5
 
6
+ require 'coveralls'
7
+ Coveralls.wear!
8
+
6
9
  RSpec.configure do |config|
7
10
  # some (optional) config here
8
11
  end
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.0.0
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