r2corba 1.5.2 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (183) hide show
  1. checksums.yaml +4 -4
  2. data/README.rdoc +8 -5
  3. data/ext/libr2tao/any.cpp +12 -11
  4. data/ext/libr2tao/exception.cpp +6 -8
  5. data/ext/libr2tao/exception.h +1 -2
  6. data/ext/libr2tao/longdouble.cpp +5 -9
  7. data/ext/libr2tao/object.cpp +37 -53
  8. data/ext/libr2tao/orb.cpp +46 -73
  9. data/ext/libr2tao/r2tao_export.h +1 -1
  10. data/ext/libr2tao/r2tao_ext.h +8 -19
  11. data/ext/libr2tao/required.cpp +4 -28
  12. data/ext/libr2tao/required.h +23 -80
  13. data/ext/libr2tao/values.cpp +97 -98
  14. data/ext/libr2tao/values.h +36 -40
  15. data/ext/librpoa/iortable.cpp +6 -7
  16. data/ext/librpoa/poa.cpp +29 -32
  17. data/ext/librpoa/servant.cpp +39 -113
  18. data/ext/librpoa/servant.h +18 -40
  19. data/lib/corba.rb +1 -1
  20. data/lib/corba/cbase/ORB.rb +26 -23
  21. data/lib/corba/cbase/Request.rb +3 -3
  22. data/lib/corba/cbase/Streams.rb +2 -2
  23. data/lib/corba/cbase/Typecode.rb +6 -6
  24. data/lib/corba/cbase/Values.rb +4 -2
  25. data/lib/corba/cbase/exception.rb +6 -4
  26. data/lib/corba/cbase/poa.rb +1 -1
  27. data/lib/corba/cbase/policies.rb +2 -2
  28. data/lib/corba/cbase/require.rb +8 -1
  29. data/lib/corba/cmds/base.rb +1 -1
  30. data/lib/corba/common/Any.rb +3 -2
  31. data/lib/corba/common/IDL.rb +4 -7
  32. data/lib/corba/common/ORB.rb +22 -22
  33. data/lib/corba/common/Object.rb +14 -14
  34. data/lib/corba/common/Servant.rb +4 -4
  35. data/lib/corba/common/Stub.rb +6 -6
  36. data/lib/corba/common/Typecode.rb +72 -45
  37. data/lib/corba/common/Union.rb +5 -0
  38. data/lib/corba/common/Values.rb +1 -0
  39. data/lib/corba/common/const.rb +2 -2
  40. data/lib/corba/common/exception.rb +2 -1
  41. data/lib/corba/common/require.rb +8 -0
  42. data/lib/corba/common/version.rb +2 -2
  43. data/lib/corba/idl/IDL.rb +1 -1
  44. data/lib/corba/jbase/Any.rb +28 -26
  45. data/lib/corba/jbase/ORB.rb +5 -5
  46. data/lib/corba/jbase/Object.rb +13 -13
  47. data/lib/corba/jbase/Request.rb +8 -8
  48. data/lib/corba/jbase/Servant.rb +10 -10
  49. data/lib/corba/jbase/ServerRequest.rb +7 -7
  50. data/lib/corba/jbase/Streams.rb +67 -3
  51. data/lib/corba/jbase/Typecode.rb +17 -16
  52. data/lib/corba/jbase/Values.rb +2 -0
  53. data/lib/corba/jbase/exception.rb +2 -1
  54. data/lib/corba/jbase/poa.rb +20 -20
  55. data/lib/corba/jbase/policies.rb +32 -32
  56. data/lib/corba/jbase/require.rb +4 -0
  57. data/lib/corba/poa.rb +1 -1
  58. data/lib/corba/policies.rb +1 -1
  59. data/lib/corba/require.rb +2 -2
  60. data/lib/corba/svcs/ins/cos_naming.rb +37 -28
  61. data/lib/corba/svcs/ins/ins.rb +51 -51
  62. data/lib/corba/svcs/ins/naming_service.rb +8 -8
  63. data/lib/ridlbe/ruby/config.rb +78 -72
  64. data/lib/ridlbe/ruby/walker.rb +295 -272
  65. data/mkrf_conf_srcgem.rb +6 -6
  66. data/rakelib/bin.rake +1 -1
  67. data/rakelib/bin.rb +3 -3
  68. data/rakelib/build.rake +16 -16
  69. data/rakelib/config.rake +1 -1
  70. data/rakelib/config.rb +24 -25
  71. data/rakelib/ext.rake +7 -68
  72. data/rakelib/ext.rb +13 -13
  73. data/rakelib/ext_r2tao.rb +11 -54
  74. data/rakelib/gem.rake +40 -24
  75. data/rakelib/gem.rb +6 -6
  76. data/rakelib/package.rake +1 -1
  77. data/test/BiDirectional/client.rb +17 -17
  78. data/test/BiDirectional/run_test.rb +11 -11
  79. data/test/BiDirectional/server.rb +24 -25
  80. data/test/CORBA_Services/Naming/BindingIterator/client.rb +17 -17
  81. data/test/CORBA_Services/Naming/BindingIterator/run_test.rb +13 -13
  82. data/test/CORBA_Services/Naming/BindingIterator/server.rb +19 -19
  83. data/test/CORBA_Services/Naming/Corbaname/client.rb +15 -15
  84. data/test/CORBA_Services/Naming/Corbaname/run_test.rb +13 -13
  85. data/test/CORBA_Services/Naming/Corbaname/server.rb +30 -30
  86. data/test/CORBA_Services/Naming/Simple/client.rb +16 -16
  87. data/test/CORBA_Services/Naming/Simple/run_test.rb +13 -13
  88. data/test/CORBA_Services/Naming/Simple/server.rb +19 -19
  89. data/test/Collocation/run_test.rb +10 -10
  90. data/test/Collocation/test.rb +27 -20
  91. data/test/Connect_Timeout/client.rb +16 -17
  92. data/test/Connect_Timeout/run_test.rb +10 -10
  93. data/test/DII/client.rb +30 -30
  94. data/test/DII/run_test.rb +11 -11
  95. data/test/DII/server.rb +16 -16
  96. data/test/DSI/client.rb +16 -16
  97. data/test/DSI/run_test.rb +11 -11
  98. data/test/DSI/server.rb +17 -17
  99. data/test/Exceptions/client.rb +21 -21
  100. data/test/Exceptions/run_test.rb +11 -11
  101. data/test/Exceptions/server.rb +16 -16
  102. data/test/Hello/client.rb +16 -16
  103. data/test/Hello/run_test.rb +11 -11
  104. data/test/Hello/server.rb +17 -17
  105. data/test/IDL_Test/client.rb +21 -21
  106. data/test/IDL_Test/run_test.rb +11 -11
  107. data/test/IDL_Test/server.rb +19 -19
  108. data/test/IORMap/client.rb +14 -14
  109. data/test/IORMap/run_test.rb +11 -11
  110. data/test/IORMap/server.rb +26 -26
  111. data/test/IORTable/client.rb +14 -14
  112. data/test/IORTable/run_test.rb +11 -11
  113. data/test/IORTable/server.rb +26 -26
  114. data/test/Implicit_Conversion/client.rb +20 -17
  115. data/test/Implicit_Conversion/run_test.rb +11 -11
  116. data/test/Implicit_Conversion/server.rb +16 -16
  117. data/test/Multi_Threading/Multiple_ORB/client.rb +14 -14
  118. data/test/Multi_Threading/Multiple_ORB/run_test.rb +12 -12
  119. data/test/Multi_Threading/Multiple_ORB/server.rb +17 -17
  120. data/test/Multi_Threading/Simple/client.rb +17 -17
  121. data/test/Multi_Threading/Simple/run_test.rb +11 -11
  122. data/test/Multi_Threading/Simple/server.rb +16 -16
  123. data/test/Multi_Threading/Threads/client.rb +16 -16
  124. data/test/Multi_Threading/Threads/run_test.rb +11 -11
  125. data/test/Multi_Threading/Threads/server.rb +22 -22
  126. data/test/Multi_Threading/Threads/watchdog.rb +16 -16
  127. data/test/Multiple_Servant_Interfaces/client.rb +14 -14
  128. data/test/Multiple_Servant_Interfaces/run_test.rb +11 -11
  129. data/test/Multiple_Servant_Interfaces/server.rb +18 -18
  130. data/test/Nil/run_test.rb +10 -10
  131. data/test/Nil/test.rb +22 -19
  132. data/test/OBV/AbstractInterface/client.rb +14 -14
  133. data/test/OBV/AbstractInterface/run_test.rb +11 -11
  134. data/test/OBV/AbstractInterface/server.rb +20 -19
  135. data/test/OBV/Custom/OBV_impl.rb +2 -0
  136. data/test/OBV/Custom/client.rb +14 -14
  137. data/test/OBV/Custom/run_test.rb +11 -11
  138. data/test/OBV/Custom/server.rb +16 -16
  139. data/test/OBV/Simple/OBV_impl.rb +1 -0
  140. data/test/OBV/Simple/client.rb +14 -14
  141. data/test/OBV/Simple/run_test.rb +11 -11
  142. data/test/OBV/Simple/server.rb +16 -16
  143. data/test/OBV/Simple_Event/Event_impl.rb +1 -0
  144. data/test/OBV/Simple_Event/client.rb +14 -14
  145. data/test/OBV/Simple_Event/run_test.rb +11 -11
  146. data/test/OBV/Simple_Event/server.rb +16 -16
  147. data/test/OBV/Supports/client.rb +19 -19
  148. data/test/OBV/Supports/run_test.rb +11 -11
  149. data/test/OBV/Supports/server.rb +15 -15
  150. data/test/OBV/Supports/supports_impl.rb +3 -0
  151. data/test/OBV/Tree/client.rb +14 -14
  152. data/test/OBV/Tree/run_test.rb +11 -11
  153. data/test/OBV/Tree/server.rb +19 -19
  154. data/test/OBV/Truncatable/Truncatable_impl.rb +1 -1
  155. data/test/OBV/Truncatable/client.rb +57 -57
  156. data/test/OBV/Truncatable/run_test.rb +11 -11
  157. data/test/OBV/Truncatable/server.rb +15 -15
  158. data/test/OBV/ValueBox/client.rb +154 -153
  159. data/test/OBV/ValueBox/run_test.rb +11 -11
  160. data/test/OBV/ValueBox/server.rb +42 -42
  161. data/test/Object/client.rb +15 -15
  162. data/test/Object/run_test.rb +11 -11
  163. data/test/Object/server.rb +19 -19
  164. data/test/POA/run_test.rb +10 -10
  165. data/test/POA/test.rb +16 -16
  166. data/test/Param_Test/client.rb +51 -51
  167. data/test/Param_Test/run_test.rb +11 -11
  168. data/test/Param_Test/server.rb +59 -59
  169. data/test/Performance/Simple/client.rb +16 -16
  170. data/test/Performance/Simple/run_test.rb +11 -11
  171. data/test/Performance/Simple/server.rb +16 -16
  172. data/test/Policies/run_test.rb +10 -10
  173. data/test/Policies/test.rb +23 -24
  174. data/test/Timeout/client.rb +21 -21
  175. data/test/Timeout/run_test.rb +11 -11
  176. data/test/Timeout/server.rb +22 -22
  177. data/test/lib/assert.rb +0 -1
  178. data/test/lib/test.rb +27 -22
  179. data/test/test_runner.rb +20 -21
  180. metadata +11 -13
  181. data/ext/extload/extload.c +0 -60
  182. data/ext/librpoa/srvreq_fix.cpp +0 -282
  183. data/ext/librpoa/srvreq_fix.h +0 -148
