lis 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
data/bin/lis CHANGED
@@ -1,8 +1,46 @@
1
1
  #!/usr/bin/env ruby
2
- require 'gli'
3
-
4
2
  require 'lis'
5
3
  require 'lis/cli'
6
4
 
7
- exit LIS::CLI.run(ARGV.dup)
5
+ Main {
6
+ version LIS::VERSION
7
+ description "LIS interface to Siemens Immulite 2000XPi or other similar analyzers"
8
+
9
+ option('verbose', 'v')
10
+
11
+ logger.formatter = proc { |severity, datetime, progname, msg|
12
+ "#{severity}: #{msg}\n"
13
+ }
14
+
15
+ mode "server" do
16
+ argument('port') {
17
+ default "/dev/ttyUSB0"
18
+ }
19
+
20
+ argument('http', 'e') do
21
+ cast :uri
22
+ end
23
+
24
+
25
+ def run
26
+ $VERBOSE = true if params[:verbose].given?
27
+ portname = params[:port].value
28
+ uri = params[:http].value
29
+
30
+ info "configuring port: #{portname} for 9600 baud"
31
+ `stty -echo raw ospeed 9600 ispeed 9600 < #{portname}`
32
+
33
+ port = File.open(portname, "w+")
34
+
35
+ warn "listening on: #{portname}"
36
+ warn "http: #{uri.to_s}"
37
+
38
+ LIS::InterfaceServer.listen(port, uri).run!
39
+
40
+
41
+ end
42
+ end
43
+
44
+ }
45
+
8
46
 
@@ -2,5 +2,5 @@ Feature: My bootstrapped app kinda works
2
2
 
3
3
  Scenario: App just runs
4
4
  When I get help for "lis"
5
- Then the exit status should be 0
5
+ Then the exit status should be 1
6
6
 
@@ -1,6 +1,6 @@
1
1
  When /^I get help for "([^"]*)"$/ do |app_name|
2
2
  @app_name = app_name
3
- step %(I run `#{app_name} --help`)
3
+ step %(I run `#{app_name} server help`)
4
4
  end
5
5
 
6
6
  # Add more step definitions here
data/lib/lis/cli.rb CHANGED
@@ -1,47 +1,6 @@
1
+ require 'main'
2
+
1
3
  module LIS
2
4
  module CLI
3
- extend GLI::App
4
- program_desc "LIS interface to Siemens Immulite 2000XPi or other similar analyzers"
5
- version LIS::VERSION
6
-
7
- flag ["config","c"], :default_value => File.join(ENV['HOME'],'.lis'),
8
- :desc => "stores configuration and authentication data",
9
- :arg_name => "FILE"
10
-
11
- flag ["listen", "l"], :arg_name => "PORT", :desc => "which port to listen on", :default_value => "/dev/ttyUSB0"
12
- flag ["endpoint", "e"], :arg_name => "URI", :desc => "HTTP endpoint", :default_value => "http://localhost/api/lis"
13
- switch ["verbose", "v"], :desc => "Increase verbosity"
14
-
15
- pre do |global_options,command,options,args|
16
- $VERBOSE = global_options[:verbose]
17
- true
18
- end
19
-
20
- desc "run the LIS server"
21
- command "server" do |c|
22
- c.action do |global_options,options,args|
23
- port = global_options[:listen]
24
- warn "configuring #{port}"
25
- `stty -echo raw ospeed 9600 ispeed 9600 < #{port}`
26
- warn "listening on: #{port}"
27
- port = File.open(port, "w+")
28
-
29
- LIS::InterfaceServer.listen(port, global_options[:endpoint]).run!
30
- end
31
- end
32
-
33
- desc "load a list of test requests"
34
- arg_name "DEVICE_NAME REQUEST_ID"
35
- command "requests" do |c|
36
- c.action do |global_options,options,args|
37
-
38
- req = LIS::HTTPInterface.new(global_options[:endpoint]).load_requests(*args)
39
- puts req.types
40
- end
41
-
42
-
43
- end
44
-
45
-
46
5
  end
47
6
  end
data/lib/lis/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module LIS
4
- VERSION = "0.4.3"
4
+ VERSION = "0.4.4"
5
5
  end
6
6
 
data/lis.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
23
23
  s.add_dependency "packet_io", ">= 0.4.2"
24
24
  s.add_dependency "rest-client"
25
25
  s.add_dependency "rake"
26
- s.add_dependency "gli", ">= 2.0.0.rc5"
26
+ s.add_dependency "main"
27
27
 
28
28
  s.add_development_dependency("shoulda", ">= 3.1.0")
29
29
  s.add_development_dependency("mocha", ">= 0.12.0")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -60,13 +60,13 @@ dependencies:
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  - !ruby/object:Gem::Dependency
63
- name: gli
63
+ name: main
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
67
67
  - - ! '>='
68
68
  - !ruby/object:Gem::Version
69
- version: 2.0.0.rc5
69
+ version: '0'
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -74,7 +74,7 @@ dependencies:
74
74
  requirements:
75
75
  - - ! '>='
76
76
  - !ruby/object:Gem::Version
77
- version: 2.0.0.rc5
77
+ version: '0'
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: shoulda
80
80
  requirement: !ruby/object:Gem::Requirement
@@ -234,7 +234,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
234
234
  version: '0'
235
235
  segments:
236
236
  - 0
237
- hash: 4116448878207311103
237
+ hash: 649274912640500355
238
238
  required_rubygems_version: !ruby/object:Gem::Requirement
239
239
  none: false
240
240
  requirements: