shopifight 1.0.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f1e50a2e83bbb25f371cf2b9f3dc7920005380e91102dd2eccd309018bb18e44
4
+ data.tar.gz: 034045723b82047a3ef3e3c05f91412ee37af00938dc25ea1759ab96e6681bbb
5
+ SHA512:
6
+ metadata.gz: 36c019f498caf63dc0128cfb0394c74cd8e2fb35dfba804e22d6f34092a67880c40b18edf93036072cff3b23044ca4ba3d1b439f363df488c02f28703d555382
7
+ data.tar.gz: 3c46db95be77f0f04f3eb006991cdd86fe406bfae2d5c0ba25f9f043af314e611467214b07813c5877ab357d60366fbfc3a6237ee1b8f9a560b679dba2e667fe
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ Copyright (c) 2023 Daniel Cheron
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ - You may not use this Software in other training contexts.
11
+
12
+ - The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README ADDED
@@ -0,0 +1,6 @@
1
+ This is an example application used by Daniel Cheron in The Pragmatic Studio's
2
+ Ruby Programming course, as described at
3
+
4
+ http://pragmaticstudio.com
5
+
6
+ This code is Copyright 2023 Daniel Cheron. See the LICENSE file.
data/bin/players.csv ADDED
@@ -0,0 +1,3 @@
1
+ Mike,100
2
+ Annette,60
3
+ Ally,125
data/bin/shopifight ADDED
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative '../lib/game'
4
+ require_relative '../lib/clumsy_player'
5
+ require_relative '../lib/berserk_player'
6
+
7
+ game = ShopiFight::Game.new("Shopifight")
8
+
9
+ default_player_file =
10
+ File.join(File.dirname(__FILE__), 'players.csv')
11
+ game.load_players(ARGV.shift || default_player_file)
12
+
13
+ klutz = ShopiFight::ClumsyPlayer.new("klutz", 105)
14
+ game.add_player(klutz)
15
+
16
+ berserker = ShopiFight::BerserkPlayer.new("berserker", 50)
17
+ game.add_player(berserker)
18
+
19
+ loop do
20
+ puts "\nHow many rounds would you like to play? ('quit' to exit)"
21
+ answer = gets.chomp.downcase
22
+ case answer
23
+ when /^\d+$/
24
+ game.play(answer.to_i)
25
+ when 'quit', 'exit', 'q'
26
+ game.print_stats
27
+ break
28
+ else
29
+ puts "Please choose a number of rounds or 'quit'"
30
+ end
31
+ end
32
+
33
+ game.save_high_scores
data/lib/auditable.rb ADDED
@@ -0,0 +1,7 @@
1
+ module ShopiFight
2
+ module Auditable
3
+ def audit
4
+ puts "Rolled a #{self.number} (#{self.class})"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,35 @@
1
+ require_relative 'player'
2
+
3
+ module ShopiFight
4
+ class BerserkPlayer < Player
5
+ def initialize(name, health=100)
6
+ super(name, health)
7
+ @w00t_count = 0
8
+ end
9
+
10
+ def berserk?
11
+ @w00t_count > 5
12
+ end
13
+
14
+ def w00t
15
+ super
16
+ @w00t_count +=1
17
+ puts "#{@name} is berserk!" if berserk?
18
+ end
19
+
20
+ def blam
21
+ if berserk?
22
+ w00t
23
+ else
24
+ super
25
+ end
26
+ end
27
+ end
28
+
29
+ if __FILE__ == $0
30
+ berserker = BerserkPlayer.new("berserker", 50)
31
+ 6.times { berserker.w00t }
32
+ 2.times { berserker.blam }
33
+ puts berserker.health
34
+ end
35
+ end
@@ -0,0 +1,25 @@
1
+ require_relative 'player'
2
+
3
+ module ShopiFight
4
+ class ClumsyPlayer < Player
5
+ def found_treasure(treasure)
6
+ damaged_treasure = Treasure.new(treasure.name, treasure.points / 2.0)
7
+ super(damaged_treasure)
8
+ end
9
+ end
10
+ end
11
+
12
+ if __FILE__ == $0
13
+ clumsy = ClumsyPlayer.new("klutz")
14
+ hammer = Treasure.new(:hammer, 50)
15
+ clumsy.found_treasure(hammer)
16
+ clumsy.found_treasure(hammer)
17
+ clumsy.found_treasure(hammer)
18
+ crowbar = Treasure.new(:crowbar, 400)
19
+ clumsy.found_treasure(crowbar)
20
+ clumsy.each_found_treasure do |treasure|
21
+ puts "#{treasure.points} total #{treasure.name} points"
22
+ end
23
+ puts "#{clumsy.points} grand total points"
24
+ end
25
+
data/lib/die.rb ADDED
@@ -0,0 +1,18 @@
1
+ require_relative 'auditable'
2
+
3
+ module ShopiFight
4
+ class Die
5
+ include Auditable
6
+ attr_reader :number
7
+
8
+ def initialize
9
+ roll
10
+ end
11
+
12
+ def roll
13
+ @number = rand(1..6)
14
+ audit
15
+ @number
16
+ end
17
+ end
18
+ end
data/lib/game.rb ADDED
@@ -0,0 +1,98 @@
1
+ require_relative 'player'
2
+ require_relative 'game_turn'
3
+ require_relative 'treasure_trove'
4
+
5
+ module ShopiFight
6
+ class Game
7
+
8
+ attr_accessor :title
9
+
10
+ def initialize(title)
11
+ @title = title
12
+ @players = []
13
+ end
14
+
15
+ def add_player(a_player)
16
+ @players.push(a_player)
17
+ end
18
+
19
+ def play(rounds)
20
+ puts "There are #{@players.size} players in #{@title}: "
21
+
22
+ @players.each do |player|
23
+ puts player
24
+ end
25
+
26
+ treasures = TreasureTrove::TREASURES
27
+ puts "\nThere are #{treasures.size} treasures to be found:"
28
+ treasures.each do |treasure|
29
+ puts "A #{treasure.name} is worth #{treasure.points} points"
30
+ end
31
+
32
+ 1.upto(rounds) do |round|
33
+ puts "\nRound #{round}:"
34
+ @players.each do |player|
35
+ GameTurn.take_turn(player)
36
+ end
37
+ end
38
+ end
39
+
40
+ def print_name_and_health(player)
41
+ puts "#{player.name} (#{player.health})"
42
+ end
43
+
44
+ def high_score_entry(player)
45
+ formatted_name = player.name.ljust(20, '.')
46
+ "#{formatted_name} #{player.score}"
47
+ end
48
+
49
+ def total_points
50
+ @players.reduce(0) { |sum, player| sum + player.points }
51
+ end
52
+
53
+ def print_stats
54
+ puts "\n#{@title} Statistics:"
55
+
56
+ strong_players, wimpy_players = @players.partition { |player| player.strong? }
57
+
58
+ puts "\n#{strong_players.size} strong players:"
59
+ strong_players.each do |player|
60
+ print_name_and_health(player)
61
+ end
62
+
63
+ puts "\n#{wimpy_players.size} wimpy players:"
64
+ wimpy_players.each do |player|
65
+ print_name_and_health(player)
66
+ end
67
+
68
+ puts "\n#{total_points} total points from treasures found"
69
+ @players.each do |player|
70
+ puts "\n#{player.name}'s point totals:"
71
+ player.each_found_treasure do |treasure|
72
+ puts "#{treasure.points} total #{treasure.name} points"
73
+ end
74
+ puts "#{player.points} grand total points"
75
+ end
76
+
77
+ puts "\n#{@title} High Scores:"
78
+ @players.sort.each do |player|
79
+ puts high_score_entry(player)
80
+ end
81
+ end
82
+
83
+ def load_players(from_file)
84
+ File.readlines(from_file).each do |line|
85
+ add_player(Player.from_csv(line))
86
+ end
87
+ end
88
+
89
+ def save_high_scores(to_file="high_scores.txt")
90
+ File.open(to_file, "w") do |file|
91
+ file.puts "#{@title} High Scores:"
92
+ @players.sort.each do |player|
93
+ file.puts high_score_entry(player)
94
+ end
95
+ end
96
+ end
97
+ end
98
+ end
data/lib/game_turn.rb ADDED
@@ -0,0 +1,28 @@
1
+ require_relative 'player'
2
+ require_relative 'die'
3
+ require_relative 'treasure_trove'
4
+ require_relative 'loaded_die'
5
+
6
+ module ShopiFight
7
+ module GameTurn
8
+ def self.take_turn(player)
9
+ die = Die.new
10
+ case die.roll
11
+ when 1..2
12
+ player.blam
13
+ when 3..4
14
+ puts "#{player.name} was skipped."
15
+ else
16
+ player.w00t
17
+ end
18
+
19
+ treasure = TreasureTrove.random
20
+ player.found_treasure(treasure)
21
+ end
22
+ end
23
+
24
+ if __FILE__ == $0
25
+ player = Player.new("curly", 125)
26
+ GameTurn.take_turn(player)
27
+ end
28
+ end
data/lib/loaded_die.rb ADDED
@@ -0,0 +1,15 @@
1
+ require_relative 'auditable'
2
+
3
+ module ShopiFight
4
+ class LoadedDie
5
+ include Auditable
6
+ attr_reader :number
7
+
8
+ def roll
9
+ numbers = [1, 1, 2, 5, 6, 6]
10
+ @number = numbers.sample
11
+ audit
12
+ @number
13
+ end
14
+ end
15
+ end
data/lib/playable.rb ADDED
@@ -0,0 +1,19 @@
1
+ module ShopiFight
2
+ module Playable
3
+
4
+ def blam
5
+ self.health -= 10
6
+ puts "#{name} got blammed!"
7
+ end
8
+
9
+ def w00t
10
+ self.health += 15
11
+ puts "#{name} got w00ted!"
12
+ end
13
+
14
+ def strong?
15
+ self.health > 100
16
+ end
17
+
18
+ end
19
+ end
data/lib/player.rb ADDED
@@ -0,0 +1,59 @@
1
+ require_relative 'treasure_trove'
2
+ require_relative 'playable'
3
+
4
+ module ShopiFight
5
+ class Player
6
+ include Playable
7
+
8
+ attr_accessor :name, :health
9
+
10
+ def initialize(name, health=100)
11
+ @name = name.capitalize
12
+ @health = health
13
+ @found_treasures = Hash.new(0)
14
+ end
15
+
16
+ def score
17
+ @health + points
18
+ end
19
+
20
+ def points
21
+ @found_treasures.values.reduce(0, :+)
22
+ end
23
+
24
+ def found_treasure(treasure)
25
+ @found_treasures[treasure.name] += treasure.points
26
+ puts "#{@name} found a #{treasure.name} worth #{treasure.points} points."
27
+ end
28
+
29
+ def each_found_treasure
30
+ @found_treasures.each do |name, points|
31
+ next_treasure = Treasure.new(name, points)
32
+ yield next_treasure
33
+ end
34
+ end
35
+
36
+ def <=>(other)
37
+ other.score <=> score
38
+ end
39
+
40
+ def to_s
41
+ "I'm #{@name} with health = #{@health}, points = #{points}, and score = #{score}."
42
+ end
43
+
44
+ def self.from_csv(string)
45
+ name, health = string.split(',')
46
+ new(name, Integer(health))
47
+ end
48
+ end
49
+ end
50
+
51
+ if __FILE__ == $0
52
+ player = ShopiFight::Player.new("moe")
53
+ puts player.name
54
+ puts player.health
55
+ player.w00t
56
+ puts player.health
57
+ player.blam
58
+ puts player.health
59
+ end
@@ -0,0 +1,18 @@
1
+ module ShopiFight
2
+ Treasure = Struct.new(:name, :points)
3
+
4
+ module TreasureTrove
5
+ TREASURES = [
6
+ Treasure.new(:pie, 5),
7
+ Treasure.new(:bottle, 25),
8
+ Treasure.new(:hammer, 50),
9
+ Treasure.new(:skillet, 100),
10
+ Treasure.new(:broomstick, 200),
11
+ Treasure.new(:crowbar, 400)
12
+ ]
13
+
14
+ def self.random
15
+ TREASURES.sample
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,31 @@
1
+ require_relative 'shopifight/berserk_player'
2
+
3
+ module ShopiFight
4
+ describe BerserkPlayer do
5
+
6
+ before do
7
+ @initial_health = 50
8
+ @player = BerserkPlayer.new("berserker", @initial_health)
9
+ end
10
+
11
+ it "does not go berserk when w00ted up to 5 times" do
12
+ 1.upto(5) { @player.w00t }
13
+
14
+ @player.berserk?.should be_false
15
+ end
16
+
17
+ it "goes berserk when w00ted more than 5 times" do
18
+ 1.upto(6) { @player.w00t }
19
+
20
+ @player.berserk?.should be_true
21
+ end
22
+
23
+ it "gets w00ted instead of blammed when it's gone berserk" do
24
+ 1.upto(6) { @player.w00t }
25
+ 1.upto(2) { @player.blam }
26
+
27
+ @player.health.should == @initial_health + (8 * 15)
28
+ end
29
+
30
+ end
31
+ end
@@ -0,0 +1,33 @@
1
+ require_relative 'shopifight/clumsy_player'
2
+
3
+ module ShopiFight
4
+ describe ClumsyPlayer do
5
+ before do
6
+ @player = ClumsyPlayer.new("klutz")
7
+ end
8
+
9
+ it "only gets half the point value for each treasure" do
10
+ @player.points.should == 0
11
+
12
+ hammer = Treasure.new(:hammer, 50)
13
+ @player.found_treasure(hammer)
14
+ @player.found_treasure(hammer)
15
+ @player.found_treasure(hammer)
16
+
17
+ @player.points.should == 75
18
+
19
+ crowbar = Treasure.new(:crowbar, 400)
20
+ @player.found_treasure(crowbar)
21
+
22
+ @player.points.should == 275
23
+
24
+ yielded = []
25
+ @player.each_found_treasure do |treasure|
26
+ yielded << treasure
27
+ end
28
+
29
+ yielded.should == [Treasure.new(:hammer, 75), Treasure.new(:crowbar, 200)]
30
+ end
31
+
32
+ end
33
+ end
data/spec/game_spec.rb ADDED
@@ -0,0 +1,70 @@
1
+ require_relative 'shopifight/game'
2
+
3
+ module ShopiFight
4
+ describe Game do
5
+
6
+ before do
7
+ @game = Game.new("Shopifight")
8
+
9
+ @initial_health = 100
10
+ @player = Player.new("moe", @initial_health)
11
+
12
+ @game.add_player(@player)
13
+ end
14
+
15
+ it "has a title" do
16
+ @game.title.should == "Shopifight"
17
+ end
18
+
19
+ it "w00ts the player if a high number is rolled" do
20
+ Die.any_instance.stub(:roll).and_return(5)
21
+
22
+ @game.play(2)
23
+
24
+ @player.health.should == @initial_health + (15 * 2)
25
+ end
26
+
27
+ it "skips the player if a medium number is rolled" do
28
+ Die.any_instance.stub(:roll).and_return(3)
29
+
30
+ @game.play(2)
31
+
32
+ @player.health.should == @initial_health
33
+ end
34
+
35
+ it "blams the player if a low number is rolled" do
36
+ Die.any_instance.stub(:roll).and_return(1)
37
+
38
+ @game.play(2)
39
+
40
+ @player.health.should == @initial_health - (10 * 2)
41
+ end
42
+
43
+ it "assigns a treasure for points during a player's turn" do
44
+ game = Game.new("Shopifight")
45
+ player = Player.new("moe")
46
+
47
+ game.add_player(player)
48
+
49
+ game.play(1)
50
+
51
+ player.points.should_not be_zero
52
+ end
53
+
54
+ it "computes total points as the sum of all player points" do
55
+ game = Game.new("Shopifight")
56
+
57
+ player1 = Player.new("moe")
58
+ player2 = Player.new("larry")
59
+
60
+ game.add_player(player1)
61
+ game.add_player(player2)
62
+
63
+ player1.found_treasure(Treasure.new(:hammer, 50))
64
+ player1.found_treasure(Treasure.new(:hammer, 50))
65
+ player2.found_treasure(Treasure.new(:crowbar, 400))
66
+
67
+ game.total_points.should == 500
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,133 @@
1
+ require 'shopifight/player'
2
+
3
+ module ShopiFight
4
+ describe Player do
5
+ before do
6
+ @initial_health = 150
7
+ @player = Player.new("larry", @initial_health)
8
+ end
9
+
10
+ it "has a capitalized name" do
11
+ @player.name.should == "Larry"
12
+ end
13
+
14
+ it "has an initial health" do
15
+ @player.health.should == 150
16
+ end
17
+
18
+ it "has a string representation" do
19
+ @player.found_treasure(Treasure.new(:hammer, 50))
20
+ @player.found_treasure(Treasure.new(:hammer, 50))
21
+
22
+ @player.to_s.should == "I'm Larry with health = 150, points = 100, and score = 250."
23
+ end
24
+
25
+ it "increases health by 15 when w00ted" do
26
+ @player.w00t
27
+
28
+ @player.health.should == @initial_health + 15
29
+ end
30
+
31
+ it "decreases health by 10 when blammed" do
32
+ @player.blam
33
+
34
+ @player.health.should == @initial_health - 10
35
+ end
36
+
37
+ context "created with a default health" do
38
+ before do
39
+ @player = Player.new("larry")
40
+ end
41
+
42
+ it "has a health of 100" do
43
+ @player.health.should == 100
44
+ end
45
+ end
46
+
47
+ context "with a health greater than 100" do
48
+ before do
49
+ @player = Player.new("larry", 150)
50
+ end
51
+
52
+ it "is strong" do
53
+ @player.should be_strong
54
+ end
55
+ end
56
+
57
+ context "with a health of 100 or less" do
58
+ before do
59
+ @player = Player.new("larry", 100)
60
+ end
61
+
62
+ it "is wimpy" do
63
+ @player.should_not be_strong
64
+ end
65
+ end
66
+
67
+ context "in a collection of players" do
68
+ before do
69
+ @player1 = Player.new("moe", 100)
70
+ @player2 = Player.new("larry", 200)
71
+ @player3 = Player.new("curly", 300)
72
+
73
+ @players = [@player1, @player2, @player3]
74
+ end
75
+
76
+ it "is sorted by decreasing score" do
77
+ @players.sort.should == [@player3, @player2, @player1]
78
+ end
79
+ end
80
+
81
+ it "computes a score as the sum of its health and points" do
82
+ @player.found_treasure(Treasure.new(:hammer, 50))
83
+ @player.found_treasure(Treasure.new(:hammer, 50))
84
+
85
+ @player.score.should == 250
86
+ end
87
+
88
+ it "computes points as the sum of all treasure points" do
89
+ @player.points.should == 0
90
+
91
+ @player.found_treasure(Treasure.new(:hammer, 50))
92
+
93
+ @player.points.should == 50
94
+
95
+ @player.found_treasure(Treasure.new(:crowbar, 400))
96
+
97
+ @player.points.should == 450
98
+
99
+ @player.found_treasure(Treasure.new(:hammer, 50))
100
+
101
+ @player.points.should == 500
102
+ end
103
+
104
+ it "yields each found treasure and its total points" do
105
+ @player.found_treasure(Treasure.new(:skillet, 100))
106
+ @player.found_treasure(Treasure.new(:skillet, 100))
107
+ @player.found_treasure(Treasure.new(:hammer, 50))
108
+ @player.found_treasure(Treasure.new(:bottle, 5))
109
+ @player.found_treasure(Treasure.new(:bottle, 5))
110
+ @player.found_treasure(Treasure.new(:bottle, 5))
111
+ @player.found_treasure(Treasure.new(:bottle, 5))
112
+ @player.found_treasure(Treasure.new(:bottle, 5))
113
+
114
+ yielded = []
115
+ @player.each_found_treasure do |treasure|
116
+ yielded << treasure
117
+ end
118
+
119
+ yielded.should == [
120
+ Treasure.new(:skillet, 200),
121
+ Treasure.new(:hammer, 50),
122
+ Treasure.new(:bottle, 25)
123
+ ]
124
+ end
125
+
126
+ it "can be created from a CSV string" do
127
+ player = Player.from_csv("larry,150")
128
+
129
+ player.name.should == "Larry"
130
+ player.health.should == 150
131
+ end
132
+ end
133
+ end
@@ -0,0 +1,56 @@
1
+ require_relative 'shopifight/treasure_trove'
2
+ module ShopiFight
3
+ describe Treasure do
4
+
5
+ before do
6
+ @treasure = Treasure.new(:hammer, 50)
7
+ end
8
+
9
+ it "has a name attribute" do
10
+ @treasure.name.should == :hammer
11
+ end
12
+
13
+ it "has a points attribute" do
14
+ @treasure.points.should == 50
15
+ end
16
+
17
+ end
18
+
19
+ describe TreasureTrove do
20
+
21
+ it "has six treasures" do
22
+ TreasureTrove::TREASURES.size.should == 6
23
+ end
24
+
25
+ it "has a pie worth 5 points" do
26
+ TreasureTrove::TREASURES[0].should == Treasure.new(:pie, 5)
27
+ end
28
+
29
+ it "has a bottle worth 25 points" do
30
+ TreasureTrove::TREASURES[1].should == Treasure.new(:bottle, 25)
31
+ end
32
+
33
+ it "has a hammer worth 50 points" do
34
+ TreasureTrove::TREASURES[2].should == Treasure.new(:hammer, 50)
35
+ end
36
+
37
+ it "has a skillet worth 100 points" do
38
+ TreasureTrove::TREASURES[3].should == Treasure.new(:skillet, 100)
39
+ end
40
+
41
+ it "has a broomstick worth 200 points" do
42
+ TreasureTrove::TREASURES[4].should == Treasure.new(:broomstick, 200)
43
+ end
44
+
45
+ it "has a crowbar worth 400 points" do
46
+ TreasureTrove::TREASURES[5].should == Treasure.new(:crowbar, 400)
47
+ end
48
+
49
+ it "returns a random treasure" do
50
+ treasure = TreasureTrove.random
51
+
52
+ TreasureTrove::TREASURES.should include(treasure)
53
+ end
54
+
55
+ end
56
+ end
metadata ADDED
@@ -0,0 +1,93 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: shopifight
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Daniel Cheron
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-03-31 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 2.8.0
20
+ - - "~>"
21
+ - !ruby/object:Gem::Version
22
+ version: '2.8'
23
+ type: :development
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 2.8.0
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '2.8'
33
+ description: |
34
+ This is an example application used by Daniel Cheron in The Pragmatic Studio's
35
+ Ruby Programming course, as described at
36
+
37
+ http://pragmaticstudio.com
38
+
39
+ This code is Copyright 2023 Daniel Cheron. See the LICENSE file.
40
+ email: daniel.cheron@shopify.com
41
+ executables:
42
+ - shopifight
43
+ extensions: []
44
+ extra_rdoc_files: []
45
+ files:
46
+ - LICENSE
47
+ - README
48
+ - bin/players.csv
49
+ - bin/shopifight
50
+ - lib/auditable.rb
51
+ - lib/berserk_player.rb
52
+ - lib/clumsy_player.rb
53
+ - lib/die.rb
54
+ - lib/game.rb
55
+ - lib/game_turn.rb
56
+ - lib/loaded_die.rb
57
+ - lib/playable.rb
58
+ - lib/player.rb
59
+ - lib/treasure_trove.rb
60
+ - spec/berserk_player_spec.rb
61
+ - spec/clumsy_player_spec.rb
62
+ - spec/game_spec.rb
63
+ - spec/player_spec.rb
64
+ - spec/treasure_trove_spec.rb
65
+ homepage: http://pragmaticstudio.com
66
+ licenses:
67
+ - MIT
68
+ metadata: {}
69
+ post_install_message:
70
+ rdoc_options: []
71
+ require_paths:
72
+ - lib
73
+ required_ruby_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '2.3'
78
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ requirements: []
84
+ rubygems_version: 3.0.3.1
85
+ signing_key:
86
+ specification_version: 4
87
+ summary: A fun, and entirely random, text-based game feat. the Dev Success team
88
+ test_files:
89
+ - spec/clumsy_player_spec.rb
90
+ - spec/treasure_trove_spec.rb
91
+ - spec/berserk_player_spec.rb
92
+ - spec/player_spec.rb
93
+ - spec/game_spec.rb