@@ -50,18 +50,22 @@ module R2CORBA
50
50
  module Portable
51
51
  include_package 'org.omg.CORBA.portable'
52
52
  end
53
+
53
54
  module V2_3
54
55
  include_package 'org.omg.CORBA_2_3'
55
56
  module Portable
56
57
  include_package 'org.omg.CORBA.portable'
57
58
  end
58
59
  end
60
+
59
61
  module V2_5
60
62
  include_package 'org.omg.CORBA_2_5'
61
63
  end
64
+
62
65
  module V3_0
63
66
  include_package 'org.omg.CORBA_3_0'
64
67
  end
68
+
65
69
  module Jacorb
66
70
  module Util
67
71
  java_import org.jacorb.util.Version
data/lib/corba/poa.rb CHANGED
@@ -11,4 +11,4 @@
11
11
  #--------------------------------------------------------------------
12
12
 
13
13
  require 'corba.rb'
14
- require "corba/#{defined?(JRUBY_VERSION)?'jbase':'cbase'}/poa.rb"
14
+ require "corba/#{defined?(JRUBY_VERSION) ? 'jbase' : 'cbase'}/poa.rb"
@@ -14,4 +14,4 @@ require 'corba.rb'
14
14
  require 'corba/poa.rb'
15
15
  require 'corba/idl/BiDirPolicyC'
