Use 1.9 style hash syntax where possible

This commit is contained in:
Markus Schirp 2013-09-07 20:27:06 +02:00
parent f4c8a47742
commit 9523c66726
10 changed files with 25 additions and 29 deletions

View file

@ -80,10 +80,6 @@ ConstantName:
TrivialAccessors: TrivialAccessors:
Enabled: false Enabled: false
# I like 1.8 syntax:
HashSyntax:
Enabled: false
# And also have a differend opinion here # And also have a differend opinion here
AndOr: AndOr:
Enabled: false Enabled: false

View file

@ -58,14 +58,14 @@ module Mutant
# #
def config def config
Config.new( Config.new(
:cache => @cache, cache: @cache,
:zombie => @zombie, zombie: @zombie,
:debug => debug?, debug: debug?,
:matcher => matcher, matcher: matcher,
:filter => filter, filter: filter,
:fail_fast => @fail_fast, fail_fast: @fail_fast,
:strategy => strategy, strategy: strategy,
:reporter => reporter reporter: reporter
) )
end end
memoize :config memoize :config

View file

@ -50,7 +50,7 @@ module Mutant
method.name == method_name method.name == method_name
end or raise NameError, "Cannot find method #{identifier}" end or raise NameError, "Cannot find method #{identifier}"
end end
memoize :method, :freezer => :noop memoize :method, freezer: :noop
# Return scope name # Return scope name
# #

View file

@ -117,7 +117,7 @@ module Mutant
def candidate_scope def candidate_scope
scope.singleton_class scope.singleton_class
end end
memoize :candidate_scope, :freezer => :noop memoize :candidate_scope, freezer: :noop
end # Singleton end # Singleton

View file

@ -9,8 +9,8 @@ module Mutant
class Binary < Node class Binary < Node
INVERSE = { INVERSE = {
:and => :or, and: :or,
:or => :and, or: :and
}.freeze }.freeze
handle(*INVERSE.keys) handle(*INVERSE.keys)

View file

@ -10,8 +10,8 @@ module Mutant
private private
MAP = { MAP = {
:true => :false, true: :false,
:false => :true false: :true
}.freeze }.freeze
handle(*MAP.keys) handle(*MAP.keys)

View file

@ -10,8 +10,8 @@ module Mutant
include AbstractType include AbstractType
MAP = { MAP = {
:irange => :erange, irange: :erange,
:erange => :irange erange: :irange
}.freeze }.freeze
children :start, :_end children :start, :_end

View file

@ -11,10 +11,10 @@ module Mutant
children :name, :value children :name, :value
MAP = IceNine.deep_freeze( MAP = IceNine.deep_freeze(
:gvasgn => '$', gvasgn: '$',
:cvasgn => '@@', cvasgn: '@@',
:ivasgn => '@', ivasgn: '@',
:lvasgn => '' lvasgn: ''
) )
handle(*MAP.keys) handle(*MAP.keys)

View file

@ -12,8 +12,8 @@ module Mutant
children :receiver, :selector children :receiver, :selector
SELECTOR_REPLACEMENTS = { SELECTOR_REPLACEMENTS = {
:send => :public_send, send: :public_send,
:gsub => :sub gsub: :sub
}.freeze }.freeze
INDEX_REFERENCE = :[] INDEX_REFERENCE = :[]

View file

@ -33,7 +33,7 @@ module Mutant
def configuration def configuration
RSpec::Core::Configuration.new RSpec::Core::Configuration.new
end end
memoize :configuration, :freezer => :noop memoize :configuration, freezer: :noop
# Return example groups # Return example groups
# #
@ -56,7 +56,7 @@ module Mutant
def world def world
RSpec.world RSpec.world
end end
memoize :world, :freezer => :noop memoize :world, freezer: :noop
# Return options # Return options
# #
@ -69,7 +69,7 @@ module Mutant
options.parse_options options.parse_options
options options
end end
memoize :options, :freezer => :noop memoize :options, freezer: :noop
end # Rspec end # Rspec
end # Strategy end # Strategy