roundrobin 0.0.4 → 0.0.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 251df981a6e399b20794cdcf1e3a287ee1064239
4
- data.tar.gz: 1c751da8cdaeecd33f6b9f51eaa273fb57e78b16
3
+ metadata.gz: 21bc377c69a4645046f1df3ebc76bf8375b8e8a7
4
+ data.tar.gz: 0fc13729bd5b017290ec64392fca08042e91f755
5
5
  SHA512:
6
- metadata.gz: e1e0fd6447bcc0b75ed8981fa4ea76a0bf9632ae55f2b28528c7c18d592cf64e383b62e4ad933e26ccaeb6f7637b39c313f04e9a2d92d82ca9fc53e34224b904
7
- data.tar.gz: fa48c36121ba061204c2fb1855609fe04b524f1121254bccade774d066c52ae218c5e32f52f2c156695ca78646d611fcef6fd1af88d446416c096b6d691b75ad
6
+ metadata.gz: 49ae5665ce1a5540a487d8c8e8f5484f53b34792b99c9f5eda3d5805192eddf1ea8658f2da4c1414cac95f2a02c6eb0c00d81ef809f15f083177d17dfd60ab3d
7
+ data.tar.gz: 1026a9db00d090f3135a4266b65254c0f38e28495dc2e323dba3fc7e725c27c25de8824d8adc7bf29a745552515a3e65d4da107a454ba343aa8159826b1fc67f
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.0
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # RoundRobin
2
+ [![Build Status](https://travis-ci.org/archdaily/roundrobin.svg?branch=master)](https://travis-ci.org/archdaily/roundrobin)
2
3
 
3
4
  Add a Round-Robin based process to your flow.
4
5
 
data/Rakefile CHANGED
@@ -1,2 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
2
3
 
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -9,7 +9,7 @@ class Roundrobin
9
9
  end
10
10
 
11
11
  def next(candidates)
12
- return nil unless candidates.is_a?(Array)
12
+ return nil unless candidates.is_a?(Array) and candidates.length > 0
13
13
  identifier = get_hash(candidates)
14
14
  iterator = @redis.get(identifier)
15
15
  if iterator.nil?
@@ -1,3 +1,3 @@
1
1
  class Roundrobin
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -34,5 +34,9 @@ RSpec.describe Roundrobin, :type => :model do
34
34
  it 'works with integers' do
35
35
  expect(rr.next([1,2,3])).to eq(1)
36
36
  end
37
+
38
+ it "returns nil for a empty array" do
39
+ expect(rr.next([])).to be_nil
40
+ end
37
41
  end
38
42
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roundrobin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gustavo Garcia
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-08-31 00:00:00.000000000 Z
12
+ date: 2015-09-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: redis
@@ -91,6 +91,7 @@ extra_rdoc_files: []
91
91
  files:
92
92
  - .gitignore
93
93
  - .rspec
94
+ - .travis.yml
94
95
  - Gemfile
95
96
  - LICENSE.txt
96
97
  - README.md