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:
Enabled: false
# I like 1.8 syntax:
HashSyntax:
Enabled: false
# And also have a differend opinion here
AndOr:
Enabled: false

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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