lib/jm/dsl/syncer.rb
# Push the `source` through all registered syncers into `target`
Push the `source` through all registered syncers into `target`
Push the ` source ` through all registered syncers into ` target `
def push(source, target, options = {}, context = {})
        init = [target, Failure.new]
        obj, failure = @syncers.reduce(init) do |(t, f), syncer|
          res = syncer.push(source, t, options, context)
          case res
          when Success then [res.value, f]
          when Failure then [t, f + res]
          end
        end
        if failure.errors.length > 0
          failure
        else
          Success.new(obj)
        end
      end
def push ( source , target , options = { } , context = { } ) init = [ target , Failure . new ] obj , failure = @syncers . reduce ( init ) do | ( t , f ) , syncer | res = syncer . push ( source , t , options , context ) case res when Success then [ res . value , f ] when Failure then [ t , f + res ] end end if failure . errors . length > 0 failure else Success . new ( obj ) end end
Push the `source` through all registered syncers into `target`
Push the ` source ` through all registered syncers into ` target `
source
target
options
context