client_for_poslynx 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTdlMTQzNzAxMjA5NjM0Zjk2M2FkMDJjMDBmY2YyMmEyMTExYTMwZg==
4
+ NzFmYTkyYTMxMmQ2M2RiNDhmMGFiZDc1YTk5MmYwOWVkYmM3ZTgwMg==
5
5
  data.tar.gz: !binary |-
6
- OTlhZGY3NGI2MGQyMGM2ZmY2MzdjMWY1MmZkOTQ5MWI5ZTA2NmE1ZQ==
6
+ NDk0ZTUwMzJiNGJmMTlhZWUwNDY5OGI4MDQ5ZDFkNzdkMTgzMjBmMQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZjFkOWU5ZmViMDliM2RiYmQ4NGM1NGUwMDAxZGNhZDg4N2E2MWMwMDI3MGNh
10
- NGU1OWVjNDc5ZjQ5ODY4OGVmZDY1ZDFiNTc4ZDgwNDViMzJhNmYxZTJmMWEx
11
- ZTg1ZWNlNzEzYTAzMzdkYTFhMGE0ZmFjNTE4NjBhMTIwNjM2NWY=
9
+ MzY3NDY0NzY2ZjA5NjRlYWUxYjUwOWM0Y2U3YTc0ODIyNDliNTFkOWU3ZDA3
10
+ NmFmNDBhYzBmNzc3ZDQ5NjgxZDRkYmMzNmRlNWRkYzczMDEzMjk0ZmVlZjk5
11
+ Yjk0MzdlYWQ4MDFjZjQwZGIzZWQ1Yjk4NjY0OGFjNGM5YTI2NGQ=
12
12
  data.tar.gz: !binary |-
13
- ZDIxYmY4OWQ0NzIwNmIxZjg5MjhkYTIzMDYxYWU3NWUyYzUwMDhlZTEyZjRk
14
- MTY2NGJjM2ZiMmZlZWVjNmZjNGVmOTk3NzkyODUyMGIzOTA3YzM1NDkxZTRm
15
- YWRkNTdkMTEyNzc3ZmY2MDU3Y2FhMWZhZDFlZDA3ZTE5NzE4NzI=
13
+ ZTkxNjY5MTM4NGQyNGNmYWRiMDg1YmFiMzQ4NDNkMmUyYmI1ZjRhYzBhY2I4
14
+ ODNhZjYzODEwMjdiMzkxZjE3NDZkNjllYjZhNjM4OGQxYTkzMDU1NDgxOGI1
15
+ MDYwNTRkNzg5NzE1NjcyOGRjZjdlYmI3MTIxYjVlYjdjZjlmMTA=
data/CHANGELOG CHANGED
@@ -1,48 +1,11 @@
1
- Version 0.0.1
2
- - Initial development
3
-
4
- Version 0.1.0
5
- - Initial release
6
-
7
- Version 0.1.1
8
- - Add CHANGELOG file
1
+ Version 1.0.1
2
+ - Allow nested calls to EM_Session#exec_dissociated
9
3
 
10
- Version 0.2.0
11
- - Improve API for specifying attribute element mappings.
4
+ Version 1.0.0
5
+ - Fake POS terminal script accepts local IP address parameter.
12
6
 
13
- Version 0.2.1
14
- - Relax Nokogiri gem version requirement.
15
-
16
- Version 0.2.2
17
- - Specify Ruby version requirement of 1.9.3 or greater.
18
-
19
- Version 0.2.3
20
- - Fix bug: Fake terminal script crashes with stak overflow when
21
- a single text value is supplied.
22
-
23
- Version 0.2.4
24
- - Fix bug: Fake terminal script crashes during user interaction
25
- for a debit sale request without a specified cash back amount.
26
-
27
- Version 0.2.5
28
- - Introduce experimental signature image parsing and conversion
29
- to SVG.
30
- - Fix bug: New format of POSLynx response message XML was causing
31
- client to hang.
32
-
33
- Version 0.2.6
34
- - Add enhanced-format signature data handling.
35
- - Fix misconception about signed number representation in signa-
36
- ture image data.
37
- - Bring signature image handling out of experimental status.
38
-
39
- Version 0.3.0
40
- - Allow user to cancel waiting for reply in
41
- poslynx_client_console.
42
- - Support SSL connections from poslynx_client_console.
43
- - Change word separators in poslynx_client_console from under-
44
- scores to dashes.
45
- - Fake Poslynx includes signature image data in response.
7
+ Version 1.0.0.pre
8
+ - Add EM_connector adapter and EM_Session adapter
46
9
 
47
10
  Version 0.9.0
48
11
  - Add a network client in the form of an EventManager protocol.
