roundrobin 0.0.3 → 0.0.4

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: 9f0002e86d6baa2e66a1f102d6085088d7c2d0a7
4
- data.tar.gz: 4a16a3a024e757b43036a014b55fbe3c8477057b
3
+ metadata.gz: 251df981a6e399b20794cdcf1e3a287ee1064239
4
+ data.tar.gz: 1c751da8cdaeecd33f6b9f51eaa273fb57e78b16
5
5
  SHA512:
6
- metadata.gz: 795d752ec3f6eb30e872982ed51aee6eeb5a7c5438b53dc272bb42384d94398794dab312b40c725131de9c25b7463cd667d7593308ec5fce9b62ba6740582424
7
- data.tar.gz: 48bac9c4331dec2628c411856242188b788376cce85df464370bad4ad08d12772e97c7cdf316cd0142fc39c4fb49064ec45fca238f221788ed800b47e11633c8
6
+ metadata.gz: e1e0fd6447bcc0b75ed8981fa4ea76a0bf9632ae55f2b28528c7c18d592cf64e383b62e4ad933e26ccaeb6f7637b39c313f04e9a2d92d82ca9fc53e34224b904
7
+ data.tar.gz: fa48c36121ba061204c2fb1855609fe04b524f1121254bccade774d066c52ae218c5e32f52f2c156695ca78646d611fcef6fd1af88d446416c096b6d691b75ad
data/README.md CHANGED
@@ -6,34 +6,47 @@ Add a Round-Robin based process to your flow.
6
6
 
7
7
  Add this line to your application's Gemfile:
8
8
 
9
- ```ruby
9
+ ```rb
10
10
  gem 'roundrobin'
11
11
  ```
12
12
 
13
13
  And then execute:
14
14
 
15
- $ bundle
15
+ ```
16
+ $ bundle
17
+ ```
16
18
 
17
19
  Or install it yourself as:
18
20
 
19
- $ gem install roundrobin
21
+ ```
22
+ $ gem install roundrobin
23
+ ```
20
24
 
21
25
  ## Usage
22
26
 
27
+ Initialize your Round-Robin instance
23
28
  ```rb
24
- >> Roundrobin.next(%w(foo bar))
29
+ >> rr = Roundrobin.new
30
+ ```
31
+ or
32
+ ```rb
33
+ >> rr = Roundrobin.new("redis://:p4ssw0rd@10.0.1.1:6380/15")
34
+ ```
35
+ Now you can ask for the next item (in a Round-Robin logic)
36
+ ```rb
37
+ >> rr.next(%w(foo bar))
25
38
  => "foo"
26
- >> Roundrobin.next(%w(foo bar))
39
+ >> rr.next(%w(foo bar))
27
40
  => "bar"
28
- >> Roundrobin.next(%w(foo bar))
41
+ >> rr.next(%w(foo bar))
29
42
  => "foo"
30
43
 
31
44
  >> candidates = [{name: 'John', email: 'john@example.com'}, {name: 'Sara', email: 'sara@example.com'}])
32
- >> Roundrobin.next(candidates)
45
+ >> rr.next(candidates)
33
46
  => {name: 'John', email: 'john@example.com'}
34
- >> Roundrobin.next(candidates)
47
+ >> rr.next(candidates)
35
48
  => {name: 'Sara', email: 'sara@example.com'}
36
- >> Roundrobin.next(candidates)
49
+ >> rr.next(candidates)
37
50
  => {name: 'John', email: 'john@example.com'}
38
51
  ```
39
52
 
@@ -41,13 +54,15 @@ All the data will be persisted to your DB, so you can restart your server, or do
41
54
 
42
55
  ## Development
43
56
 
57
+ ```
44
58
  $ cd roundrobin
45
59
  $ gem build roundrobin.gemspec
46
60
  $ gem install ./roundrobin-XXX.gem
61
+ ```
47
62
 
48
63
  ## Contributing
49
64
 
50
- 1. Fork it ( https://github.com/[my-github-username]/roundrobin/fork )
65
+ 1. Fork it ( https://github.com/archdaily/roundrobin/fork )
51
66
  2. Create your feature branch (`git checkout -b my-new-feature`)
52
67
  3. Commit your changes (`git commit -am 'Add some feature'`)
53
68
  4. Push to the branch (`git push origin my-new-feature`)
@@ -1,3 +1,3 @@
1
1
  class Roundrobin
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Gustavo Garcia", "Sergio Márquez"]
10
10
  spec.email = ["dev@archdaily.com"]
11
11
  spec.summary = "Iterates over an array with a persisted Round-Robin algorithm"
12
- spec.description = "Set the array in a yml file and then just ask for the next item"
13
- spec.homepage = "http://github.com/pnet/roundrobin"
12
+ spec.description = "Just ask for the next item of a specified array. It will be persisted to a Redis DB"
13
+ spec.homepage = "http://github.com/archdaily/roundrobin"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gustavo Garcia
@@ -81,7 +81,8 @@ dependencies:
81
81
  - - '>='
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
- description: Set the array in a yml file and then just ask for the next item
84
+ description: Just ask for the next item of a specified array. It will be persisted
85
+ to a Redis DB
85
86
  email:
86
87
  - dev@archdaily.com
87
88
  executables: []
@@ -99,7 +100,7 @@ files:
99
100
  - roundrobin.gemspec
100
101
  - spec/roundrobin_spec.rb
101
102
  - spec/spec_helper.rb
102
- homepage: http://github.com/pnet/roundrobin
103
+ homepage: http://github.com/archdaily/roundrobin
103
104
  licenses:
104
105
  - MIT
105
106
  metadata: {}