Last change
on this file since 301 was 168, checked in by KOBAYASHI, Shinji, 15 years ago |
roll back branch 0.0
|
File size:
784 bytes
|
Line | |
---|
1 | $:.unshift File.join(File.dirname(__FILE__))
|
---|
2 | require 'validator.rb'
|
---|
3 | require 'stringio'
|
---|
4 |
|
---|
5 | module 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
|
---|
34 | end
|
---|
35 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.