ferocia-rubywmq 1.1.3 → 2.0.2

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.
Files changed (52) hide show
  1. data/.document +0 -4
  2. data/LICENSE.txt +201 -0
  3. data/README.md +408 -0
  4. data/Rakefile +91 -0
  5. data/examples/each_a.rb +1 -17
  6. data/examples/each_b.rb +1 -17
  7. data/examples/each_header.rb +3 -19
  8. data/examples/files_to_q.rb +1 -17
  9. data/examples/get_a.rb +1 -17
  10. data/examples/get_client.rb +5 -21
  11. data/examples/put1_a.rb +1 -17
  12. data/examples/put1_b.rb +1 -17
  13. data/examples/put1_c.rb +3 -19
  14. data/examples/put_a.rb +1 -17
  15. data/examples/put_b.rb +1 -17
  16. data/examples/put_dlh.rb +4 -20
  17. data/examples/put_dynamic_q.rb +1 -17
  18. data/examples/put_group_a.rb +1 -17
  19. data/examples/put_group_b.rb +1 -17
  20. data/examples/put_rfh.rb +12 -28
  21. data/examples/put_rfh2_a.rb +5 -21
  22. data/examples/put_rfh2_b.rb +5 -21
  23. data/examples/put_xmit_q.rb +2 -18
  24. data/examples/q_to_files.rb +1 -17
  25. data/examples/request.rb +7 -23
  26. data/examples/server.rb +10 -26
  27. data/ext/extconf.rb +26 -46
  28. data/ext/extconf_client.rb +3 -19
  29. data/ext/generate/generate_const.rb +16 -43
  30. data/ext/generate/generate_reason.rb +23 -36
  31. data/ext/generate/generate_structs.rb +7 -22
  32. data/ext/generate/wmq_structs.erb +28 -58
  33. data/ext/wmq.c +1 -4
  34. data/ext/wmq.h +5 -1
  35. data/ext/wmq_message.c +1 -1
  36. data/ext/wmq_mq_load.c +1 -1
  37. data/ext/wmq_queue.c +1 -1
  38. data/ext/wmq_queue_manager.c +3 -3
  39. data/lib/rubywmq.rb +1 -0
  40. data/lib/wmq.rb +13 -26
  41. data/lib/wmq/message.rb +70 -0
  42. data/{ext/lib/wmq_temp.rb → lib/wmq/queue_manager.rb} +11 -98
  43. data/lib/wmq/version.rb +3 -0
  44. data/tests/test.rb +30 -40
  45. metadata +10 -20
  46. data/LICENSE +0 -13
  47. data/Manifest.txt +0 -20
  48. data/README +0 -73
  49. data/ext/build.bat +0 -3
  50. data/ext/build.sh +0 -6
  51. data/rubywmq.binary.gemspec +0 -32
  52. data/rubywmq.gemspec +0 -33
@@ -0,0 +1,3 @@
1
+ module WMQ #:nodoc
2
+ VERSION = "2.0.2"
3
+ end
data/tests/test.rb CHANGED
@@ -1,15 +1,14 @@
1
- # Shift include path to use locally built copy of rubywmq - For testing dev builds only
2
- #$:.unshift '../lib'
1
+ # Allow test to be run in-place without requiring a gem install
2
+ $LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
3
3
 
4
4
  require 'rubygems'
5
- require 'wmq/wmq'
6
- require 'wmq/wmq_const_admin'
5
+ require 'wmq'
7
6
  require 'test/unit'
8
7
  class TestTest < Test::Unit::TestCase
9
8
 
10
9
  def setup
11
10
  puts '****** setup: start ******'
12
- @queue_manager = WMQ::QueueManager.new(:q_mgr_name => 'REID') #, :connection_name=>'localhost(1414)')
11
+ @queue_manager = WMQ::QueueManager.new(:q_mgr_name => 'TEST') #, :connection_name=>'localhost(1414)')
13
12
  @queue_manager.connect
14
13
 
15
14
  # Create Queue and clear any messages from the queue
@@ -161,7 +160,7 @@ class TestTest < Test::Unit::TestCase
161
160
  count = count + 1
162
161
  end
163
162
  end
164
-
163
+
165
164
  def test_dlh
166
165
  puts '****** test_dlh ******'
167
166
  dlh = {:header_type =>:dead_letter_header,
@@ -205,7 +204,7 @@ class TestTest < Test::Unit::TestCase
205
204
  }
