changelog shortlog tags changeset manifest revisions annotate raw

vendor/plugins/rspec/examples/pure/file_accessor.rb

changeset 15: 64acf98d15f4
author: moriq@moriq.com
date: Mon Mar 10 10:12:58 2008 +0900 (16 years ago)
permissions: -rw-r--r--
description: add plugins rspec
1require File.dirname(__FILE__) + '/spec_helper'
2class FileAccessor
3 def open_and_handle_with(pathname, processor)
4 pathname.open do |io|
5 processor.process(io)
6 end
7 end
8end
9
10if __FILE__ == $0
11 require File.dirname(__FILE__) + '/io_processor'
12 require 'pathname'
13
14 accessor = FileAccessor.new
15 io_processor = IoProcessor.new
16 file = Pathname.new ARGV[0]
17
18 accessor.open_and_handle_with(file, io_processor)
19end