data_store 0.1.1 → 0.1.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.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ##0.1.2
2
+
3
+ * First timestamp, then value when fetching from data_store
4
+
1
5
  ##0.1.1
2
6
 
3
7
  * Add index in table definition
@@ -59,7 +59,7 @@ module DataStore
59
59
  def fetch(options)
60
60
  datapoints = []
61
61
  query = parent.db[timeslot(options)].where{created >= options[:from]}.where{created <= options[:till]}.order(:created)
62
- query.all.map{|record| datapoints <<[record[:value], record[:created]]}
62
+ query.all.map{|record| datapoints <<[record[:created], record[:value]]}
63
63
  datapoints
64
64
  end
65
65
 
@@ -1,3 +1,3 @@
1
1
  module DataStore
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
data/test/table_test.rb CHANGED
@@ -69,8 +69,8 @@ class TableTest < Test::Unit::TestCase
69
69
  end
70
70
 
71
71
  should 'return the datapoints in a given time frame' do
72
- assert_equal [10.0, 11.0], @table.fetch(:from => @from, :till => @till).map{|datapoint| datapoint[0]}
73
- assert_equal [@from.round, (@from + 10).round], @table.fetch(:from => @from, :till => @till).map{|datapoint| datapoint[1].round}
72
+ assert_equal [10.0, 11.0], @table.fetch(:from => @from, :till => @till).map{|datapoint| datapoint[1]}
73
+ assert_equal [@from.round, (@from + 10).round], @table.fetch(:from => @from, :till => @till).map{|datapoint| datapoint[0].round}
74
74
  end
75
75
 
76
76
  should 'return the datapoints from the corresponding time frame' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
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: 2013-03-29 00:00:00.000000000 Z
12
+ date: 2013-04-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sequel
@@ -78,7 +78,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
78
78
  version: '0'
79
79
  segments:
80
80
  - 0
81
- hash: -1448628229198858283
81
+ hash: -2580536091282082600
82
82
  required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  version: '0'
88
88
  segments:
89
89
  - 0
90
- hash: -1448628229198858283
90
+ hash: -2580536091282082600
91
91
  requirements: []
92
92
  rubyforge_project:
93
93
  rubygems_version: 1.8.25