smartcard 0.5.5 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 497af5a9e48188c65f003c6e759364b61d8a1294
4
+ data.tar.gz: c166f4439febe243e00fb7a678b53bc709ab98bb
5
+ SHA512:
6
+ metadata.gz: b1fa2302dd5620b51b0388ebcbcbcafc484ab491b62fcc9fe52ba776a9b5caf61f82f3c3eb0c2a9f9dba75d426a4ce5195ca11fc025194c7c04669200022853b
7
+ data.tar.gz: e6c35ed74a27b0614257f24bf7791624f791a7f41b40c33c821acba8093d090a5b4b4f9c048736e338201def6cbddc46df9d4527430ae19c557565ce1095518a
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.5.6. Add Enumerable capability to ReaderStateQueries.
2
+
1
3
  v0.5.5. Fixed crash in MRI 1.9.3.
2
4
 
3
5
  v0.5.4. Fixed ReaderStateQuery to work when the status has bits not defined in the PCSC header.
data/Rakefile CHANGED
@@ -12,6 +12,7 @@ Echoe.new('smartcard') do |p|
12
12
  p.url = 'http://www.costan.us/smartcard'
13
13
  p.dependencies = ['ffi >=1.2.0',
14
14
  'rubyzip >=0.9.9',
15
+ 'zip-zip >=0.3',
15
16
  'zerg_support >=0.1.6']
16
17
  p.development_dependencies = ['echoe >=4.6.3',
17
18
  'flexmock >=1.2.0']
@@ -12,6 +12,8 @@ module Smartcard::PCSC
12
12
 
13
13
  # A continuous array of reader state queries.
14
14
  class ReaderStateQueries
15
+ include Enumerable
16
+
15
17
  # Creates an array of reader state queries.
16
18
  #
17
19
  # The states are unusable until they are assigned reader names by calling
@@ -30,6 +32,11 @@ class ReaderStateQueries
30
32
  raise IndexError if index >= @queries.length
31
33
  @queries[index]
32
34
  end
35
+
36
+ # Mandatory for Enumerable mixin
37
+ def each(&block)
38
+ @queries.each &block
39
+ end
33
40
 
34
41
  # The number of queries in the array.
35
42
  def length
@@ -43,6 +50,21 @@ class ReaderStateQueries
43
50
  def ack_changes
44
51
  @queries.each { |query| query[:current_state] = query[:event_state] }
45
52
  end
53
+
54
+ # Short cut: Select queries with 'changed' event state.
55
+ #
56
+ # Do some stuff on changed queries after
57
+ # Smartcard::PCSC::Context#wait_for_status_change.
58
+ #
59
+ #==== Examples
60
+ #
61
+ # queries.with_changes.each do |q|
62
+ # puts "changed: #{q.reader_name}"
63
+ # end
64
+ #
65
+ def with_changes
66
+ @queries.select { |query| query.changed? }
67
+ end
46
68
 
47
69
  # Called by FFI::AutoPointer to release the reader states array.
48
70
  #
@@ -101,6 +123,11 @@ class FFILib::ReaderStateQuery
101
123
  def event_state=(new_state)
102
124
  self[:event_state] = FFILib::ReaderStateQuery.pack_state new_state
103
125
  end
126
+
127
+ # Short cut to identify a query with changed event_state.
128
+ def changed?
129
+ self.event_state.include? :changed
130
+ end
104
131
 
105
132
  # The ATR of the smart-card in the query's reader.
106
133
  #
@@ -1,36 +1,39 @@
1
1
  # -*- encoding: utf-8 -*-
2
+ # stub: smartcard 0.5.6 ruby lib
2
3
 
3
4
  Gem::Specification.new do |s|
4
5
  s.name = "smartcard"
5
- s.version = "0.5.5"
6
+ s.version = "0.5.6"
6
7
 
7
8
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
9
+ s.require_paths = ["lib"]
8
10
  s.authors = ["Victor Costan"]
9
- s.date = "2012-12-18"
11
+ s.date = "2015-07-14"
10
12
  s.description = "Interface with ISO 7816 smart cards."
11
13
  s.email = "victor@costan.us"