16
16
  require 'corba/idl/MessagingC'
17
- require "corba/#{defined?(JRUBY_VERSION)?'jbase':'cbase'}/policies.rb"
17
+ require "corba/#{defined?(JRUBY_VERSION) ? 'jbase' : 'cbase'}/policies.rb"
data/lib/corba/require.rb CHANGED
@@ -11,6 +11,6 @@
11
11
  #--------------------------------------------------------------------
12
12
 
13
13
  require 'corba/common/require'
14
- require "corba/#{defined?(JRUBY_VERSION)?'jbase':'cbase'}/require"
14
+ require "corba/#{defined?(JRUBY_VERSION) ? 'jbase' : 'cbase'}/require"
15
15
  require 'corba/idl/require'
16
- require "corba/#{defined?(JRUBY_VERSION)?'jbase':'cbase'}/post_require"
16
+ require "corba/#{defined?(JRUBY_VERSION) ? 'jbase' : 'cbase'}/post_require"
@@ -12,7 +12,7 @@
12
12
  #--------------------------------------------------------------------
13
13
 
14
14
  require 'corba/naming_service'
15
- if (defined?(JRUBY_VERSION) or R2CORBA::TAO::RUBY_THREAD_SUPPORT)
15
+ if defined?(JRUBY_VERSION) or R2CORBA::TAO::RUBY_THREAD_SUPPORT
16
16
  require 'monitor'
