geese 0.0.0 → 0.0.1

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: fc66387223baeff957286a2af52a9ac6bf38cb83
4
- data.tar.gz: ca3fe335e34ce5d1baaaef82e1b291e579c802ab
3
+ metadata.gz: 74a2d6cb0241d2ee87a4c078891a2f71f6e807f4
4
+ data.tar.gz: c9bc741cd2fe6fc519275ceb0dbf08024e047d01
5
5
  SHA512:
6
- metadata.gz: 3a9bd0091394218f1aa2dd9662590c96c708340da4a0ddfd4377ad34a51af7ea2ccbdce21e5e6b9be9ea3c58fac2498b9cec8d3e6e49f4233d13d8e9e1531635
7
- data.tar.gz: 9c238836acb8ee02b213a1436689f1b364dae1ef157511da36294eb9a8d9a44233ec61fc4e3e56b9bb1e75cd9182e626df9ac7c4d3aeb3d8bb076e60d28c49eb
6
+ metadata.gz: a04968f35b43189021ead3f17205304841209623917ffa620e664a4d97b865e93509f33f1950f411901466df81983c75acaae923fa542cb139010c3b3ebef151
7
+ data.tar.gz: 2e6a04f3d23a9df86abadfe9bfe53954f544f3bcbac3082539a8cf9f26500b0dc5811cff3ce214f9c07e93b309855bcfdbfd70bcae72d1f7ee9f0d4689e9799b
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ -c -fd
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- geese (0.0.0)
4
+ geese (0.0.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -0,0 +1,5 @@
1
+ # Game of Geese
2
+
3
+ [![Build Status](https://travis-ci.org/blackgeese/geese.svg?branch=master)](https://travis-ci.org/blackgeese/geese)
4
+
5
+ Black Geese's entry for Kabisa's Cucumber Challenge!
@@ -0,0 +1,36 @@
1
+ Stel(/^ik heb een speelbord met (\d+) vakjes$/) do |number_of_squares|
2
+ @board = Geese::Board.create_with_number_of_squares(number_of_squares)
3
+ end
4
+
5
+ Stel(/^ik heb de volgende spelers met de klok mee:$/) do |players|
6
+ players.hashes.each do |h|
7
+ @board.add_player(
8
+ name: h["naam"],
9
+ age: h["age"].to_i,
10
+ color: h["kleur pion"],
11
+ )
12
+ end
13
+ end
14
+
15
+ Stel(/^alle pionnen staan op het startvakje$/) do
16
+ end
17
+
18
+ Dan(/^is Piet aan de beurt om te dobbelen omdat hij de jongste speler is$/) do
19
+ pending # express the regexp above with the code you wish you had
20
+ end
21
+
22
+ Als(/^de beurt van Piet is geweest$/) do
23
+ pending # express the regexp above with the code you wish you had
24
+ end
25
+
26
+ Dan(/^is Klaas aan de beurt om te dobbelen$/) do
27
+ pending # express the regexp above with the code you wish you had
28
+ end
29
+
30
+ Als(/^de beurt van Klaas is geweest$/) do
31
+ pending # express the regexp above with the code you wish you had
32
+ end
33
+
34
+ Dan(/^is Jan aan de beurt om te dobbelen$/) do
35
+ pending # express the regexp above with the code you wish you had
36
+ end
@@ -1,5 +1,8 @@
1
1
  require 'aruba/cucumber'
2
2
 
3
+ $LOAD_PATH.unshift File.expand_path('../../../lib', __FILE__)
4
+ require 'geese'
5
+
3
6
  Before do
4
7
  set_env 'HOME', File.expand_path(File.join(current_dir, 'home'))
5
8
  FileUtils.mkdir_p ENV['HOME']
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["andymaes@gmail.com", "ariejan@ariejan.net"]
11
11
  spec.summary = %q{To be announced.}
12
12
  spec.description = %q{To be announced}
13
- spec.homepage = "https://github.com/blackgeese/geese"
13
+ spec.homepage = "http://blackgeese.github.io/geese"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
@@ -1,3 +1,4 @@
1
+ require 'geese/board'
1
2
  require 'geese/version'
2
3
 
3
4
  module Geese
@@ -0,0 +1,42 @@
1
+ module Geese
2
+ # Represents a Game of Geese board, you can create a new board with a
3
+ # number of squares. A classical Game of Geese board has 63 squares,
4
+ # exluding the 'start' square.
5
+ #
6
+ # Players can be added using `add_player`. This will add the players
7
+ # automatically to the 'start' squard
8
+ class Board
9
+
10
+ attr_reader :number_of_squares, :players
11
+
12
+ # Creates a new Board with the specified `number_of_squares`, this
13
+ # does not include the 'start' square, which is always present.
14
+ #
15
+ # The default `number_of_squares` is 63, for a classica Game of Geese.
16
+ def self.create_with_number_of_squares(number_of_squares = 63)
17
+ self.new(number_of_squares)
18
+ end
19
+
20
+ # Adds a player to the board, the following attributes need to be
21
+ # present:
22
+ #
23
+ # * name: "Gandalf" # Name of the player
24
+ # * age: 342 # Age of the player in years
25
+ # * color: "grey" # The color of the goose representing this player
26
+ #
27
+ # Example:
28
+ #
29
+ # board.add_player(name: 'Samual L. Jackson', age: 52, color: 'purple')
30
+ #
31
+ def add_player(attributes)
32
+ @players << attributes
33
+ end
34
+
35
+ private
36
+
37
+ def initialize(number_of_squares)
38
+ @number_of_squares = number_of_squares
39
+ @players = []
40
+ end
41
+ end
42
+ end
@@ -1,3 +1,3 @@
1
1
  module Geese
2
- VERSION = "0.0.0"
2
+ VERSION = "0.0.1"
3
3
  end
@@ -0,0 +1,25 @@
1
+ require 'spec_helper'
2
+
3
+ describe Geese::Board do
4
+
5
+ describe '.create_with_number_of_squares' do
6
+ it 'creates a board with the number of squares' do
7
+ board = Geese::Board.create_with_number_of_squares
8
+ expect(board.number_of_squares).to eq(63)
9
+
10
+ board = Geese::Board.create_with_number_of_squares(128)
11
+ expect(board.number_of_squares).to eq(128)
12
+ end
13
+ end
14
+
15
+
16
+ describe '#add_player' do
17
+ let(:board) { Geese::Board.create_with_number_of_squares(63) }
18
+
19
+ it 'adds a player to the board' do
20
+ board.add_player(player_attributes)
21
+ expect(board).to have(1).players
22
+ end
23
+ end
24
+
25
+ end
@@ -1,2 +1,10 @@
1
1
  $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
2
  require 'geese'
3
+
4
+ def player_attributes(override = {})
5
+ {
6
+ name: "Gandalf",
7
+ age: "341",
8
+ color: "grey",
9
+ }.merge!(override)
10
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geese
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maes
@@ -104,21 +104,27 @@ executables:
104
104
  extensions: []
105
105
  extra_rdoc_files: []
106
106
  files:
107
+ - ".gitignore"
108
+ - ".rspec"
107
109
  - ".ruby-gemset"
108
110
  - ".ruby-version"
109
111
  - ".travis.yml"
110
112
  - Gemfile
111
113
  - Gemfile.lock
114
+ - README.md
112
115
  - Rakefile
113
116
  - bin/geese
114
117
  - features/beurt_volgorde.feature
118
+ - features/step_definitions/geese_steps.rb
115
119
  - features/support/env.rb
116
120
  - geese.gemspec
117
121
  - lib/geese.rb
122
+ - lib/geese/board.rb
118
123
  - lib/geese/version.rb
124
+ - spec/geese/board_spec.rb
119
125
  - spec/geese_spec.rb
120
126
  - spec/spec_helper.rb
121
- homepage: https://github.com/blackgeese/geese
127
+ homepage: http://blackgeese.github.io/geese
122
128
  licenses:
123
129
  - MIT
124
130
  metadata: {}
@@ -144,6 +150,8 @@ specification_version: 4
144
150
  summary: To be announced.
145
151
  test_files:
146
152
  - features/beurt_volgorde.feature
153
+ - features/step_definitions/geese_steps.rb
147
154
  - features/support/env.rb
155
+ - spec/geese/board_spec.rb
148
156
  - spec/geese_spec.rb
149
157
  - spec/spec_helper.rb