Skip to content

Commit

Permalink
Correct rubocop issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rossta committed Jan 15, 2016
1 parent cf7fe60 commit d4d8982
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
12 changes: 5 additions & 7 deletions lib/montrose/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,14 @@ def merge(other)
self.class.new(h1.merge(h2))
end

def fetch(key, *args, &block)
def fetch(key, *args, &_block)
fail ArgumentError, "wrong number of arguments (#{args.length} for 1..2)" if args.length > 1
found = send(key)
return found if found
return args.first if args.length == 1
if block_given?
block.call
else
fail "Key #{key.inspect} not found"
end
fail "Key #{key.inspect} not found" unless block_given?

yield
end

def key?(key)
Expand Down Expand Up @@ -191,7 +189,7 @@ def nested_map_arg(arg, &block)
case arg
when Hash
arg.each_with_object({}) do |(k, v), hash|
hash[block.call(k)] = [*v]
hash[yield k] = [*v]
end
else
map_arg(arg, &block)
Expand Down
2 changes: 1 addition & 1 deletion lib/montrose/schedule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def <<(rule)

self
end
alias_method :add, :<<
alias add <<

def include?(time)
@rules.any? { |r| r.include?(time) }
Expand Down
2 changes: 1 addition & 1 deletion lib/montrose/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Montrose
VERSION = "0.1.0"
VERSION = "0.1.0".freeze
end

0 comments on commit d4d8982

Please sign in to comment.