Upgraded Rails and RSpec
[monkeycharger.git] / vendor / plugins / rspec / examples / file_accessor.rb
blob16bc45dbbef92cc30565e3dc874d067078a2f6a0
1 class FileAccessor
2   def open_and_handle_with(pathname, processor)
3     pathname.open do |io|
4       processor.process(io)
5     end
6   end
7 end
9 if __FILE__ == $0
10   require File.dirname(__FILE__) + '/io_processor'
11   require 'pathname'
12   
13   accessor = FileAccessor.new
14   io_processor = IoProcessor.new
15   file = Pathname.new ARGV[0]
17   accessor.open_and_handle_with(file, io_processor)
18 end