repo.or.cz
/
monkeycharger.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
Upgraded Rails and RSpec
[monkeycharger.git]
/
vendor
/
plugins
/
rspec
/
examples
/
file_accessor.rb
blob
16bc45dbbef92cc30565e3dc874d067078a2f6a0
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
8
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]
16
17
accessor.open_and_handle_with(file, io_processor)
18
end