Skip to content

Commit

Permalink
Merge pull request #499 from mbj/fix/style
Browse files Browse the repository at this point in the history
Fix style
  • Loading branch information
dkubb committed Nov 23, 2015
2 parents 9001f5e + b7fdf84 commit 9e3d531
Show file tree
Hide file tree
Showing 148 changed files with 184 additions and 1,176 deletions.
24 changes: 12 additions & 12 deletions lib/mutant.rb
Expand Up @@ -23,6 +23,8 @@
Thread.abort_on_exception = true

# Library namespace
#
# @api private
module Mutant
EMPTY_STRING = ''.freeze
EMPTY_ARRAY = [].freeze
Expand All @@ -32,8 +34,6 @@ module Mutant
# Test if CI is detected via environment
#
# @return [Boolean]
#
# @api private
def self.ci?
ENV.key?('CI')
end
Expand Down Expand Up @@ -192,22 +192,22 @@ class Config

DEFAULT = new(
debug: false,
fail_fast: false,
integration: Integration::Null,
matcher: Matcher::Config::DEFAULT,
includes: EMPTY_ARRAY,
requires: EMPTY_ARRAY,
isolation: Mutant::Isolation::Fork,
reporter: Reporter::CLI.build($stdout),
zombie: false,
jobs: Mutant.ci? ? CI_DEFAULT_PROCESSOR_COUNT : ::Parallel.processor_count,
expected_coverage: Rational(1),
expression_parser: Expression::Parser.new([
Expression::Method,
Expression::Methods,
Expression::Namespace::Exact,
Expression::Namespace::Recursive
])
]),
fail_fast: false,
includes: EMPTY_ARRAY,
integration: Integration::Null,
isolation: Mutant::Isolation::Fork,
jobs: Mutant.ci? ? CI_DEFAULT_PROCESSOR_COUNT : ::Parallel.processor_count,
matcher: Matcher::Config::DEFAULT,
requires: EMPTY_ARRAY,
reporter: Reporter::CLI.build($stdout),
zombie: false
)
end # Config
end # Mutant
6 changes: 0 additions & 6 deletions lib/mutant/actor.rb
Expand Up @@ -13,8 +13,6 @@ class ProtocolError < RuntimeError
# Object inspection
#
# @return [String]
#
# @api private
def inspect
INSPECT
end
Expand All @@ -30,8 +28,6 @@ class Message
# @param [Object] payload
#
# @return [Message]
#
# @api private
def self.new(_type, _payload = Undefined)
super
end
Expand All @@ -47,8 +43,6 @@ class Binding
# @param [Symbol] type
#
# @return [Object]
#
# @api private
def call(type)
other.call(Message.new(type, mailbox.sender))
message = mailbox.receiver.call
Expand Down
4 changes: 0 additions & 4 deletions lib/mutant/actor/env.rb
Expand Up @@ -7,8 +7,6 @@ class Env
# Spawn a new actor executing block
#
# @return [Actor::Sender]
#
# @api private
def spawn
mailbox = new_mailbox

