Skip to content

Commit

Permalink
bundle update
Browse files Browse the repository at this point in the history
  • Loading branch information
gdonald committed Dec 9, 2023
1 parent 060d11b commit c856c39
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
ruby-version: ['3.2.1']
ruby-version: ['3.2.2']
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
Expand Down
4 changes: 3 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
require:
- rubocop-rspec
- rubocop-capybara
- rubocop-factory_bot
- rubocop-rake
- rubocop-rspec

AllCops:
NewCops: enable
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.1
3.2.2
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

ruby '3.2.1'
ruby '3.2.2'

source 'https://rubygems.org'

Expand Down
59 changes: 37 additions & 22 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,30 +1,42 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (7.0.5)
activesupport (7.1.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
ast (2.4.2)
base64 (0.2.0)
bigdecimal (3.1.4)
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
diff-lcs (1.5.0)
docile (1.4.0)
factory_bot (6.2.1)
drb (2.2.0)
ruby2_keywords
factory_bot (6.4.2)
activesupport (>= 5.0.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.6.3)
minitest (5.18.1)
json (2.7.1)
language_server-protocol (3.17.0.3)
minitest (5.20.0)
mutex_m (0.2.0)
parallel (1.23.0)
parser (3.2.2.3)
parser (3.2.2.4)
ast (~> 2.4.1)
racc
racc (1.7.1)
racc (1.7.3)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.8.1)
rexml (3.2.5)
rake (13.1.0)
regexp_parser (2.8.3)
rexml (3.2.6)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
Expand All @@ -34,33 +46,35 @@ GEM
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.5)
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.0)
rubocop (1.52.1)
rspec-support (3.12.1)
rubocop (1.58.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.3)
parser (>= 3.2.2.4)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.0, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.18.0)
rubocop-capybara (2.19.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.23.1)
rubocop-factory_bot (2.24.0)
rubocop (~> 1.33)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (2.22.0)
rubocop (~> 1.33)
rubocop-rspec (2.25.0)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
Expand All @@ -69,9 +83,10 @@ GEM
simplecov_json_formatter (0.1.4)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.4.2)
unicode-display_width (2.5.0)

PLATFORMS
arm64-darwin-22
ruby

DEPENDENCIES
Expand All @@ -84,7 +99,7 @@ DEPENDENCIES
simplecov

RUBY VERSION
ruby 3.2.1p31
ruby 3.2.2p53

BUNDLED WITH
2.3.15
2.4.22
2 changes: 1 addition & 1 deletion console-blackjack.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require 'rake'
Gem::Specification.new do |spec|
spec.required_ruby_version = '>= 3.2'
spec.name = 'console-blackjack'
spec.version = '1.1.3'
spec.version = '1.1.4'
spec.summary = 'Console Blackjack'
spec.description = 'Blackjack for your console, full version.'
spec.author = 'Greg Donald'
Expand Down
8 changes: 4 additions & 4 deletions lib/blackjack/shoe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def initialize(blackjack, num_decks)
end

def needs_to_shuffle?
return true if cards.size.zero?
return true if cards.empty?

cards_dealt = total_cards - cards.size
used = cards_dealt / total_cards.to_f * 100.0
Expand All @@ -38,8 +38,8 @@ def shuffle
def new_regular
self.cards = []
num_decks.times do
(0..3).each do |suit_value|
(0..12).each do |value|
4.times do |suit_value|
13.times do |value|
cards << Card.new(blackjack, value, suit_value)
end
end
Expand All @@ -50,7 +50,7 @@ def new_regular
def new_irregular(values = [])
self.cards = []
while cards.count < total_cards
(0..3).each do |suit_value|
4.times do |suit_value|
next if cards.count >= total_cards

values.each do |value|
Expand Down
6 changes: 2 additions & 4 deletions spec/blackjack_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,14 @@

context 'when busted' do
it 'returns false' do
allow(player_hand).to receive(:blackjack?).and_return(false)
allow(player_hand).to receive(:busted?).and_return(true)
allow(player_hand).to receive_messages(blackjack?: false, busted?: true)
expect(blackjack).to_not be_need_to_play_dealer_hand
end
end

context 'when blackjack' do
it 'returns false' do
allow(player_hand).to receive(:busted?).and_return(false)
allow(player_hand).to receive(:blackjack?).and_return(true)
allow(player_hand).to receive_messages(busted?: false, blackjack?: true)
expect(blackjack).to_not be_need_to_play_dealer_hand
end
end
Expand Down

0 comments on commit c856c39

Please sign in to comment.