206
205
  verify_header(cics, WMQ::MQFMT_NONE)
207
206
  end
208
-
207
+
209
208
  def test_ims
210
209
  puts '****** test_ims ******'
211
210
  ims = {:header_type =>:ims,
@@ -214,7 +213,7 @@ class TestTest < Test::Unit::TestCase
214
213
  }
215
214
  verify_header(ims, WMQ::MQFMT_STRING)
216
215
  end
217
-
216
+
218
217
  def test_transmission_header
219
218
  puts '****** test_transmission_header ******'
220
219
  xqh = {:header_type =>:xmit_q_header,
@@ -225,45 +224,45 @@ class TestTest < Test::Unit::TestCase
225
224
  }
226
225
  verify_header(xqh, WMQ::MQFMT_STRING)
227
226
  end
228
-
227
+
229
228
  def test_rf_header
230
229
  puts '****** test_rf_header ******'
231
230
  rfh = {:header_type =>:rf_header,
232
- :name_value => {' name s' => ' v a "l" u e 1 ',
233
- 'n a m e 2 ' => 'v a l u e 2',
231
+ :name_value => {' name s' => ' v a "l" u e 1 ',
232
+ 'n a m e 2 ' => 'v a l u e 2',
234
233
  '' => ['"', '""', '"""', '""""', ''],
235
234
  'name3'=>['"value3"', '', '"',' value 43"']},
236
235
  }
237
236
  verify_header(rfh, WMQ::MQFMT_STRING)
238
237
  end
239
-
238
+
240
239
  def test_rf_header_2
241
240
  puts '****** test_rf_header_2 ******'
242
241
  rfh2 = {:header_type =>:rf_header_2,
243
- :xml => ['<hello>to the world</hello>',
242
+ :xml => ['<hello>to the world</hello>',
244
243
  '<another>xml like string</another>'],
245
244
  }
246
245
  verify_header(rfh2, WMQ::MQFMT_STRING)
247
246
  end
248
-
247
+
249
248
  def test_multiple_headers
250
249
  puts '****** test_multiple_headers ******'
251
250
  headers = [{:header_type => :rf_header_2,
252
- :xml => ['<hello>to the world</hello>',
251
+ :xml => ['<hello>to the world</hello>',
253
252
  '<another>xml like string</another>'],},
254
-
253
+
255
254
  {:header_type => :rf_header,
256
- :name_value => {' name s' => ' v a l u e 1 ',
257
- 'n a m e 2 ' => 'v a l u e 2',
255
+ :name_value => {' name s' => ' v a l u e 1 ',
256
+ 'n a m e 2 ' => 'v a l u e 2',
258
257
  'name3'=>['value3', '', 'value 43']} },
259
-
258
+
260
259
  {:header_type => :ims,
261
260
  :l_term_override => 'LTERM',
262
261
  :reply_to_format => WMQ::MQFMT_STRING},
263
-
262
+
264
263
  {:header_type => :rf_header,
265
- :name_value => {' name s' => ' v a l u e 1 ',
266
- 'n a m e 2 ' => 'v a l u e 2',
264
+ :name_value => {' name s' => ' v a l u e 1 ',
265
+ 'n a m e 2 ' => 'v a l u e 2',
267
266
  'name3'=>['value3', '', 'value 43']} },
268
267
 
269
268
  {:header_type => :cics,
@@ -273,16 +272,16 @@ class TestTest < Test::Unit::TestCase
273
272
 
274
273
  {:header_type => :rf_header_2,
275
274
  :xml => ['<hello>to the world</hello>', '<another>xml like string</another>'],},
276
-
275
+
277
276
  {:header_type => :xmit_q_header,
278
277
  :remote_q_name => 'SOME_REMOTE_QUEUE',
279
278
  :remote_q_mgr_name=> 'SOME_REMOTE_Q_MGR',
280
279
  :msg_type => WMQ::MQMT_REQUEST,
281
280
  :msg_id => 'my message Id'},
282
- ]
281
+ ]
283
282
  verify_multiple_headers(headers, WMQ::MQFMT_STRING)
284
283
  end
285
-
284
+
286
285
  def test_xmit_multiple_headers
287
286
  puts '****** test_xmit_q_header with ims header ******'
288
287
  headers = [{:header_type => :xmit_q_header,
@@ -290,39 +289,30 @@ class TestTest < Test::Unit::TestCase
290
289
  :remote_q_mgr_name=> 'SOME_REMOTE_Q_MGR',
291
290
  :msg_type => WMQ::MQMT_REQUEST,
292
291
  :msg_id => 'my message Id'},
293
-
292
+
294
293
  {:header_type => :ims,
295
294
  :l_term_override => 'LTERM',
296
295
  :reply_to_format => WMQ::MQFMT_STRING},
297
296
  ]
298
297
  verify_multiple_headers(headers, WMQ::MQFMT_STRING)
299
298
  end
300
-
299
+
301
300
  def test_message_grouping
302
301
  puts '****** test_message_grouping ******'
303
302
  # Clear out queue of any messages
304
303
  @in_queue.each { |message| }
305
-
304
+
306
305
  msg = WMQ::Message.new
307
306
  msg.data = 'First'
308
307
  msg.descriptor[:msg_flags] = WMQ::MQMF_MSG_IN_GROUP
309
308
  assert_equal(@out_queue.put(:message=>msg, :options => WMQ::MQPMO_LOGICAL_ORDER), true)
310
-
309
+
311
310
  msg.data = 'Second'
312
311
  assert_equal(@out_queue.put(:message=>msg, :options => WMQ::MQPMO_LOGICAL_ORDER), true)
313
-
312
+
314
313
  msg.data = 'Last'
315
314
  msg.descriptor[:msg_flags] = WMQ::MQMF_LAST_MSG_IN_GROUP
316
315
  assert_equal(@out_queue.put(:message=>msg, :options => WMQ::MQPMO_LOGICAL_ORDER), true)
317
-
318
- # Now retrieve the messages destructively
319
- message = WMQ::Message.new
320
- test_sizes.each do |size|
321
- assert_equal(true, @in_queue.get(:message=>message, :match=>WMQ::MQMO_NONE))
322
- assert_equal(size, message.data.length)
323
- str = '0123456789ABCDEF' * (size/16) + '0123456789ABCDEF'[0,size%16]
324
- assert_equal(str, message.data)
325
- end
326
316
  end
327
-
317
+
328
318
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ferocia-rubywmq
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 2.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-11-28 00:00:00.000000000 Z
13
+ date: 2013-06-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: shoulda
@@ -36,6 +36,9 @@ extensions:
36
36
  - ext/extconf.rb
37
37
  extra_rdoc_files: []
38
38
  files:
39
+ - LICENSE.txt
40
+ - README.md
41
+ - Rakefile
39
42
  - examples/each_a.rb
40
43
  - examples/each_b.rb
41
44
  - examples/each_header.rb
@@ -60,8 +63,6 @@ files:
60
63
  - examples/q_to_files.rb
61
64
  - examples/request.rb
62
65
  - examples/server.rb
63
- - ext/build.bat
64
- - ext/build.sh
65
66
  - ext/decode_rfh.c
66
67
  - ext/decode_rfh.h
67
68
  - ext/extconf.rb
@@ -70,34 +71,23 @@ files:
70
71
  - ext/generate/generate_reason.rb
71
72
  - ext/generate/generate_structs.rb
72
73
  - ext/generate/wmq_structs.erb
73
- - ext/lib/wmq_temp.rb
74
74
  - ext/wmq.c
75
75
  - ext/wmq.h
76
76
  - ext/wmq_message.c
77
77
  - ext/wmq_mq_load.c
78
78
  - ext/wmq_queue.c
79
79
  - ext/wmq_queue_manager.c
80
+ - lib/rubywmq.rb
80
81
  - lib/wmq.rb
81
- - LICENSE
82
- - Manifest.txt
83
- - README
84
- - rubywmq.binary.gemspec
85
- - rubywmq.gemspec
82
+ - lib/wmq/message.rb
83
+ - lib/wmq/queue_manager.rb
84
+ - lib/wmq/version.rb
86
85
  - tests/test.rb
87
86
  - .document
88
87
  homepage: https://github.com/reidmorrison/rubywmq
89
88
  licenses:
90
89
  - Apache License V2.0
91
- post_install_message: ! '* ferocia-rubywmq builds against the WMQ libs, which aren''t
92
- available for OS X.
93
-
94
- * The gem will still install, but the build will be skipped, producing a
95
-
96
- * non-functional gem, so you''ll need stubs. (You can skip the build elsewhere by
97
-
98
- * setting the DISABLE_RUBYWMQ environment variable.)
99
-
100
- '
90
+ post_install_message:
101
91
  rdoc_options: []
102
92
  require_paths:
103
93
  - lib
data/LICENSE DELETED
@@ -1,13 +0,0 @@
1
- Copyright 2006 J. Reid Morrison. Dimension Solutions, Inc.
2
-
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
-
7
- http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.
data/Manifest.txt DELETED
@@ -1,20 +0,0 @@
1
- .document
2
- lib/wmq.rb
3
- ext/lib/wmq_temp.rb
4
- ext/decode_rfh.h
5
- ext/decode_rfh.c
6
- ext/wmq.h
7
- ext/wmq.c
8
- ext/wmq_message.c
9
- ext/wmq_mq_load.c
10
- ext/wmq_queue.c
11
- ext/wmq_queue_manager.c
12
- ext/extconf.rb
13
- ext/extconf_client.rb
14
- ext/build.bat
15
- ext/build.sh
16
- ext/generate/generate_const.rb
17
- ext/generate/generate_reason.rb
18
- ext/generate/generate_structs.rb
19
- ext/generate/wmq_structs.erb
20
- examples/files_to_q.cfg
data/README DELETED
@@ -1,73 +0,0 @@
1
- == Description
2
- rubywmq - RubyWMQ is a Ruby interface into WebSphere MQ, previously called MQSeries
3
-
4
- == Synopsis
5
- require 'wmq'
6
-
7
- WMQ::QueueManager.connect(:q_mgr_name=>'REID') do |qmgr|
8
- qmgr.put(:q_name=>'TEST.QUEUE', :data => 'Hello World')
9
- end
10
-
11
- == Building Ruby WMQ
12
- Building Ruby WMQ on UNIX/Linux
13
- -------------------------------
14
- The following is required to build from source code
15
- * A 'C' compiler
16
- * The WebSphere MQ Software development toolkit
17
-
18
- Extracting the source code package:
19
- * unzip package.zip
20
- * tar -xvf package.tar
21
-
22
- cd ext/wmq
23
- Edit the file build.sh and edit the location of WebSphere MQ (if not in /opt/mqm)
24
- Also edit extconf.rb and extconf_client.rb with the location of WebSphere MQ (if not in /opt/mqm)
25
-
26
- Run build.sh
27
-
28
- For any questions, or to report build errors, submit a new Support Request:
29
- http://rubywmq.rubyforge.org
30
-
31
- Building Ruby WMQ on Windows
32
- ----------------------------
33
- The following is required to build from source code
34
- * The Visual C++ 6.0 compiler
35
- * The WebSphere MQ Software development toolkit
36
-
37
- cd ext\wmq
38
- Edit the file build.bat and edit the location of WebSphere MQ
39
- (if not in C:\Program Files\IBM\WebSphere MQ)
40
- and the location of Visual C++ 6 (if not C:\Program Files\Microsoft Visual Studio\VC98)
41
- Also edit extconf.rb and extconf_client.rb with the location of WebSphere MQ (if not in C:\Program Files\IBM\WebSphere MQ)
42
-
43
- Run build.bat
44
-
45
- == Support
46
- For any questions, or to report build errors, submit a new Support Request:
47
- http://rubywmq.rubyforge.org
48
-
49
- == Future Plans
50
- Add more formatting option contants and related methods.
51
-
52
- == License
53
- Copyright 2006 J. Reid Morrison. Dimension Solutions, Inc.
54
-
55
- Licensed under the Apache License, Version 2.0 (the "License");
56
- you may not use this file except in compliance with the License.
57
- You may obtain a copy of the License at
58
-
59
- http://www.apache.org/licenses/LICENSE-2.0
60
-
61
- Unless required by applicable law or agreed to in writing, software
62
- distributed under the License is distributed on an "AS IS" BASIS,
63
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
64
- See the License for the specific language governing permissions and
65
- limitations under the License.
66
-
67
- == Copyright
68
- (C) 2006 J. Reid Morrison. Dimension Solutions, Inc.
69
- All Rights Reserved
70
-
71
- == Author
72
- Reid Morrison
73
- rubywmq at gmail dot com
data/ext/build.bat DELETED
@@ -1,3 +0,0 @@
1
- call "C:\Program Files\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT"
2
- ruby extconf.rb --with-mqm-include="C:\Program Files\IBM\WebSphere MQ\Tools\c\include"
3
- nmake
data/ext/build.sh DELETED
@@ -1,6 +0,0 @@
1
- ruby extconf.rb --with-mqm-include=/opt/mqm/inc --with-mqm-lib=/opt/mqm/lib
2
- make
3
- # Uncomment the following lines for platforms other than Solaris, Windows and Linux
4
- #ruby extconf_client.rb --with-mqm-include=/opt/mqm/inc --with-mqm-lib=/opt/mqm/lib
5
- #make
6
-
@@ -1,32 +0,0 @@
1
- require 'fileutils'
2
- require 'rubygems'
3
-
4
- if $0 == __FILE__
5
- FileUtils.mkdir_p('lib/wmq')
6
- Dir['ext/lib/*.rb'].each{|file| FileUtils.copy(file, File.join('lib/wmq', File.basename(file)))}
7
- FileUtils.copy('ext/wmq.so', 'lib/wmq/wmq.so')
8
- end
9
-
10
- spec = Gem::Specification.new do |s|
11
- s.name = 'rubywmq'
12
- s.version = '1.1.0'
13
- s.author = 'Reid Morrison'
14
- s.email = 'rubywmq@gmail.com'
15
- s.homepage = 'http://www.reidmorrison.com/rubywmq'
16
- s.platform = Gem::Platform::CURRENT
17
- s.summary = 'Ruby interface into WebSphere MQ (MQSeries)'
18
- s.description = 'RubyWMQ is a Ruby interface into WebSphere MQ, previously called MQSeries'
19
- s.files = Dir['examples/**/*.rb'] +
20
- Dir['examples/**/*.cfg'] +
21
- Dir['doc/**/*.*'] +
22
- Dir['lib/**/*.rb'] +
23
- ['lib/wmq/wmq.so', 'tests/test.rb', 'README', 'LICENSE']
24
- s.rubyforge_project = 'rubywmq'
25
- s.test_file = 'tests/test.rb'
26
- s.has_rdoc = false
27
- s.required_ruby_version = '>= 1.8.3'
28
- s.requirements << 'WebSphere MQ v5.3, v6 or v7 Client or Server'
29
- end
30
- if $0 == __FILE__
31
- Gem::Builder.new(spec).build
32
- end
data/rubywmq.gemspec DELETED
@@ -1,33 +0,0 @@
1
- $:.unshift File.expand_path('../lib', __FILE__)
2
-
3
- Gem::Specification.new do |spec|
4
-
5
- excludes = [/lib.wmq.constants\.rb/, /lib.wmq.constants_admin\.rb/, /ext.wmq_structs\.c/, /ext.wmq_reason\.c/, /ext.Makefile/, /ext.*\.o/, /ext.wmq\.so/, /\.gem$/, /\.log$/, /nbproject/]
6
-
7
- spec.name = 'ferocia-rubywmq'
8
- spec.version = "1.1.3"
9
- spec.platform = Gem::Platform::RUBY
10
- spec.authors = ['Reid Morrison', 'Edwin Fine']
11
- spec.email = ['reidmo@gmail.com']
12
- spec.homepage = 'https://github.com/reidmorrison/rubywmq'
13
- spec.date = Date.today.to_s
14
- spec.summary = "Native Ruby interface into WebSphere MQ"
15
- spec.description = "RubyWMQ is a high performance native Ruby interface into WebSphere MQ."
16
- spec.files = Dir.glob("./**/*").reject {|p| excludes.any? {|e| p[e] } }.map {|f| f.sub(/^\.\//, '')} + ['.document']
17
- spec.license = "Apache License V2.0"
18
- spec.extensions << 'ext/extconf.rb'
19
- spec.rubyforge_project = 'rubywmq'
20
- spec.test_file = 'tests/test.rb'
21
- spec.has_rdoc = true
22
- spec.required_ruby_version = '>= 1.8.4'
23
- spec.add_development_dependency 'shoulda'
24
- spec.requirements << 'WebSphere MQ v5.3, v6 or v7 Client or Server with Development Kit'
25
-
26
- spec.post_install_message = <<-MESSAGE
27
- * ferocia-rubywmq builds against the WMQ libs, which aren't available for OS X.
28
- * The gem will still install, but the build will be skipped, producing a
29
- * non-functional gem, so you'll need stubs. (You can skip the build elsewhere by
30
- * setting the DISABLE_RUBYWMQ environment variable.)
31
- MESSAGE
32
- end
33
-