Skip to content

Commit

Permalink
Fixing rubocop offenses.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui Nunes committed Oct 4, 2016
1 parent 2320e03 commit b8ee132
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: ruby
rvm:
- ruby-head
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.0
Expand Down
2 changes: 1 addition & 1 deletion lib/utilise/augment/bool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Bool
# @return [Object] returns object boolean
def to_bool(object = self)
case object
when String, Fixnum, Symbol
when String, Integer, Symbol
bool_it object
when Hash
bool_hash object
Expand Down
2 changes: 1 addition & 1 deletion lib/utilise/augment/crash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Crash
class Bash < Hashie::Mash
# The default proc to be used for the bash hash
DEFAULT_PROC = lambda do |hash, key|
fail NameError, "No key '#{key}' in #{hash.to_hash.inspect}"
raise NameError, "No key '#{key}' in #{hash.to_hash.inspect}"
end

def initialize(source_hash = nil, default = nil, &blk)
Expand Down
4 changes: 2 additions & 2 deletions lib/utilise/augment/matchers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ module Augment
# Extends classes that could be queried as a boolean
module Matchers
def bool?
self.is_a?(TrueClass) || self.is_a?(FalseClass)
is_a?(TrueClass) || is_a?(FalseClass)
end

# NOTE: This keeps backwards compatibility
alias_method :is_bool?, :bool?
alias is_bool? bool?
end
end
end
2 changes: 1 addition & 1 deletion lib/utilise/fixnum.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'utilise/augment/bool'

# Extend existing ruby class Fixnum
class Fixnum
class Integer
include Utilise::Augment::Bool
end
6 changes: 3 additions & 3 deletions lib/utilise/version.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Utilise
module Utilise
# The current gem version
VERSION = '1.0.0'
VERSION = '1.0.0'.freeze
# The version update date
DATE = '2015-10-06'
DATE = '2015-10-06'.freeze
# Debug output message
MSG = 'Version %s %s (running on %s-%s)'
MSG = 'Version %s %s (running on %s-%s)'.freeze

module_function

Expand Down
2 changes: 1 addition & 1 deletion spec/utilise/fixnum_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper'

describe Fixnum do
describe Integer do
describe '#to_bool' do
it 'returns true when 1' do
expect(1.to_bool).to be true
Expand Down
2 changes: 1 addition & 1 deletion spec/utilise/time_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
end

it 'returns a string number' do
expect(Time.unique.to_i.class).to be Fixnum
expect(Time.unique).to match(/\d+/)
end

it 'returns a number from time to 3 decimal places' do
Expand Down

0 comments on commit b8ee132

Please sign in to comment.