12
14
  s.extra_rdoc_files = ["BUILD", "CHANGELOG", "LICENSE", "README", "lib/smartcard.rb", "lib/smartcard/gp/asn1_ber.rb", "lib/smartcard/gp/cap_loader.rb", "lib/smartcard/gp/des.rb", "lib/smartcard/gp/gp_card_mixin.rb", "lib/smartcard/iso/apdu_error.rb", "lib/smartcard/iso/auto_configurator.rb", "lib/smartcard/iso/iso_card_mixin.rb", "lib/smartcard/iso/jcop_remote_protocol.rb", "lib/smartcard/iso/jcop_remote_server.rb", "lib/smartcard/iso/jcop_remote_transport.rb", "lib/smartcard/iso/pcsc_transport.rb", "lib/smartcard/iso/transport.rb", "lib/smartcard/pcsc/card.rb", "lib/smartcard/pcsc/context.rb", "lib/smartcard/pcsc/exception.rb", "lib/smartcard/pcsc/ffi_autogen.rb", "lib/smartcard/pcsc/ffi_functions.rb", "lib/smartcard/pcsc/ffi_lib.rb", "lib/smartcard/pcsc/ffi_structs.rb", "lib/smartcard/pcsc/reader_state_queries.rb", "tasks/ffi_codegen.rb"]
13
- s.files = ["BUILD", "CHANGELOG", "LICENSE", "Manifest", "README", "Rakefile", "lib/smartcard.rb", "lib/smartcard/gp/asn1_ber.rb", "lib/smartcard/gp/cap_loader.rb", "lib/smartcard/gp/des.rb", "lib/smartcard/gp/gp_card_mixin.rb", "lib/smartcard/iso/apdu_error.rb", "lib/smartcard/iso/auto_configurator.rb", "lib/smartcard/iso/iso_card_mixin.rb", "lib/smartcard/iso/jcop_remote_protocol.rb", "lib/smartcard/iso/jcop_remote_server.rb", "lib/smartcard/iso/jcop_remote_transport.rb", "lib/smartcard/iso/pcsc_transport.rb", "lib/smartcard/iso/transport.rb", "lib/smartcard/pcsc/card.rb", "lib/smartcard/pcsc/context.rb", "lib/smartcard/pcsc/exception.rb", "lib/smartcard/pcsc/ffi_autogen.rb", "lib/smartcard/pcsc/ffi_functions.rb", "lib/smartcard/pcsc/ffi_lib.rb", "lib/smartcard/pcsc/ffi_structs.rb", "lib/smartcard/pcsc/reader_state_queries.rb", "tasks/ffi_codegen.rb", "test/gp/asn1_ber_test.rb", "test/gp/cap_loader_test.rb", "test/gp/des_test.rb", "test/gp/gp_card_mixin_compat_test.rb", "test/gp/gp_card_mixin_test.rb", "test/gp/hello.apdu", "test/gp/hello.cap", "test/iso/auto_configurator_test.rb", "test/iso/iso_card_mixin_test.rb", "test/iso/iso_exception_test.rb", "test/iso/jcop_remote_test.rb", "test/pcsc/card_test.rb", "test/pcsc/context_test.rb", "test/pcsc/exception_test.rb", "test/pcsc/reader_state_queries_test.rb", "smartcard.gemspec"]
15
+ s.files = ["BUILD", "CHANGELOG", "LICENSE", "Manifest", "README", "Rakefile", "lib/smartcard.rb", "lib/smartcard/gp/asn1_ber.rb", "lib/smartcard/gp/cap_loader.rb", "lib/smartcard/gp/des.rb", "lib/smartcard/gp/gp_card_mixin.rb", "lib/smartcard/iso/apdu_error.rb", "lib/smartcard/iso/auto_configurator.rb", "lib/smartcard/iso/iso_card_mixin.rb", "lib/smartcard/iso/jcop_remote_protocol.rb", "lib/smartcard/iso/jcop_remote_server.rb", "lib/smartcard/iso/jcop_remote_transport.rb", "lib/smartcard/iso/pcsc_transport.rb", "lib/smartcard/iso/transport.rb", "lib/smartcard/pcsc/card.rb", "lib/smartcard/pcsc/context.rb", "lib/smartcard/pcsc/exception.rb", "lib/smartcard/pcsc/ffi_autogen.rb", "lib/smartcard/pcsc/ffi_functions.rb", "lib/smartcard/pcsc/ffi_lib.rb", "lib/smartcard/pcsc/ffi_structs.rb", "lib/smartcard/pcsc/reader_state_queries.rb", "smartcard.gemspec", "tasks/ffi_codegen.rb", "test/gp/asn1_ber_test.rb", "test/gp/cap_loader_test.rb", "test/gp/des_test.rb", "test/gp/gp_card_mixin_compat_test.rb", "test/gp/gp_card_mixin_test.rb", "test/gp/hello.apdu", "test/gp/hello.cap", "test/iso/auto_configurator_test.rb", "test/iso/iso_card_mixin_test.rb", "test/iso/iso_exception_test.rb", "test/iso/jcop_remote_test.rb", "test/pcsc/card_test.rb", "test/pcsc/context_test.rb", "test/pcsc/exception_test.rb", "test/pcsc/reader_state_queries_test.rb"]
14
16
  s.homepage = "http://www.costan.us/smartcard"
