tic_tac_toes 0.1.7 → 0.1.8

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: a6648939399c69e21afbe0a74301745f40b98e31
4
- data.tar.gz: dd3b0fd1992b99d8371ec706eef9d8e2d1941873
3
+ metadata.gz: bcac1579f402fe618f217be136e16cde83e4a876
4
+ data.tar.gz: 96a65f0375261f44ffbde3dd0af7b30349fa074c
5
5
  SHA512:
6
- metadata.gz: f68f75de8e357f772673a96bd0cca5f9c92ed4caf5d1659d9c824008c25bc017aed2675e2ea27eff51ec7c4011e695246d138c95c1a7f4c3f84ecd9b1ac3fa67
7
- data.tar.gz: c0aa21b6e2d0c232f55bc79db3cf4b893d76ac1ae3438922235ef4570e8dc6c665988637044d9b39e8d3f6507bdf0e1a1e2d2292a7f7f5739ce8c86ef4ea6350
6
+ metadata.gz: 4072723e31a232796c4dce79c3c7244b74e770927954d663f22558861e18dde1d4bf3001ba28976391d7ef1687b77451076d57b691d50ec191883f9630fb71fe
7
+ data.tar.gz: d464b36eecd7854380e4e765757687c16b7284f8f94942f67d2764d3ebeea9be2efffbae97238a021c6ee6bc2c89c259bd50798fa9d73f766db14ef3ac42d6db
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tic_tac_toes (0.1.7)
4
+ tic_tac_toes (0.1.8)
5
5
  pg
6
6
 
7
7
  GEM
@@ -14,7 +14,7 @@ module TicTacToes
14
14
  board.spaces
15
15
  end
16
16
 
17
- def self.game_state(board_structure, computer_type, move_history)
17
+ def self.game_state(board_structure, computer_type, move_history, connection)
18
18
  player_factory = Core::PlayerFactory.new('unused_io')
19
19
  human_player = player_factory.generate_player(X, Core::PlayerFactory::HUMAN)
20
20
  computer_player = player_factory.generate_player(O, Core::PlayerFactory.const_get(computer_type))
@@ -23,7 +23,7 @@ module TicTacToes
23
23
  board_structure_with_players = replace_tokens_with_players(board_structure, human_player, computer_player)
24
24
  board = board(board_structure_with_players)
25
25
 
26
- history = history(move_history)
26
+ history = history(move_history, connection)
27
27
 
28
28
  Core::GameState.new(board, players, history)
29
29
  end
@@ -73,8 +73,8 @@ module TicTacToes
73
73
  board
74
74
  end
75
75
 
76
- def self.history(move_history)
77
- storage_wrapper = Database::PGWrapper.new('tic_tac_toes')
76
+ def self.history(move_history, connection)
77
+ storage_wrapper = Database::PGWrapper.new(connection)
78
78
  history = Core::History.new(storage_wrapper)
79
79
  if move_history
80
80
  moves = move_history.split(//).each_slice(2).to_a
@@ -1,3 +1,3 @@
1
1
  module TicTacToes
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
@@ -17,8 +17,9 @@ describe TicTacToes::UI::Serializer do
17
17
  ai_type = 'EASY_AI'
18
18
  move_history = 'X0O4'
19
19
  ai = TicTacToes::Core::PlayerFactory::AIS.fetch(TicTacToes::Core::PlayerFactory::EASY_AI)
20
+ connection = double
20
21
 
21
- game_state = TicTacToes::UI::Serializer.game_state(board_structure, ai_type, move_history)
22
+ game_state = TicTacToes::UI::Serializer.game_state(board_structure, ai_type, move_history, connection)
22
23
  middle_space = game_state.board.space(4)
23
24
  first_player = game_state.players.first
24
25
  second_player = game_state.players.last
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tic_tac_toes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Spatafora