te3270 0.6.0 → 0.7.0

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a8b2b1732325e0f1d627e16fd988c80944d739b
4
- data.tar.gz: 4b8ce799ad173f61a8c5a77d53b581c859c766b4
3
+ metadata.gz: 3d60806e976da5fff38e2cd7b93a8e1b55e817ee
4
+ data.tar.gz: ccd793031daaee765c32499ef334da6e1ea9ad68
5
5
  SHA512:
6
- metadata.gz: 4e26aa6363315d7e23430fb27e9a2591bcac4d4d260d670b227b13361a4ea16c8f77edfe8d91a8d6a2e777a071ffa900e5aecd4706f4dbbfce96639b0f0a000d
7
- data.tar.gz: 0903b33a885395ba1f5f60a02ed8816e228ce30a19cedb6a2f8c43fb6e5d5c209e0f51ccd83b9bab2b5478542e1894275566330331e683fa142ce344d5174877
6
+ metadata.gz: de66bdcc16c9803138c0e151af10754f23dbf0bb45b7adda088aa664befd1bc6a8b973930fa42124569dd4a2a96771f3f4097bd6a6c5584b2899d0b9b5edd3ba
7
+ data.tar.gz: 67b75e058a9b9e2e61be3224c529985ccea456cd09ff955dccd3b8adfa1d5d21b059710abc7a00c386cf98d584d647bd1e31ff2d31bf030aed2b979caf531768
data/ChangeLog CHANGED
@@ -1,3 +1,6 @@
1
+ === Version 0.7.0 / 2016/6/16
2
+ * Added support for x3279 to accept a port number (Thanks Nithin Reddy)
3
+
1
4
  === Version 0.6.0 / 2015/4/21
2
5
  * Platform Independent Release
3
6
 
@@ -9,7 +9,7 @@ module TE3270
9
9
  #
10
10
  class X3270
11
11
 
12
- attr_writer :executable_command, :host, :max_wait_time, :trace
12
+ attr_writer :executable_command, :host, :max_wait_time, :trace , :port
13
13
 
14
14
  #
15
15
  # Creates a method to connect to x3270. This method expects a block in which certain
@@ -24,15 +24,18 @@ module TE3270
24
24
  # screen_object.connect do |emulator|
25
25
  # emulator.executable_command = 'path_to_executable'
26
26
  # emulator.host = 'host.example.com'
27
+ # emulator.port = 23
27
28
  # emulator.max_wait_time = 5
28
29
  # end
29
30
  #
30
31
  def connect
31
32
  @max_wait_time = 10
32
33
  @trace = false
34
+ @port = 23
33
35
  yield self if block_given?
34
36
  raise 'The executable command must be set in a block when calling connect with the X3270 emulator.' if @executable_command.nil?
35
37
  raise 'The host must be set in a block when calling connect with the X3270 emulator.' if @host.nil?
38
+
36
39
  start_x3270_system
37
40
  end
38
41
 
@@ -71,7 +74,7 @@ module TE3270
71
74
  #
72
75
  def put_string(str, row, column)
73
76
  x_send_no_rsp "MoveCursor(#{row-1},#{column-1})"
74
- x_send_no_rsp 'string "' + str.gsub('"', '\\"') + '"'
77
+ x_send_no_rsp 'string "' + str.to_s.gsub('"', '\\"') + '"'
75
78
  end
76
79
 
77
80
  #
@@ -172,9 +175,9 @@ module TE3270
172
175
  begin
173
176
  args = [
174
177
  "-model", "2",
175
- ""
178
+ "", "-port"
176
179
  ]
177
- cmd = "#{@executable_command} #{args.join " "} #{@host}"
180
+ cmd = "#{@executable_command} #{args.join " "} #{@port} #{@host}"
178
181
  @x3270_input, @x3270_output, @x3270_thr = Open3.popen2e(cmd)
179
182
  rescue Exception => e
180
183
  raise "Could not start x3270 '#{@executable_command}': #{e}"
@@ -182,4 +185,4 @@ module TE3270
182
185
  end
183
186
  end
184
187
  end
185
- end
188
+ end
@@ -1,4 +1,4 @@
1
1
  module TE3270
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
4
4
 
@@ -41,6 +41,13 @@ describe TE3270::Emulators::X3270 do
41
41
  end
42
42
  end
43
43
 
44
+ it 'should take the connection port from a block' do
45
+ x3270.should_receive(:port=).with(3270)
46
+ x3270.connect do |platform|
47
+ platform.port = 3270
48
+ end
49
+ end
50
+
44
51
  it 'should display an error when the path to the executable is not set' do
45
52
  x3270.instance_variable_set(:@executable_command, nil)
46
53
  expect { x3270.connect }.to raise_error('The executable command must be set in a block when calling connect with the X3270 emulator.')
@@ -57,6 +64,11 @@ describe TE3270::Emulators::X3270 do
57
64
  x3270.instance_variable_get(:@max_wait_time).should eq(10)
58
65
  end
59
66
 
67
+ it 'should default to port being 23 when not provided' do
68
+ x3270.connect
69
+ x3270.instance_variable_get(:@port).should eq(23)
70
+ end
71
+
60
72
  it 'should display an error when cannot popen supplied x3270 program' do
61
73
  Open3.stub(:popen2e).and_raise('darn it, popen failed')
62
74
  expect { x3270.connect }.to raise_error( "Could not start x3270 'the_command': darn it, popen failed")
@@ -7,8 +7,8 @@ Gem::Specification.new do |spec|
7
7
  spec.name = "te3270"
8
8
  spec.version = TE3270::VERSION
9
9
  spec.platform = Gem::Platform::RUBY
10
- spec.authors = ["Jeffrey S. Morgan", "Nithin C. Reddy", "Glenn W. Waters"]
11
- spec.email = ["jeff.morgan@leandog.com","nithinreddyc@gmail.com", "gwwaters@gmail.com"]
10
+ spec.authors = ["Jeffrey S. Morgan", "Nithin C. Reddy", "Glenn W. Waters", "Thrivikrama Madiraju"]
11
+ spec.email = ["jeff.morgan@leandog.com","nithinreddyc@gmail.com", "gwwaters@gmail.com", "akmadiraju@yahoo.com"]
12
12
  spec.description = %q{Automates a 3270 Terminal Emulator}
13
13
  spec.summary = %q{Automates a 3270 Terminal Emulator}
14
14
  spec.homepage = "http://github.com/cheezy/te3270"
metadata CHANGED
@@ -1,16 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: te3270
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeffrey S. Morgan
8
8
  - Nithin C. Reddy
9
9
  - Glenn W. Waters
10
+ - Thrivikrama Madiraju
10
11
  autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
- date: 2015-04-22 00:00:00.000000000 Z
14
+ date: 2016-06-16 00:00:00.000000000 Z
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: page_navigation
@@ -73,6 +74,7 @@ email:
73
74
  - jeff.morgan@leandog.com
74
75
  - nithinreddyc@gmail.com
75
76
  - gwwaters@gmail.com
77
+ - akmadiraju@yahoo.com
76
78
  executables: []
77
79
  extensions:
78
80
  - ext/mkrf_conf.rb
@@ -127,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
129
  version: '0'
128
130
  requirements: []
129
131
  rubyforge_project:
130
- rubygems_version: 2.4.6
132
+ rubygems_version: 2.5.1
131
133
  signing_key:
132
134
  specification_version: 4
133
135
  summary: Automates a 3270 Terminal Emulator