src/parser.rb
# Split given partial ranges into even and odd print jobs
# @param splits [Array] collection of pages per sheet.
Split given partial ranges into even and odd print jobs
Split given partial ranges into even and odd print jobs
def even_odd_half_of(splits)
    odd = splits.select.with_index{|_,i| (i+1) % 2 == 1}
    even = splits.select.with_index{|_,i| (i+1) % 2 == 0}
    even.reverse!
    [odd, even]
  end
def even_odd_half_of ( splits ) odd = splits . select . with_index { | _ , i | ( i + 1 ) % 2 == 1 } even = splits . select . with_index { | _ , i | ( i + 1 ) % 2 == 0 } even . reverse! [ odd , even ] end
Split given partial ranges into even and odd print jobs
Split given partial ranges into even and odd print jobs
# necessary to reverse order of 2nd half # otherwise someone would have to manually reverse # all the printed pages after having printed # the first half of the document.
splits
collection of pages per sheet.
collection of pages per sheet .