lib/leftovers.rb in leftovers-0.8.0 vs lib/leftovers.rb in leftovers-0.9.0

- old
+ new

@@ -25,13 +25,15 @@ end autoload(:AST, "#{__dir__}/leftovers/ast") autoload(:CLI, "#{__dir__}/leftovers/cli") autoload(:Collector, "#{__dir__}/leftovers/collector") + autoload(:ComparableInstance, "#{__dir__}/leftovers/comparable_instance") autoload(:ConfigLoader, "#{__dir__}/leftovers/config_loader") autoload(:Config, "#{__dir__}/leftovers/config") autoload(:Definition, "#{__dir__}/leftovers/definition") + autoload(:DefinitionCollection, "#{__dir__}/leftovers/definition_collection") autoload(:DefinitionNode, "#{__dir__}/leftovers/definition_node") autoload(:DefinitionNodeSet, "#{__dir__}/leftovers/definition_node_set") autoload(:DefinitionSet, "#{__dir__}/leftovers/definition_set") autoload(:DefinitionToAdd, "#{__dir__}/leftovers/definition_to_add") autoload(:FileCollector, "#{__dir__}/leftovers/file_collector") @@ -44,12 +46,11 @@ autoload(:Precompilers, "#{__dir__}/leftovers/precompilers") autoload(:ProcessorBuilders, "#{__dir__}/leftovers/processor_builders") autoload(:RakeTask, "#{__dir__}/leftovers/rake_task") autoload(:Reporter, "#{__dir__}/leftovers/reporter") autoload(:TodoReporter, "#{__dir__}/leftovers/todo_reporter") - autoload(:DynamicProcessors, "#{__dir__}/leftovers/dynamic_processors") - autoload(:ValueProcessors, "#{__dir__}/leftovers/value_processors") + autoload(:Processors, "#{__dir__}/leftovers/processors") autoload(:VERSION, "#{__dir__}/leftovers/version") MEMOIZED_IVARS = %i{ @config @collector @@ -162,19 +163,9 @@ return enum_for(__method__, value) unless block case value when nil then nil when Array then value.each(&block) - else yield(value) - end - end - - def map_or_self(value, &block) - # return enum_for(__method__, value) unless block - - case value - when nil then nil - when Array then unwrap_array(value.flat_map(&block).compact) else yield(value) end end def unwrap_array(array)