oml4r 2.8.pre1 → 2.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -49,7 +49,7 @@ end
49
49
 
50
50
  # Initialise the OML4R module for your application
51
51
  opts = {:appName => 'oml4rSimpleExample',
52
- :expID => 'foo', :nodeId => 'n1',
52
+ :expID => 'foo', :nodeID => 'n1',
53
53
  :omlServer => 'file:-'} # Server could also be tcp:host:port
54
54
  # OML4R::create_channel(:default, 'file:-')
55
55
 
data/lib/oml4r.rb CHANGED
@@ -39,7 +39,7 @@ require 'thread'
39
39
  #
40
40
  module OML4R
41
41
 
42
- VERSION = "2.8.pre1"
42
+ VERSION = "2.8.0"
43
43
  REVISION = "$Revision: 1 $".split(":")[1].chomp("$").strip
44
44
  VERSION_STRING = "OML4R Client Library - Version #{VERSION} (#{REVISION})"
45
45
  DEF_SERVER_PORT = 3003
@@ -137,6 +137,7 @@ module OML4R
137
137
  index = ca[1]
138
138
  channel.send "#{t}\t#{index}\t#{msg}"
139
139
  end
140
+ args
140
141
  end
141
142
 
142
143
  def self.start_time()
@@ -163,6 +164,15 @@ module OML4R
163
164
 
164
165
  end
165
166
 
167
+ def self.__unfreeze__()
168
+ self.each_mp do |klass, defs|
169
+ defs[:seq_no] = 0
170
+ end
171
+ @@channels = {}
172
+ @@start_time = nil
173
+ @@frozen = false
174
+ end
175
+
166
176
  # Build the table schema for this MP and send it to the OML collection server
167
177
  # - name_prefix = the name for this MP to use as a prefix for its table
168
178
  def self.__print_meta__(name_prefix = nil)
@@ -253,13 +263,12 @@ module OML4R
253
263
  rest = op.parse(argv)
254
264
  return if noop
255
265
 
256
-
257
- Channel.create(:default, omlCollectUri) if omlCollectUri
258
-
259
266
  unless domain && nodeID && appName
260
267
  raise 'OML4R: Missing values for parameters :expID (--oml-exp-id), :nodeID (--oml-id), or :appName (in code)!'
261
268
  end
262
269
 
270
+ Channel.create(:default, omlCollectUri) if omlCollectUri
271
+
263
272
  # Handle the defined Measurement Points
264
273
  startTime = Time.now
265
274
  Channel.init_all(domain, nodeID, appName, startTime)
@@ -269,13 +278,6 @@ module OML4R
269
278
  rest || []
270
279
  end
271
280
 
272
- #
273
- # Create a new channel over which to send measurement channels.
274
- #
275
- def self.create_channel(name, url)
276
- Channel.create(name.to_s, url)
277
- end
278
-
279
281
  #
280
282
  # Close the OML collection. This will block until all outstanding data have been sent out.
281
283
  #
@@ -358,6 +360,8 @@ module OML4R
358
360
 
359
361
  def self.close_all()
360
362
  @@channels.values.each { |c| c.close }
363
+ @@channels = {}
364
+ MPBase.__unfreeze__()
361
365
  end
362
366
 
363
367
  attr_reader :url
@@ -431,6 +435,7 @@ module OML4R
431
435
  @out.flush
432
436
  end
433
437
  @out.close
438
+ @out = nil
434
439
  rescue Exception => ex
435
440
  msg = "Exception while sending message to channel '#{@url}' (#{ex})"
436
441
  Object.const_defined?(:MObject) ? MObject.warn(:oml4r, msg) : $stderr.puts("OML4R: #{msg}")
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oml4r
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.pre1
5
- prerelease: 4
4
+ version: 2.8.0
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - NICTA
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-19 00:00:00.000000000 Z
12
+ date: 2012-06-25 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ! '["Simple OML client library for Ruby"]'
15
15
  email:
@@ -42,9 +42,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
42
42
  required_rubygems_version: !ruby/object:Gem::Requirement
43
43
  none: false
44
44
  requirements:
45
- - - ! '>'
45
+ - - ! '>='
46
46
  - !ruby/object:Gem::Version
47
- version: 1.3.1
47
+ version: '0'
48
48
  requirements: []
49
49
  rubyforge_project:
50
50
  rubygems_version: 1.8.23