What about something like:

```Ruby
def parse_options
  @options = per_config { |options|
    filter_manager.include filter(:inclusion_filter, options)
    filter_manager.exclude filter(:exclusion_filter, options)
  }.inject { |config, options|
    config.merge(options) { |k, oldval, newval| [:libs, :requires].include?(k) ? oldval + newval : newval }
   }
end

def per_config(&block)
  (file_options << command_line_options << env_options).each(&block)
end

def filter(key, options)
  options.delete(key) if options.has_key?(key)
end
```

P.S. why are we iterating over twice with different keys? Is it an ordering thing?