egauge 1.0.2 → 1.0.3

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.
@@ -1,4 +1,8 @@
1
- == 1.0.2 / 2012-11/14
1
+ == 1.0.3 / 2012-11-15
2
+
3
+ * Remove step from #each_row's yielded params in Data and Register
4
+
5
+ == 1.0.2 / 2012-11-14
2
6
 
3
7
  * Fix case where we have multiple data nodes in an XML dump due to a change in timing intervals - Scott Klein
4
8
 
@@ -1 +1 @@
1
- 1.0.2
1
+ 1.0.3
@@ -51,7 +51,7 @@ module EGauge
51
51
  end.inject(&:+)
52
52
  end
53
53
 
54
- # Run each value in this register
54
+ # Run each row in the dataset, yielding |timestamp, [register vals...]|
55
55
  def each_row
56
56
  @xml.group.elements.each do |chunk|
57
57
  # Set up for running this data chunk - prep timestamp and increment step from source xml
@@ -61,17 +61,17 @@ module EGauge
61
61
  # Run each row in the chunk, and yield our results
62
62
  (chunk / './r').each do |row|
63
63
  vals = (row / './c').collect {|c| c.text.to_i}
64
- yield ts, vals, step
64
+ yield ts, vals
65
65
  ts += step
66
66
  end
67
67
  end
68
68
  end
69
69
 
70
- # Return results as a 2D array, like so: [ [timestamp1, [val1, val2...], seconds1], [timestamp2, [val1, val2,...], seconds2], ... ]
70
+ # Return results as a 2D array, like so: [ [timestamp1, [val1, val2...]], [timestamp2, [val1, val2,...]], ... ]
71
71
  def to_a
72
72
  res = []
73
- each_row do |ts, vals, step|
74
- res << [ts, vals, step]
73
+ each_row do |ts, vals|
74
+ res << [ts, vals]
75
75
  end
76
76
  res
77
77
  end
@@ -23,17 +23,17 @@ module EGauge
23
23
  # Run each row in the chunk, and yield our results
24
24
  (chunk / './r').each do |row|
25
25
  val = (row / './c')[@index].text.to_i
26
- yield ts, val, step
26
+ yield ts, val
27
27
  ts += step
28
28
  end
29
29
  end
30
30
  end
31
31
 
32
- # Return results as a 2D array, like so: [ [timestamp1, val1, seconds1], [timestamp2, val2, seconds2], ... ]
32
+ # Return results as a 2D array, like so: [ [timestamp1, val1], [timestamp2, val2], ... ]
33
33
  def to_a
34
34
  res = []
35
- each_row do |ts, val, step|
36
- res << [ts, val, step]
35
+ each_row do |ts, val|
36
+ res << [ts, val]
37
37
  end
38
38
  res
39
39
  end
@@ -35,11 +35,10 @@ describe EGauge::Data do
35
35
  end
36
36
 
37
37
  it 'should allow access to full row data' do
38
- @data1.each_row do |ts, values, step|
38
+ @data1.each_row do |ts, values|
39
39
  ts.should be_a(Time)
40
40
  values.should be_a(Array)
41
41
  values.count.should == 3
42
- step.should == 60
43
42
  end
44
43
  end
45
44
 
@@ -24,10 +24,9 @@ describe EGauge::Register do
24
24
 
25
25
  it 'should allow iterating over values with timestamps' do
26
26
  counter = 0
27
- @reg.each_row do |ts, val, step|
27
+ @reg.each_row do |ts, val|
28
28
  val.should be_a(Integer)
29
29
  ts.should be_a(Time)
30
- step.should == 60
31
30
  counter += 1
32
31
  end
33
32
  counter.should == 3
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: egauge
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-14 00:00:00.000000000 Z
12
+ date: 2012-11-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec