data_store 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a837902bf973aa7220c69c464c943542a116e6f
4
- data.tar.gz: c147852c7237f5f0ed5cc9bb1724ebd2a66e3ec6
3
+ metadata.gz: 2c34735dccf3a9b095a84663398f4f5ef694762a
4
+ data.tar.gz: 5df1f1707993adb5af2db292941d02ac54d835ca
5
5
  SHA512:
6
- metadata.gz: caba6009ba8df8d2d116c5ef7b8126584f2fb26769e37630ca9d8f9fede378c62d578c277d5b0be993f71c03903c09d2829f5fbea1c7907202e20a2de5bc66ba
7
- data.tar.gz: 875a37215df2c48e246cd4543b093a19c9570a2f98f8058fad18c30f50fd6e17bd50df1a8231d745d0638b8b79a6743d3e59615fd10573e083cb5a453d0dcd46
6
+ metadata.gz: 586ccd4bff93e8c517f6a9e7947b7d8a2e0e85d204c6b85404fc66511d65b1c1474f53050d4265c64f091c6d8de2fe12e2fb05b69fb8f0147ed0ca92851f90fb
7
+ data.tar.gz: e2eee169bfadcea8c2be379f0f68ca9e558281cc9455fad79cec84f11722e62a48e186fff2cc145e7a2ee9f7a33488d11a7aec42fe939407f9758a0420ea93b1
@@ -18,7 +18,7 @@ branches:
18
18
  only:
19
19
  - master
20
20
 
21
- script: "bundle exec rake test"
21
+ script: "CODECLIMATE_REPO_TOKEN=ab8d492d1d82e2b594bb4c4d6e712d67bae2ef3e117f0b25fbca7b31b85abc20 bundle exec rake test"
22
22
 
23
23
  env:
24
24
  - DB=postgres
@@ -1,3 +1,6 @@
1
+ ##0.2.2
2
+ *BUG FIX: proper handling in case a previous record contains a nil value"
3
+
1
4
  ##0.2.1
2
5
  *Update to Sequel 4.9.0 and Ruby 2.1.1
3
6
 
data/Gemfile CHANGED
@@ -14,6 +14,8 @@ platforms :ruby do
14
14
  gem 'pg'
15
15
  end
16
16
 
17
+ gem "codeclimate-test-reporter", group: :test, require: nil
18
+
17
19
  group :test, :development do
18
20
  gem 'rake'
19
21
  gem 'shoulda'
data/README.md CHANGED
@@ -1,8 +1,13 @@
1
1
  # DataStore
2
2
 
3
- <a href='http://travis-ci.org/dovadi/data_store'>
4
- ![http://travis-ci.org/dovadi/data_store](https://secure.travis-ci.org/dovadi/data_store.png)
5
- </a>
3
+ [![Gem Version](https://badge.fury.io/rb/data_store.svg)](http://badge.fury.io/rb/data_store)
4
+
5
+ [![Travis CI](https://secure.travis-ci.org/dovadi/data_store.png)](http://travis-ci.org/dovadi/data_store)
6
+
7
+ [![Code Climate](https://codeclimate.com/github/dovadi/data_store.png)](https://codeclimate.com/github/dovadi/data_store)
8
+
9
+ [![Code Climate](https://codeclimate.com/github/dovadi/data_store/coverage.png)](https://codeclimate.com/github/dovadi/data_store)
10
+
6
11
 
7
12
  DataStore is designed to store real time data and manage the growth of your dataset by deciding the time period of your historical data. DataStore is tested with Ruby 1.9.3, Rubinius and JRuby and works with three database adapters Sqlite, Mysql and Postgresql.
8
13
 
data/Rakefile CHANGED
@@ -11,4 +11,12 @@ Rake::TestTask.new(:test) do |test|
11
11
  test.verbose = true
12
12
  end
13
13
 
14
- task :default => :test
14
+ task :default => :test
15
+
16
+ task :console do
17
+ require 'irb'
18
+ require 'irb/completion'
19
+ require 'data_store'
20
+ ARGV.clear
21
+ IRB.start
22
+ end
@@ -105,11 +105,16 @@ module DataStore
105
105
  calculator.perform
106
106
  end
107
107
 
108
- def difference_with_previous(value)
108
+ def difference_with_previous(value)
109
109
  @original_value = value
110
110
  unless last.nil?
111
- value = value - last[:original_value]
112
- last.delete if last[:value] == last[:original_value]
111
+ begin
112
+ value = value - last[:original_value]
113
+ last.delete if last[:value] == last[:original_value]
114
+ rescue TypeError #It is possible a value is not stored properly the last time so we get a 'TypeError: nil can't be coerced into Float'
115
+ last.delete
116
+ value = 0
117
+ end
113
118
  end
114
119
  value
115
120
  end
@@ -1,3 +1,3 @@
1
1
  module DataStore
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
@@ -1,3 +1,6 @@
1
+ require "codeclimate-test-reporter"
2
+ CodeClimate::TestReporter.start
3
+
1
4
  require 'rubygems'
2
5
  require 'bundler'
3
6
  begin
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Oxener
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-19 00:00:00.000000000 Z
11
+ date: 2014-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel