tem_multi_proxy 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +2 -0
- data/Rakefile +1 -1
- data/lib/tem_multi_proxy/manager.rb +8 -8
- data/tem_multi_proxy.gemspec +5 -5
- metadata +3 -3
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
@@ -17,7 +17,7 @@ Echoe.new('tem_multi_proxy') do |p|
|
|
17
17
|
p.summary = 'Maintains TEM proxies for all the physically attached TEMs.'
|
18
18
|
p.url = 'http://tem.rubyforge.org'
|
19
19
|
p.dependencies = ['rbtree >=0.2.1',
|
20
|
-
'smartcard >=0.
|
20
|
+
'smartcard >=0.5.0',
|
21
21
|
'tem_ruby >=0.11.7',
|
22
22
|
'zerg_support >=0.0.9']
|
23
23
|
|
@@ -26,7 +26,7 @@ module Tem::MultiProxy
|
|
26
26
|
# disconnected.
|
27
27
|
class Manager
|
28
28
|
def initialize
|
29
|
-
@pcsc_context = Smartcard::PCSC::Context.new
|
29
|
+
@pcsc_context = Smartcard::PCSC::Context.new :system
|
30
30
|
@proxy_pids = {}
|
31
31
|
@proxy_ports = {}
|
32
32
|
@free_ports = RBTree.new
|
@@ -42,23 +42,23 @@ class Manager
|
|
42
42
|
# Polls each smartcard reader to see if there's a card present.
|
43
43
|
def poll_readers
|
44
44
|
begin
|
45
|
-
readers = @pcsc_context.
|
45
|
+
readers = @pcsc_context.readers.map { |name| { :name => name }}
|
46
46
|
rescue
|
47
47
|
# Linux PC/SC raises an exception if no readers are connected.
|
48
48
|
readers = []
|
49
49
|
end
|
50
50
|
return readers if readers.empty?
|
51
51
|
|
52
|
-
|
52
|
+
queries = Smartcard::PCSC::ReaderStateQueries.new readers.length
|
53
53
|
readers.each_with_index do |reader, i|
|
54
|
-
|
55
|
-
|
54
|
+
queries[i].reader_name = reader[:name]
|
55
|
+
queries[i].current_state = :unaware
|
56
56
|
end
|
57
|
-
@pcsc_context.
|
57
|
+
@pcsc_context.wait_for_status_change queries, 100
|
58
58
|
|
59
59
|
readers.each_with_index do |reader, i|
|
60
|
-
reader[:atr] =
|
61
|
-
#
|
60
|
+
reader[:atr] = queries[i].atr
|
61
|
+
# event_state is buggy on pcsclite, using the ATR for card detection.
|
62
62
|
if reader[:atr].length == 0
|
63
63
|
reader[:card] = false
|
64
64
|
reader[:atr] = nil
|
data/tem_multi_proxy.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{tem_multi_proxy}
|
5
|
-
s.version = "0.2.
|
5
|
+
s.version = "0.2.7"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Victor Costan"]
|
9
|
-
s.date = %q{2009-11-
|
9
|
+
s.date = %q{2009-11-27}
|
10
10
|
s.description = %q{Maintains TEM proxies for all the physically attached TEMs.}
|
11
11
|
s.email = %q{victor@costan.us}
|
12
12
|
s.executables = ["tem_multi_proxy", "tem_multi_proxy_query"]
|
@@ -25,18 +25,18 @@ Gem::Specification.new do |s|
|
|
25
25
|
|
26
26
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
27
27
|
s.add_runtime_dependency(%q<rbtree>, [">= 0.2.1"])
|
28
|
-
s.add_runtime_dependency(%q<smartcard>, [">= 0.
|
28
|
+
s.add_runtime_dependency(%q<smartcard>, [">= 0.5.0"])
|
29
29
|
s.add_runtime_dependency(%q<tem_ruby>, [">= 0.11.7"])
|
30
30
|
s.add_runtime_dependency(%q<zerg_support>, [">= 0.0.9"])
|
31
31
|
else
|
32
32
|
s.add_dependency(%q<rbtree>, [">= 0.2.1"])
|
33
|
-
s.add_dependency(%q<smartcard>, [">= 0.
|
33
|
+
s.add_dependency(%q<smartcard>, [">= 0.5.0"])
|
34
34
|
s.add_dependency(%q<tem_ruby>, [">= 0.11.7"])
|
35
35
|
s.add_dependency(%q<zerg_support>, [">= 0.0.9"])
|
36
36
|
end
|
37
37
|
else
|
38
38
|
s.add_dependency(%q<rbtree>, [">= 0.2.1"])
|
39
|
-
s.add_dependency(%q<smartcard>, [">= 0.
|
39
|
+
s.add_dependency(%q<smartcard>, [">= 0.5.0"])
|
40
40
|
s.add_dependency(%q<tem_ruby>, [">= 0.11.7"])
|
41
41
|
s.add_dependency(%q<zerg_support>, [">= 0.0.9"])
|
42
42
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tem_multi_proxy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Costan
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-11-
|
12
|
+
date: 2009-11-27 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.5.0
|
34
34
|
version:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: tem_ruby
|