17
17
  end
18
18
 
@@ -23,14 +23,16 @@ module CosNaming
23
23
  def to_key
24
24
  "#{self.r_id}|#{self.kind}"
25
25
  end
26
+
26
27
  # convert NameComponent to stringified format according to spec
27
28
  def to_string
28
29
  s = ''
29
- s = self.r_id.gsub(/([\/\.\\])/,'\\\1') unless self.r_id.to_s.empty?
30
+ s = self.r_id.gsub(/([\/\.\\])/, '\\\1') unless self.r_id.to_s.empty?
30
31
  s << '.' if s.empty? or !self.kind.to_s.empty?
31
- s << self.kind.gsub(/([\/\.\\])/,'\\\1') unless self.kind.to_s.empty?
32
+ s << self.kind.gsub(/([\/\.\\])/, '\\\1') unless self.kind.to_s.empty?
32
33
  s
33
34
  end
35
+
34
36
  # convert stringified name back to NameComponent
35
37
  def self.from_string(snc)
36
38
  raise CosNaming::NamingContext::InvalidName.new if snc.empty?
@@ -43,9 +45,9 @@ module CosNaming
43
45
  esc_ = !esc_
44
46
  when '.'
45
47
  unless esc_
46
- raise CosNaming::NamingContext::InvalidName.new if off_>0
48
+ raise CosNaming::NamingContext::InvalidName.new if off_ > 0
47
49
  id_ = snc[0, i].gsub(/\\(\.|\\)/, '\1')
48
- off_ = i+1
50
+ off_ = i + 1
49
51
  end
50
52
  esc_ = false
51
53
  else
@@ -80,7 +82,7 @@ module R2CORBA
80
82
  def next_n(how_many)
81
83
  raise CORBA::BAD_PARAM.new if how_many < 1
82
84
  bindings = []
83
- while how_many>0 and !@rl.empty?
85
+ while how_many > 0 and !@rl.empty?
84
86
  reg = @rl.shift
85
87
  bindings << CosNaming::Binding.new(reg[:name], reg[:type])
86
88
  how_many -= 1
@@ -104,12 +106,13 @@ module R2CORBA
104
106
  # Map type to store bindings.
105
107
  # Use synchronized version for multithreading capable implementations.