Expand All @@ -22,8 +20,6 @@ def spawn
# New unbound mailbox
#
# @return [Mailbox]
#
# @api private
def new_mailbox
Mailbox.new
end
Expand Down
4 changes: 0 additions & 4 deletions lib/mutant/actor/mailbox.rb
Expand Up @@ -7,8 +7,6 @@ class Mailbox
# New mailbox
#
# @return [Mailbox]
#
# @api private
def self.new
mutex = Mutex.new
condition_variable = ConditionVariable.new
Expand All @@ -25,8 +23,6 @@ def self.new
# @param [Actor::Sender] other
#
# @return [Binding]
#
# @api private
def bind(other)
Binding.new(self, other)
end
Expand Down
4 changes: 0 additions & 4 deletions lib/mutant/actor/receiver.rb
Expand Up @@ -7,8 +7,6 @@ class Receiver
# Receives a message, blocking
#
# @return [Object]
#
# @api private
def call
2.times do
message = try_blocking_receive
Expand All @@ -26,8 +24,6 @@ def call
#
# @return [Object]
# if there is a message
#
# @api private
def try_blocking_receive
mutex.synchronize do
if messages.empty?
Expand Down
2 changes: 0 additions & 2 deletions lib/mutant/actor/sender.rb
Expand Up @@ -10,8 +10,6 @@ class Sender
# @param [Object] message
#
# @return [self]
#
# @api private
def call(message)
mutex.synchronize do
messages << message
Expand Down
4 changes: 0 additions & 4 deletions lib/mutant/ast.rb
Expand Up @@ -14,8 +14,6 @@ module AST
#
# @return [nil]
# otherwise
#
# @api private
def self.find_last_path(node, &predicate)
fail ArgumentError, 'block expected' unless block_given?
path = []
Expand All @@ -36,8 +34,6 @@ def self.find_last_path(node, &predicate)
# all nodes visited recursively including root
#
# @return [undefined]
#
# @api private
def self.walk(node, stack, &block)
block.call(node, stack)
node.children.grep(::Parser::AST::Node) do |child|
Expand Down
2 changes: 0 additions & 2 deletions lib/mutant/ast/meta/const.rb
Expand Up @@ -12,8 +12,6 @@ class Const
# Test if AST node is possibly a top level constant
#
# @return [Boolean]
#
# @api private
def possible_top_level?
base.nil? || n_cbase?(base)
end
Expand Down
2 changes: 0 additions & 2 deletions lib/mutant/ast/meta/optarg.rb
Expand Up @@ -14,8 +14,6 @@ class Optarg
# Test if optarg definition intends to be used
#
# @return [Boolean]
#
# @api private
def used?
!name.to_s.start_with?(UNDERSCORE)
end
Expand Down
12 changes: 0 additions & 12 deletions lib/mutant/ast/meta/send.rb
Expand Up @@ -15,24 +15,18 @@ class Send
# Arguments of mutated node
#
# @return [Enumerable<Parser::AST::Node>]
#
# @api private
alias_method :arguments, :remaining_children

# Test if AST node is a valid assignment target
#
# @return [Boolean]
#
# @api private
def assignment?
index_assignment? || attribute_assignment?
end

# Test if AST node is an attribute assignment?
#
# @return [Boolean]
#
# @api private
def attribute_assignment?
!Types::METHOD_OPERATORS.include?(selector) &&
selector.to_s.end_with?(ATTRIBUTE_ASSIGNMENT_SELECTOR_SUFFIX)
Expand All @@ -41,26 +35,20 @@ def attribute_assignment?
# Test if AST node is an index assign
#
# @return [Boolean]
#
# @api private
def index_assignment?
selector.equal?(INDEX_ASSIGNMENT_SELECTOR)
end

# Test for binary operator implemented as method
#
# @return [Boolean]
#
# @api private
def binary_method_operator?
Types::BINARY_METHOD_OPERATORS.include?(selector)
end

# Test if receiver is possibly a top level constant
#
# @return [Boolean]
#
# @api private
def receiver_possible_top_level_const?
return false unless receiver && n_const?(receiver)

Expand Down
10 changes: 0 additions & 10 deletions lib/mutant/ast/named_children.rb
Expand Up @@ -9,8 +9,6 @@ module NamedChildren
# @param [Class, Module] host
#
# @return [undefined]
#
# @api private
def self.included(host)
host.class_eval do
include InstanceMethods
Expand All @@ -26,8 +24,6 @@ module InstanceMethods
# Mutated nodes children
#
# @return [Array<Parser::AST::Node]
#
# @api private
def children
node.children
end
Expand All @@ -45,8 +41,6 @@ module ClassMethods
# @param [Fixnum] index
#
# @return [undefined]
#
# @api private
def define_named_child(name, index)
define_method(name) do
children.at(index)
Expand All @@ -58,8 +52,6 @@ def define_named_child(name, index)
# @param [Array<Symbol>] names
#
# @return [undefined]
#
# @api private
def define_remaining_children(names)
define_method(:remaining_children_with_index) do
children.each_with_index.drop(names.length)
Expand All @@ -77,8 +69,6 @@ def define_remaining_children(names)
# Create name helpers
#
# @return [undefined]
#
# @api private
def children(*names)
names.each_with_index do |name, index|
define_named_child(name, index)
Expand Down
4 changes: 0 additions & 4 deletions lib/mutant/ast/sexp.rb
Expand Up @@ -10,8 +10,6 @@ module Sexp
# @param [Symbol] type
#
# @return [Parser::AST::Node]
#
# @api private
def s(type, *children)
::Parser::AST::Node.new(type, children)
end
Expand All @@ -21,8 +19,6 @@ def s(type, *children)
# @param [Parser::AST::Node] node
#
# @return [Parser::AST::Node]
#
# @api private
def n_not(node)
s(:send, node, :!)
end
Expand Down

0 comments on commit 9e3d531

Please sign in to comment.