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 CHANGED
@@ -1,3 +1,5 @@
1
+ v0.2.7. Updated to API for smartcard 0.5.0 (FFI instead of C extension).
2
+
1
3
  v0.2.6. Updated to API for smartcard 0.4.6 (TEM_PORT replaced by SCARD_PORT).
2
4
 
3
5
  v0.2.5. Added forgotten dependency on tem_ruby, updated documentation.
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.4.6',
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(Smartcard::PCSC::SCOPE_SYSTEM)
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.list_readers(nil).map { |name| { :name => name }}
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
- reader_states = Smartcard::PCSC::ReaderStates.new readers.length
52
+ queries = Smartcard::PCSC::ReaderStateQueries.new readers.length
53
53
  readers.each_with_index do |reader, i|
54
- reader_states.set_reader_name_of!(i, reader[:name])
55
- reader_states.set_current_state_of!(i, Smartcard::PCSC::STATE_UNAWARE)
54
+ queries[i].reader_name = reader[:name]
55
+ queries[i].current_state = :unaware
56
56
  end
57
- @pcsc_context.get_status_change reader_states, 100
57
+ @pcsc_context.wait_for_status_change queries, 100
58
58
 
59
59
  readers.each_with_index do |reader, i|
60
- reader[:atr] = reader_states.atr_of i
61
- # current_state_of is buggy on pcsclite, using the ATR for card detection.
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
@@ -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.6"
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-09}
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.4.6"])
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.4.6"])
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.4.6"])
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.6
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-09 00:00:00 -05:00
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.4.6
33
+ version: 0.5.0
34
34
  version:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: tem_ruby