106
108
  #
107
- if (defined?(JRUBY_VERSION) or R2CORBA::TAO::RUBY_THREAD_SUPPORT)
109
+ if defined?(JRUBY_VERSION) or R2CORBA::TAO::RUBY_THREAD_SUPPORT
108
110
  MAP_TYPE = Class.new(Monitor) do
109
111
  def initialize
110
112
  super
111
113
  @map_ = {}
112
114
  end
115
+
113
116
  def size()
114
117
  rc = 0
115
118
  synchronize do
@@ -117,6 +120,7 @@ module R2CORBA
117
120
  end
118
121
  return rc
119
122
  end
123
+
120
124
  def has_key?(key)
121
125
  rc = false
122
126
  synchronize do
@@ -124,6 +128,7 @@ module R2CORBA
124
128
  end
125
129
  return rc
126
130
  end
131
+
127
132
  def [](key)
128
133
  rc = nil
129
134
  synchronize do
@@ -131,12 +136,14 @@ module R2CORBA
131
136
  end
132
137
  return rc
133
138
  end
139
+
134
140
  def []=(key, value)
135
141
  synchronize do
136
142
  @map_[key] = value
137
143
  end
138
144
  value
139
145
  end
146
+
140
147
  def delete(key)
141
148
  rc = nil
142
149
  synchronize do
@@ -144,6 +151,7 @@ module R2CORBA
144
151
  end
145
152
  return rc
146
153
  end
154
+
147
155
  def values
148
156
  rc = nil
149
157
  synchronize do
@@ -151,6 +159,7 @@ module R2CORBA
151
159
  end
152
160
  return rc
153
161
  end
162
+
154
163
  def each(&block)
155
164
  synchronize do
156
165
  @map_.each &block
@@ -197,8 +206,8 @@ module R2CORBA
197
206
  # CosNaming::NamingContext methods
198
207
  #
199
208
  def bind(n, obj)
200
- raise CosNaming::NamingContext::InvalidName.new if n.size<1
201
- if n.size>1
209
+ raise CosNaming::NamingContext::InvalidName.new if n.size < 1
210
+ if n.size > 1
202
211
  nc = find_context(n)
203
212
  nc.bind(n, obj)
204
213
  else
@@ -207,8 +216,8 @@ module R2CORBA
207
216
  end
208
217
 
209
218
  def rebind(n, obj)
210
- raise CosNaming::NamingContext::InvalidName.new if n.size<1
211
- if n.size>1
219
+ raise CosNaming::NamingContext::InvalidName.new if n.size < 1
220
+ if n.size > 1
212
221
  nc = find_context(n)
213
222
  nc.rebind(n, obj)
214
223
  else
@@ -217,8 +226,8 @@ module R2CORBA
217
226
  end
218
227
 
219
228
  def bind_context(n, nc_new)
220
- raise CosNaming::NamingContext::InvalidName.new if n.size<1
221
- if n.size>1
229
+ raise CosNaming::NamingContext::InvalidName.new if n.size < 1
230
+ if n.size > 1
222
231
  nc = find_context(n)
223
232
  nc.bind_context(n, nc_new)
224
233
  else
@@ -227,8 +236,8 @@ module R2CORBA
227
236
  end
228
237
 
229
238
  def rebind_context(n, nc_new)
230
- raise CosNaming::NamingContext::InvalidName.new if n.size<1
231
- if n.size>1
239
+ raise CosNaming::NamingContext::InvalidName.new if n.size < 1
240
+ if n.size > 1
232
241
  nc = find_context(n)
233
242
  nc.rebind_context(n, nc_new)
234
243
  else
@@ -237,13 +246,13 @@ module R2CORBA
237
246
  end
238
247
 
239
248
  def resolve(n)
240
- raise CosNaming::NamingContext::InvalidName.new if n.size<1
249
+ raise CosNaming::NamingContext::InvalidName.new if n.size < 1
241
250
  find_object(n)
242
251
  end
243
252
 
244
253
  def unbind(n)
245
- raise CosNaming::NamingContext::InvalidName.new if n.size<1
246
- if n.size>1
254
+ raise CosNaming::NamingContext::InvalidName.new if n.size < 1
255
+ if n.size > 1
247
256
  nc = find_context(n)