@@ -55,3 +18,49 @@ Version 0.9.0
55
18
  - Overhaul the fake pos terminal script to be based on
56
19
  EventMachine and to allow request processing to be interrupted
57
20
  by the receipt of a new request.
21
+
22
+ Version 0.3.0
23
+ - Allow user to cancel waiting for reply in
24
+ poslynx_client_console.
25
+ - Support SSL connections from poslynx_client_console.
26
+ - Change word separators in poslynx_client_console from under-
27
+ scores to dashes.
28
+ - Fake Poslynx includes signature image data in response.
29
+
30
+ Version 0.2.6
31
+ - Add enhanced-format signature data handling.
32
+ - Fix misconception about signed number representation in signa-
33
+ ture image data.
34
+ - Bring signature image handling out of experimental status.
35
+
36
+ Version 0.2.5
37
+ - Introduce experimental signature image parsing and conversion
38
+ to SVG.
39
+ - Fix bug: New format of POSLynx response message XML was causing
40
+ client to hang.
41
+
42
+ Version 0.2.4
43
+ - Fix bug: Fake terminal script crashes during user interaction
44
+ for a debit sale request without a specified cash back amount.
45
+
46
+ Version 0.2.3
47
+ - Fix bug: Fake terminal script crashes with stak overflow when
48
+ a single text value is supplied.
49
+
50
+ Version 0.2.2
51
+ - Specify Ruby version requirement of 1.9.3 or greater.
52
+
53
+ Version 0.2.1
54
+ - Relax Nokogiri gem version requirement.
55
+
56
+ Version 0.2.0
57
+ - Improve API for specifying attribute element mappings.
58
+
59
+ Version 0.1.1
60
+ - Add CHANGELOG file
61
+
62
+ Version 0.1.0
63
+ - Initial release
64
+
65
+ Version 0.0.1
66
+ - Initial development
@@ -118,13 +118,29 @@ module ClientForPoslynx
118
118
  # EventMachine::defer and has the same considerations and
119
119
  # caveats.
120
120
  #
121
+ # When a call to #exec_dissociated is nested within a
122
+ # block passed to anothet call, only the outermost invo-
123
+ # cation is deferred, and the inner call executes in the
124
+ # same thread as the outer call.
125
+ #
121
126
  # Note that methods of the session should not be called by
122
127
  # code within the block since those methods should only be
123
128
  # called from code running in the main event loop thread.
124
129
  def exec_dissociated(&block)
125
- was_successful, resp_data_or_ex = Fiber.yield( [:_exec_dissociated, block] )
126
- raise resp_data_or_ex unless was_successful
127
- resp_data_or_ex
130
+ @currently_dissociated ||= false
131
+
132
+ if @currently_dissociated
133
+ block.call
134
+ else
135
+ begin
136
+ @currently_dissociated = true
137
+ was_successful, resp_data_or_ex = Fiber.yield( [:_exec_dissociated, block] )
138
+ raise resp_data_or_ex unless was_successful
139
+ resp_data_or_ex
140
+ ensure
141
+ @currently_dissociated = false
142
+ end
143
+ end
128
144
  end
129
145
 
130
146
  # Returns control to EventMachine, and returns control to
@@ -1,5 +1,5 @@
1
1
  # coding: utf-8
2
2
 
3
3
  module ClientForPoslynx
4
- VERSION = '1.0.0'
4
+ VERSION = '1.0.1'
5
5
  end
@@ -252,7 +252,7 @@ module ClientForPoslynx
252
252
  end
253
253
  end
254
254
 
255
- context "executing a dissociated code" do
255
+ context "executing a dissociated block" do
256
256
  before do
257
257
  allow( em_system ).to receive( :defer ) do |block, callback|
258
258
  result = block.call
@@ -286,6 +286,27 @@ module ClientForPoslynx
286
286
  end
287
287
  end
288
288
 
289
+ context "executing a nested dissociated block" do
290
+ it "defers execution of the outer code block only" do
291
+ (
292
+ allow( em_system ).
293
+ to receive( :defer ) do |block, callback|
294
+ result = block.call
295
+ callback.call result
296
+ end
297
+ ).once
298
+
299
+ exec_result = nil
300
+ subject.execute do |s|
301
+ subject.exec_dissociated {
302
+ exec_result = subject.exec_dissociated { :the_result }
303
+ }
304
+ end
305
+ expect( exec_result ).to eq( :the_result )
306
+ end
307
+
308
+ end
309
+
289
310
  context "sleeping" do
290
311
  before do
291
312
  @run_sequence = []
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: client_for_poslynx
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Jorgensen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-07 00:00:00.000000000 Z
11
+ date: 2015-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri