client_for_poslynx 1.0.0.pre → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/bin/fake_pos_terminal +12 -4
- data/lib/client_for_poslynx/fake_pos_terminal.rb +2 -2
- data/lib/client_for_poslynx/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTdlMTQzNzAxMjA5NjM0Zjk2M2FkMDJjMDBmY2YyMmEyMTExYTMwZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OTlhZGY3NGI2MGQyMGM2ZmY2MzdjMWY1MmZkOTQ5MWI5ZTA2NmE1ZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjFkOWU5ZmViMDliM2RiYmQ4NGM1NGUwMDAxZGNhZDg4N2E2MWMwMDI3MGNh
|
10
|
+
NGU1OWVjNDc5ZjQ5ODY4OGVmZDY1ZDFiNTc4ZDgwNDViMzJhNmYxZTJmMWEx
|
11
|
+
ZTg1ZWNlNzEzYTAzMzdkYTFhMGE0ZmFjNTE4NjBhMTIwNjM2NWY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZDIxYmY4OWQ0NzIwNmIxZjg5MjhkYTIzMDYxYWU3NWUyYzUwMDhlZTEyZjRk
|
14
|
+
MTY2NGJjM2ZiMmZlZWVjNmZjNGVmOTk3NzkyODUyMGIzOTA3YzM1NDkxZTRm
|
15
|
+
YWRkNTdkMTEyNzc3ZmY2MDU3Y2FhMWZhZDFlZDA3ZTE5NzE4NzI=
|
data/bin/fake_pos_terminal
CHANGED
@@ -16,15 +16,17 @@ $*.replace []
|
|
16
16
|
# for --help or because an unrecognized option was given.
|
17
17
|
show_usage = option_args.length > 0
|
18
18
|
|
19
|
-
#
|
20
|
-
|
19
|
+
# One required value argument for the port number, and one optional
|
20
|
+
# value argument for the local IP address.
|
21
|
+
show_usage ||= value_args.length < 1 || value_args.length > 2
|
21
22
|
|
22
23
|
# Port number should consist of 1 or more digits
|
23
24
|
show_usage ||= value_args.first !~ /\A\d+\z/
|
24
25
|
|
25
26
|
if show_usage
|
26
27
|
puts
|
27
|
-
puts "Usage: client_for_poslynx <port-number>"
|
28
|
+
puts "Usage: client_for_poslynx <port-number> [<bind-to-ip-address>]"
|
29
|
+
puts "Usage: client_for_poslynx --help"
|
28
30
|
puts
|
29
31
|
puts "Runs a fake POS terminal that behaves like a POSLynx unit with"
|
30
32
|
puts "an attached PIN pad. It accepts connections from a client on"
|
@@ -34,8 +36,14 @@ if show_usage
|
|
34
36
|
puts "This allows you to manually test or demonstrate your client"
|
35
37
|
puts "software without having access to actual POSLynx hardware."
|
36
38
|
puts
|
39
|
+
puts " port-number : The IP port on which to listen."
|
40
|
+
puts " bind-to-ip-address : The IP address on which to listen."
|
41
|
+
puts " Defaults to 127.0.0.1 (localhost)."
|
42
|
+
puts " Usually specify 0.0.0.0 to allow a"
|
43
|
+
puts " connection from another computer"
|
37
44
|
else
|
38
45
|
port_number = (value_args.first || 0).to_i
|
46
|
+
bind_to_ip_address = value_args[1] || '127.0.0.1'
|
39
47
|
require 'client_for_poslynx/fake_pos_terminal'
|
40
|
-
ClientForPoslynx::FakePosTerminal.start port_number
|
48
|
+
ClientForPoslynx::FakePosTerminal.start port_number, bind_to_ip_address
|
41
49
|
end
|
@@ -16,7 +16,7 @@ module ClientForPoslynx
|
|
16
16
|
# behaves similarly to a POSLynx attached PIN pad.
|
17
17
|
module FakePosTerminal
|
18
18
|
|
19
|
-
def self.start(port_number)
|
19
|
+
def self.start(port_number, bind_to_ip_address)
|
20
20
|
context = self::Context.new
|
21
21
|
context.port_number = port_number
|
22
22
|
|
@@ -26,7 +26,7 @@ module ClientForPoslynx
|
|
26
26
|
|
27
27
|
EM.run do
|
28
28
|
EM.start_server(
|
29
|
-
|
29
|
+
bind_to_ip_address, port_number, self::NetHandler,
|
30
30
|
user_interface
|
31
31
|
)
|
32
32
|
|
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.0
|
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-
|
11
|
+
date: 2015-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -240,9 +240,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
240
240
|
version: 1.9.3
|
241
241
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
242
242
|
requirements:
|
243
|
-
- - ! '
|
243
|
+
- - ! '>='
|
244
244
|
- !ruby/object:Gem::Version
|
245
|
-
version:
|
245
|
+
version: '0'
|
246
246
|
requirements: []
|
247
247
|
rubyforge_project:
|
248
248
|
rubygems_version: 2.2.2
|