248
257
  nc.unbind(n)
249
258
  else
@@ -263,14 +272,14 @@ module R2CORBA
263
272
  end
264
273
 
265
274
  def bind_new_context(n)
266
- raise CosNaming::NamingContext::InvalidName.new if n.size<1
275
+ raise CosNaming::NamingContext::InvalidName.new if n.size < 1
267
276
  nc = self.new_context()
268
277
  self.bind_context(n, nc)
269
278
  nc
270
279
  end
271
280
 
272
281
  def destroy()
273
- raise CosNaming::NamingContext::NotEmpty.new if @map.size>0
282
+ raise CosNaming::NamingContext::NotEmpty.new if @map.size > 0
274
283
  return if self.oid.nil? ## no oid for root context
275
284
  poa = self._default_POA
276
285
  poa.deactivate_object(self.oid)
@@ -280,7 +289,7 @@ module R2CORBA
280
289
  def list(how_many)
281
290
  reglist = @map.values
282
291
  bindings = []
283
- while how_many>0 and !reglist.empty?
292
+ while how_many > 0 and !reglist.empty?
284
293
  reg = reglist.shift
285
294
  bindings << CosNaming::Binding.new(reg[:name], reg[:type])
286
295
  how_many -= 1
@@ -298,7 +307,7 @@ module R2CORBA
298
307
  # CosNaming::NamingContextExt methods
299
308
  #
300
309
  def to_string(n)
301
- raise CosNaming::NamingContext::InvalidName.new if n.size<1
310
+ raise CosNaming::NamingContext::InvalidName.new if n.size < 1
302
311
  n.collect { |nc| nc.to_string }.join('/')
303
312
  end
304
313
 
@@ -308,13 +317,13 @@ module R2CORBA
308
317
  off_ = 0
309
318
  esc_ = false
310
319
  sn.size.times do |i|
311
- case sn[i,1]
320
+ case sn[i, 1]
312
321
  when '\\'
313
322
  esc_ = !esc_
314
323
  when '/'
315
324
  unless esc_
316
- snc_arr << sn[off_, i-off_]
317
- off_ = i+1
325
+ snc_arr << sn[off_, i - off_]
326
+ off_ = i + 1
318
327
  end
319
328
  esc_ = false
320
329
  else
@@ -327,7 +336,7 @@ module R2CORBA
327
336
 
328
337
  def to_url(addr, sn)
329
338
  raise CosNaming::NamingContext::InvalidName.new if addr.to_s.empty? or sn.to_s.empty?
330
- url = 'corbaname:'+addr+'#'
339
+ url = 'corbaname:' + addr + '#'
331
340
  sn.scan(/./) do |ch|
