drawy 0.0.2 → 0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e8b0b6bd2c7117dfeae351bc9c26f2925f10cddc
4
- data.tar.gz: dea46241155f3594e67a864e0ba5352a23f231f2
3
+ metadata.gz: 1a6af40ffa77462542b49e06c055f956a46b1555
4
+ data.tar.gz: cdd560b06c2ab24a8f6e98eeef936caf187af5d5
5
5
  SHA512:
6
- metadata.gz: 79ee0b06b46993b85b4532830c2b791ad5e56d8e96d727e90a3b28d3074ad98fdebdc064ac56f570bf6f5f69df5eb0048d741ffe070019b25651b777570b41b6
7
- data.tar.gz: be679cb029c8ff2201c6d6333f4075dd94328b30ccf394f17064963723cdf0c1e50c76e91bcb0b01e7964cd3cf2039232de7ad75bb6af950d08f138c5d6045d0
6
+ metadata.gz: 444b2be0f6275212399f6cf5f7ee4ae9ed9719ed1f2ecd9d347a0529f297ee81134f01b75bde8d63b58d15d3088f1251326847e5f8fa34c319e21c5b156855e0
7
+ data.tar.gz: 174c35ae4484259c977b5b0673d30b0bc30c2bd60799aae30f789e5c361ff56ac48d11a3f530ac79302992a1e5951b245cbaacf8ca8e3bfa2fc62ee6583e81f3
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Drawy
2
2
 
3
3
  Just a CLI application written in Ruby
4
+ Drawy make it easy to organize a drawing lot for christmas.
4
5
 
5
6
  ## Installation
6
7
 
data/drawy-0.0.2.gem ADDED
Binary file
@@ -12,6 +12,8 @@ module Drawy
12
12
  people = Drawy::Engine.people
13
13
  if people.nil? || people.empty? || people.size < 2
14
14
  raise Drawy::ValidationError, 'You must register at least 2 people or couples before drawing'
15
+ elsif people.size == 2 && Drawy::Engine.is_couple?(people[0], people[1])
16
+ raise Drawy::ValidationError, 'The current pool only contains a couple, please add more people'
15
17
  # A couple plus one person creates a triangle making the distribution impossible given the rules
16
18
  # We either end up with one person in couple buying a gift for its partner or the 3rd
17
19
  # person receiving 2 gifts and someone receiving none
data/lib/drawy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Drawy
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -31,12 +31,18 @@ class TestValidator < Minitest::Test
31
31
  end
32
32
  end
33
33
 
34
- Drawy::Engine.people = %w(john anna dan)
34
+ Drawy::Engine.people = %w(john anna)
35
35
  Drawy::Engine.couples = { 'john' => 'anna' }
36
36
 
37
37
  assert_raises Drawy::ValidationError do
38
38
  Drawy::Validator.validate_people_format
39
39
  end
40
+
41
+ Drawy::Engine.people += ['dan']
42
+
43
+ assert_raises Drawy::ValidationError do
44
+ Drawy::Validator.validate_people_format
45
+ end
40
46
  end
41
47
 
42
48
  def test_couple_plus_one?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drawy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neil Rosenstech
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-17 00:00:00.000000000 Z
11
+ date: 2014-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -69,6 +69,7 @@ files:
69
69
  - Rakefile
70
70
  - bin/drawy
71
71
  - drawy-0.0.1.gem
72
+ - drawy-0.0.2.gem
72
73
  - drawy.gemspec
73
74
  - lib/drawy.rb
74
75
  - lib/drawy/application.rb