source: ruby/trunk/lib/adl_parser/lib/shell.rb@ 164

Last change on this file since 164 was 164, checked in by KOBAYASHI, Shinji, 15 years ago

simple terminology commit

File size: 783 bytes
Line 
1$:.unshift File.join(File.dirname(__FILE__))
2require 'validator.rb'
3require 'stringio'
4
5module OpenEHR
6 module Application
7 class Shell
8 def run
9 raise 'not implemented'
10 end
11 end
12
13 class ADLValidator < Shell
14 def initialize(validator)
15 @validator = validator
16 end
17
18 def run(input, name = nil)
19 input_stream = case input
20 when String
21 StringIO.new(input)
22 when File
23 input
24 when StringIO
25 input
26 else
27 raise
28 end
29 @validator.validate(input_stream.read, name)
30 input_stream.close
31 end
32 end
33 end
34end
Note: See TracBrowser for help on using the repository browser.