15
- s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Smartcard", "--main", "README"]
16
- s.require_paths = ["lib"]
17
+ s.rdoc_options = ["--line-numbers", "--title", "Smartcard", "--main", "README"]
17
18
  s.rubyforge_project = "smartcard"
18
- s.rubygems_version = "1.8.24"
19
+ s.rubygems_version = "2.4.5"
19
20
  s.summary = "Interface with ISO 7816 smart cards."
20
- s.test_files = ["test/iso/jcop_remote_test.rb", "test/iso/auto_configurator_test.rb", "test/iso/iso_card_mixin_test.rb", "test/iso/iso_exception_test.rb", "test/gp/des_test.rb", "test/gp/gp_card_mixin_compat_test.rb", "test/gp/gp_card_mixin_test.rb", "test/gp/asn1_ber_test.rb", "test/gp/cap_loader_test.rb", "test/pcsc/card_test.rb", "test/pcsc/exception_test.rb", "test/pcsc/reader_state_queries_test.rb", "test/pcsc/context_test.rb"]
21
+ s.test_files = ["test/gp/asn1_ber_test.rb", "test/gp/cap_loader_test.rb", "test/gp/des_test.rb", "test/gp/gp_card_mixin_compat_test.rb", "test/gp/gp_card_mixin_test.rb", "test/iso/auto_configurator_test.rb", "test/iso/iso_card_mixin_test.rb", "test/iso/iso_exception_test.rb", "test/iso/jcop_remote_test.rb", "test/pcsc/card_test.rb", "test/pcsc/context_test.rb", "test/pcsc/exception_test.rb", "test/pcsc/reader_state_queries_test.rb"]
21
22
 
22
23
  if s.respond_to? :specification_version then
23
- s.specification_version = 3
24
+ s.specification_version = 4
24
25
 
25
26
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
26
27
  s.add_runtime_dependency(%q<ffi>, [">= 1.2.0"])
27
28
  s.add_runtime_dependency(%q<rubyzip>, [">= 0.9.9"])
29
+ s.add_runtime_dependency(%q<zip-zip>, [">= 0.3"])
28
30
  s.add_runtime_dependency(%q<zerg_support>, [">= 0.1.6"])
29
31
  s.add_development_dependency(%q<echoe>, [">= 4.6.3"])
30
32
  s.add_development_dependency(%q<flexmock>, [">= 1.2.0"])
31
33
  else
32
34
  s.add_dependency(%q<ffi>, [">= 1.2.0"])
33
35
  s.add_dependency(%q<rubyzip>, [">= 0.9.9"])
36
+ s.add_dependency(%q<zip-zip>, [">= 0.3"])
34
37
  s.add_dependency(%q<zerg_support>, [">= 0.1.6"])
35
38
  s.add_dependency(%q<echoe>, [">= 4.6.3"])
36
39
  s.add_dependency(%q<flexmock>, [">= 1.2.0"])
@@ -38,6 +41,7 @@ Gem::Specification.new do |s|
38
41
  else
39
42
  s.add_dependency(%q<ffi>, [">= 1.2.0"])
40
43
  s.add_dependency(%q<rubyzip>, [">= 0.9.9"])
44
+ s.add_dependency(%q<zip-zip>, [">= 0.3"])
41
45
  s.add_dependency(%q<zerg_support>, [">= 0.1.6"])
42
46
  s.add_dependency(%q<echoe>, [">= 4.6.3"])
43
47
  s.add_dependency(%q<flexmock>, [">= 1.2.0"])
metadata CHANGED
@@ -1,94 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartcard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
5
- prerelease:
4
+ version: 0.5.6
6
5
  platform: ruby
7
6
  authors:
8
7
  - Victor Costan
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-12-18 00:00:00.000000000 Z
11
+ date: 2015-07-14 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: ffi
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: 1.2.0
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: 1.2.0
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rubyzip
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: 0.9.9
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: 0.9.9
41
+ - !ruby/object:Gem::Dependency
42
+ name: zip-zip
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0.3'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0.3'
46
55
  - !ruby/object:Gem::Dependency
47
56
  name: zerg_support