332
341
  if /[a-zA-Z0-9;\/:\?@=+\$,\-_\.!~*\'\(\)]/ =~ ch
333
342
  url << ch
@@ -385,7 +394,7 @@ module R2CORBA
385
394
  # resolving the context levels
386
395
  #
387
396
  def find_object(n)
388
- if n.size>1
397
+ if n.size > 1
389
398
  nc = find_context(n)
390
399
  nc.resolve(n)
391
400
  else
@@ -417,7 +426,7 @@ module R2CORBA
417
426
  end
418
427
  end
419
428
 
420
- end #of NamingContext servant
429
+ end # of NamingContext servant
421
430
 
422
431
  end
423
432
  end
@@ -65,7 +65,7 @@ module R2CORBA
65
65
  end
66
66
 
67
67
  begin
68
- File.open(self.pidfile, File::CREAT|File::EXCL|File::WRONLY) do |f|
68
+ File.open(self.pidfile, File::CREAT | File::EXCL | File::WRONLY) do |f|
69
69
  f.write Process.pid
70
70
  end
71
71
  report "INS - PID \##{Process.pid} written to '#{self.pidfile}'"
@@ -217,7 +217,7 @@ module R2CORBA
217
217
  end
218
218
 
219
219
  begin
220
- File.open(self.pidfile, File::CREAT|File::EXCL|File::WRONLY) do |f|
220
+ File.open(self.pidfile, File::CREAT | File::EXCL | File::WRONLY) do |f|
221
221
  f.write Process.pid
222
222
  end
223
223
  report "INS - PID \##{Process.pid} written to '#{self.pidfile}'"
@@ -302,7 +302,7 @@ module R2CORBA
302
302
  report 'INS - stopped'
303
303
  end
304
304
  else
305
- STDERR.puts "INS - restart command is only functional in daemon mode"
305
+ STDERR.puts 'INS - restart command is only functional in daemon mode'
306
306
  exit 1
307
307
  end
308
308
  end
@@ -385,12 +385,12 @@ module R2CORBA
385
385
  def INS.parse_arg
386
386
  script_name = File.basename($0, '.bat')
387
387
  if not script_name =~ /rins/
388
- script_name = "ruby "+$0
388
+ script_name = 'ruby ' + $0
389
389
  end
390
390
 
391
391
  @@command = ARGV.shift.to_sym unless ARGV.empty?
392
392
  unless COMMANDS.include?(@@command)
393
- STDERR.puts "ERROR: Invalid command [#{command}]!\n"+
393
+ STDERR.puts "ERROR: Invalid command [#{command}]!\n" +
394
394
  "Usage: #{script_name} #{COMMANDS.join('|')} [options]\n"
395
395
  exit 1
396
396
  end
@@ -417,7 +417,7 @@ module R2CORBA
417
417
  puts " provides help for the specified command\n\n"
418
418
  exit
419
419
  when :version
420
- puts "R2CORBA Interoprable Naming Service (INS) #{INS_VERSION_MAJOR}.#{INS_VERSION_MINOR}.#{INS_VERSION_RELEASE}"
420
+ puts "R2CORBA Interoperable Naming Service (INS) #{INS_VERSION_MAJOR}.#{INS_VERSION_MINOR}.#{INS_VERSION_RELEASE}"
421
421
  puts INS_COPYRIGHT
422
422
  puts ''
423
423
  exit
@@ -425,51 +425,51 @@ module R2CORBA
425
425
  ARGV.options do |opts|
426
426
  opts.banner = "Usage: #{script_name} start [options]"
427
427
 
428
- opts.separator ""
428
+ opts.separator ''
429
429
 
430
- opts.on("-i FILE", "--ior=FILE", String,
431
- "Specifies filename (incl. path) to write IOR to.",
432
- "Default: ./ins.ior") { |v| OPTIONS[:iorfile]=v }
430
+ opts.on('-i FILE', '--ior=FILE', String,
431
+ 'Specifies filename (incl. path) to write IOR to.',
432
+ 'Default: ./ins.ior') { |v| OPTIONS[:iorfile] = v }
433
433
  unless IS_WIN32
434
- opts.on("-p DIR", "--pid=DIR", String,
435
- "Specifies path to write pidfile to.",
436
- "Default: ./") { |v| OPTIONS[:piddir]=v }
434
+ opts.on('-p DIR', '--pid=DIR', String,
435
+ 'Specifies path to write pidfile to.',
436
+ 'Default: ./') { |v| OPTIONS[:piddir] = v }
437
437
  unless IS_JRUBY
438
- opts.on("-o DIR", "--output=DIR", String,
439
- "Specifies filename to write logfile to.",
440
- "Default: <piddir>") { |v| OPTIONS[:logdir]=v }
438
+ opts.on('-o DIR', '--output=DIR', String,
439
+ 'Specifies filename to write logfile to.',
440
+ 'Default: <piddir>') { |v| OPTIONS[:logdir] = v }
441
441
  end
442
442
  else
443
- opts.on("-o DIR", "--output=DIR", String,
444
- "Specifies path to write logfile to.",
445
- "Default: ./") { |v| OPTIONS[:logdir]=v }
443
+ opts.on('-o DIR', '--output=DIR', String,
444
+ 'Specifies path to write logfile to.',
445
+ 'Default: ./') { |v| OPTIONS[:logdir] = v }
446
446
  end
447
- opts.on("-l PORTNUM", "--listen=PORTNUM", Integer,
448
- "Specifies port number for service endpoint.",
449
- "Default: none") { |v| OPTIONS[:port]=v }
450
- if (IS_JRUBY or R2CORBA::TAO::RUBY_THREAD_SUPPORT)
451
- opts.on("-t THREADNUM", "--threads=THREADNUM", Integer,
452
- "Specifies (minimum) number of threads for service.",
453
- "Default: 5") { |v| OPTIONS[:threads]=v }
447
+ opts.on('-l PORTNUM', '--listen=PORTNUM', Integer,
448
+ 'Specifies port number for service endpoint.',
449
+ 'Default: none') { |v| OPTIONS[:port] = v }
450
+ if IS_JRUBY or R2CORBA::TAO::RUBY_THREAD_SUPPORT
451
+ opts.on('-t THREADNUM', '--threads=THREADNUM', Integer,
452
+ 'Specifies (minimum) number of threads for service.',
453
+ 'Default: 5') { |v| OPTIONS[:threads] = v }
454
454
  end
455
455
 
456
456
  unless IS_JRUBY || !INS.daemons_installed
457
- opts.on("-d", "--daemon",
458
- "Run as daemon.",
459
- "Default: off") { |v| OPTIONS[:daemon]=v }
457
+ opts.on('-d', '--daemon',
458
+ 'Run as daemon.',
459
+ 'Default: off') { |v| OPTIONS[:daemon] = v }
460
460
  end
461
- opts.on("-v", "--verbose",
462
- "Run verbose.",
463
- "Default: off") { |v| OPTIONS[:verbose]=v }
461
+ opts.on('-v', '--verbose',
462
+ 'Run verbose.',
463
+ 'Default: off') { |v| OPTIONS[:verbose] = v }
464
464
 
465
- opts.on("--debug=LVL", Integer,
466
- "Specifies debug level.",
467
- "Default: 0") { |v| OPTIONS[:debug]=v }
465
+ opts.on('--debug=LVL', Integer,
466
+ 'Specifies debug level.',
467
+ 'Default: 0') { |v| OPTIONS[:debug] = v }
468
468
 
469
- opts.separator ""
469
+ opts.separator ''
470
470
 
471
- opts.on("-h", "--help",
472
- "Show this help message.") { puts opts; puts; exit }
471
+ opts.on('-h', '--help',
472
+ 'Show this help message.') { puts opts; puts; exit }
473
473
 
474
474
  opts.parse!
475
475
  end
@@ -478,28 +478,28 @@ module R2CORBA
478
478
  ARGV.options do |opts|
479
479
  opts.banner = "Usage: #{script_name} stop [options]"
480
480
 
481
- opts.separator ""
481
+ opts.separator ''
482
482
 
483
483
  unless IS_WIN32
484
- opts.on("-p DIR", "--pid=DIR", String,
485
- "Specifies path where pidfile is stored.",
486
- "Default: ./") { |v| OPTIONS[:piddir]=v }
484
+ opts.on('-p DIR', '--pid=DIR', String,
485
+ 'Specifies path where pidfile is stored.',
486
+ 'Default: ./') { |v| OPTIONS[:piddir] = v }
487
487
  end
488
488
 
489
489
  unless @@command == 'status'
490
490
  OPTIONS[:daemon] = true unless IS_JRUBY || !INS.daemons_installed
491
- opts.on("--[no-]daemon",
492
- "Do not run in daemon mode.",
493
- "Default: #{OPTIONS[:daemon] ? 'on' : 'off'}") { |v| OPTIONS[:daemon]=v }
491
+ opts.on('--[no-]daemon',
492
+ 'Do not run in daemon mode.',
493
+ "Default: #{OPTIONS[:daemon] ? 'on' : 'off'}") { |v| OPTIONS[:daemon] = v }
494
494
  end
495
- opts.on("-v", "--verbose",
496
- "Run verbose.",
497
- "Default: off") { |v| OPTIONS[:verbose]=v }
495
+ opts.on('-v', '--verbose',
496
+ 'Run verbose.',
497
+ 'Default: off') { |v| OPTIONS[:verbose] = v }
498
498
 
499
- opts.separator ""
499
+ opts.separator ''
500
500
 
501
- opts.on("-h", "--help",
502
- "Show this help message.") { puts opts; puts; exit }
501
+ opts.on('-h', '--help',
502
+ 'Show this help message.') { puts opts; puts; exit }
503
503
 
504
504
  opts.parse!
505
505
  end