48
57
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
58
  requirements:
51
- - - ! '>='
59
+ - - ">="
52
60
  - !ruby/object:Gem::Version
53
61
  version: 0.1.6
54
62
  type: :runtime
55
63
  prerelease: false
56
64
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
65
  requirements:
59
- - - ! '>='
66
+ - - ">="
60
67
  - !ruby/object:Gem::Version
61
68
  version: 0.1.6
62
69
  - !ruby/object:Gem::Dependency
63
70
  name: echoe
64
71
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
72
  requirements:
67
- - - ! '>='
73
+ - - ">="
68
74
  - !ruby/object:Gem::Version
69
75
  version: 4.6.3
70
76
  type: :development
71
77
  prerelease: false
72
78
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
79
  requirements:
75
- - - ! '>='
80
+ - - ">="
76
81
  - !ruby/object:Gem::Version
77
82
  version: 4.6.3
78
83
  - !ruby/object:Gem::Dependency
79
84
  name: flexmock
80
85
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
86
  requirements:
83
- - - ! '>='
87
+ - - ">="
84
88
  - !ruby/object:Gem::Version
85
89
  version: 1.2.0
86
90
  type: :development
87
91
  prerelease: false
88
92
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
93
  requirements:
91
- - - ! '>='
94
+ - - ">="
92
95
  - !ruby/object:Gem::Version
93
96
  version: 1.2.0
94
97
  description: Interface with ISO 7816 smart cards.
@@ -150,6 +153,7 @@ files:
150
153
  - lib/smartcard/pcsc/ffi_lib.rb
151
154
  - lib/smartcard/pcsc/ffi_structs.rb
152
155
  - lib/smartcard/pcsc/reader_state_queries.rb
156
+ - smartcard.gemspec
153
157
  - tasks/ffi_codegen.rb
154
158
  - test/gp/asn1_ber_test.rb
155
159
  - test/gp/cap_loader_test.rb
@@ -166,48 +170,45 @@ files:
166
170
  - test/pcsc/context_test.rb
167
171
  - test/pcsc/exception_test.rb
168
172
  - test/pcsc/reader_state_queries_test.rb
169
- - smartcard.gemspec
170
173
  homepage: http://www.costan.us/smartcard
171
174
  licenses: []
175
+ metadata: {}
172
176
  post_install_message:
173
177
  rdoc_options:
174
- - --line-numbers
175
- - --inline-source
176
- - --title
178
+ - "--line-numbers"
179
+ - "--title"
177
180
  - Smartcard
178
- - --main
181
+ - "--main"
179
182
  - README
180
183
  require_paths:
181
184
  - lib
182
185
  required_ruby_version: !ruby/object:Gem::Requirement
183
- none: false
184
186
  requirements:
185
- - - ! '>='
187
+ - - ">="
186
188
  - !ruby/object:Gem::Version
187
189
  version: '0'
188
190
  required_rubygems_version: !ruby/object:Gem::Requirement
189
- none: false
190
191
  requirements:
191
- - - ! '>='
192
+ - - ">="
192
193
  - !ruby/object:Gem::Version
193
194
  version: '1.2'
194
195
  requirements: []
195
196
  rubyforge_project: smartcard
196
- rubygems_version: 1.8.24
197
+ rubygems_version: 2.4.5
197
198
  signing_key:
198
- specification_version: 3
199
+ specification_version: 4
199
200
  summary: Interface with ISO 7816 smart cards.
200
201
  test_files:
201
- - test/iso/jcop_remote_test.rb
202
- - test/iso/auto_configurator_test.rb
203
- - test/iso/iso_card_mixin_test.rb
204
- - test/iso/iso_exception_test.rb
202
+ - test/gp/asn1_ber_test.rb
203
+ - test/gp/cap_loader_test.rb
205
204
  - test/gp/des_test.rb
206
205
  - test/gp/gp_card_mixin_compat_test.rb
207
206
  - test/gp/gp_card_mixin_test.rb
208
- - test/gp/asn1_ber_test.rb
209
- - test/gp/cap_loader_test.rb
207
+ - test/iso/auto_configurator_test.rb
208
+ - test/iso/iso_card_mixin_test.rb
209
+ - test/iso/iso_exception_test.rb
210
+ - test/iso/jcop_remote_test.rb
210
211
  - test/pcsc/card_test.rb
212
+ - test/pcsc/context_test.rb
211
213
  - test/pcsc/exception_test.rb
212
214
  - test/pcsc/reader_state_queries_test.rb
213
- - test/pcsc/context_test.rb