Skip to content

Commit

Permalink
Merge pull request #224 from bcdice/remove-irc
Browse files Browse the repository at this point in the history
IRC関連のファイルを削除する
  • Loading branch information
ysakasin authored Jul 2, 2020
2 parents fcbfd5b + 497f911 commit cd94ce9
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 639 deletions.
21 changes: 0 additions & 21 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,18 @@ Bundler/DuplicatedGem:
Exclude:
- 'Gemfile'

# Offense count: 1
# Configuration parameters: AllowSafeAssignment.
Lint/AssignmentInCondition:
Exclude:
- 'src/irc/ircLib.rb'

# Offense count: 1
Lint/EmptyWhen:
Exclude:
- 'src/test.rb'

# Offense count: 1
# Configuration parameters: AllowComments.
Lint/HandleExceptions:
Exclude:
- 'src/irc/ircLib.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Bug?
Lint/LiteralInInterpolation:
Exclude:
- 'src/diceBot/GurpsFW.rb'

# Offense count: 3
Lint/RescueException:
Exclude:
- 'src/irc/ircLib.rb'

# Offense count: 177
Lint/UselessAssignment:
Enabled: false
Expand Down Expand Up @@ -130,7 +113,6 @@ Naming/UncommunicativeMethodParamName:
# SupportedStyles: inline, group
Style/AccessModifierDeclarations:
Exclude:
- 'src/irc/encode.rb'
- 'src/test/DiceBotTest.rb'

Style/BlockDelimiters:
Expand All @@ -146,8 +128,6 @@ Style/CaseEquality:
- src/bcdice.rb
- src/TableFileData.rb
- src/test/DiceBotTest.rb
- src/irc/ircLib.rb
- src/irc/encode.rb
- src/diceBot/Kamigakari_Korean.rb
- src/diceBot/HouraiGakuen.rb
- src/diceBot/FilledWith.rb
Expand Down Expand Up @@ -220,7 +200,6 @@ Style/GlobalVars:
- src/test/others/testSecretDice.rb
- src/test/others/testArgs.rb
- src/test/others/testCard.rb
- src/irc/ircBot.rb
- src/dice/AddDice.rb
- src/dice/RerollDice.rb
- src/diceBot/RecordOfSteam.rb
Expand Down
8 changes: 0 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
source 'https://rubygems.org'

unless ENV['CI'] == 'true'
gem 'net-irc'
if RUBY_VERSION < '2.0'
gem 'wxruby-ruby19', '2.0.0'
end
gem 'ocra'
end

group :development, :test do
if RUBY_VERSION < '1.9'
gem 'rake', '~> 10.5'
Expand Down
1 change: 0 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ namespace :test do
t.libs = [
'src/test',
'src/',
'src/irc'
]

unless RUBY_VERSION < '1.9'
Expand Down
14 changes: 0 additions & 14 deletions bcdice.ini

This file was deleted.

97 changes: 0 additions & 97 deletions src/ArgsAnalizer.rb

This file was deleted.

35 changes: 19 additions & 16 deletions src/CardTrader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
$ircNickRegExp = '[A-Za-z\d\-\[\]\\\'^{}_]+'

class CardTrader
OK_RESULT = '_OK_'.freeze
NG_RESULT = '_NG_'.freeze

# カード置き場数。0なら無し。
# @return [Integer]
attr_accessor :card_place
Expand Down Expand Up @@ -401,7 +404,7 @@ def pickupCardByCards(cards)

cards.each do |card|
string = pickupOneCard(card)
if string == $okResult
if string == OK_RESULT
okCount += 1
else
ngCardList << string
Expand All @@ -424,7 +427,7 @@ def pickupOneCard(card)
if isDelete
@deal_cards[destination] ||= []
@deal_cards[destination] << targetCard
return $okResult
return OK_RESULT
else
return targetCard; # 無かったカードを返す
end
Expand Down Expand Up @@ -467,7 +470,7 @@ def backCardByCommandSetAndPlace(commandset, place)

cards.each do |card|
string = backOneCard(card, destination, place)
if string == $okResult
if string == OK_RESULT
okCount += 1
else
ngCards << string
Expand All @@ -487,7 +490,7 @@ def backOneCard(targetCard, destination, place)

if @card_place > 0 # 場があるときのみ処理
string = transferOneCard(targetCard, "#{place}#{destination}", destination); # 場から手札への移動
return $okResult if string == $okResult
return OK_RESULT if string == OK_RESULT
end

@deal_cards['card_played'] ||= []
Expand All @@ -496,7 +499,7 @@ def backOneCard(targetCard, destination, place)

if isDelete
@deal_cards[destination] << targetCard
return $okResult
return OK_RESULT
end

return "${targetCard}"; # 戻せるカードが無かったらNGのカードを返す
Expand Down Expand Up @@ -628,7 +631,7 @@ def playCardByCardAndPlaceNo(card, place)
result = playOneCard(card, place)
debug("playOneCard result", result)

if result == $okResult
if result == OK_RESULT
okList << card
else
ngList << result
Expand All @@ -651,7 +654,7 @@ def playOneCard(card, place)
result = discardOneCard(card, place, destination); # 場を使わないときは捨て札扱い
end

if result == $okResult
if result == OK_RESULT
return result
else
return card
Expand Down Expand Up @@ -699,7 +702,7 @@ def discardCardsByCardsAndPlace(cards, place, destination)
cards.each do |card|
result = discardOneCard(card, place, destination)

if result == $okResult
if result == OK_RESULT
okList << card
else
ngList << result
Expand Down Expand Up @@ -737,7 +740,7 @@ def discardOneCard(card, place, destination)
@deal_cards['card_played'] += this_cards
debug("@deal_cards", @deal_cards)

return $okResult
return OK_RESULT
else
return card; # 指定のカードが無いので、無いカードを返す
end
Expand Down Expand Up @@ -847,9 +850,9 @@ def transferCardsByCards(cards, destination, nick_e)
debug('transferOneCard result', result)

case result
when $ngResult
when NG_RESULT
return -1, ['渡す相手が登録されていません']
when $okResult
when OK_RESULT
okCount += 1
else
ngCardList << result
Expand Down Expand Up @@ -903,13 +906,13 @@ def transferOneCard(card, from, toSend)
# debug('相手は未登録済み')
isSuccess = transferTargetCardToNewMember(toSend, thisCard)
debug('isSuccess', isSuccess)
return $ngResult unless isSuccess
return NG_RESULT unless isSuccess
end

@deal_cards[from] = restCards
debug("transferOneCard @deal_cards", @deal_cards)

return $okResult
return OK_RESULT
end

def ejectOneCardRandomFromCards(cards)
Expand Down Expand Up @@ -1043,9 +1046,9 @@ def getSendCardToTargetNickPlaceByCards(cards, destination, toSend)
result = transferOneCard(card, destination, toSend)

case result
when $ngResult
when NG_RESULT
return -1, '渡す相手が登録されていません'
when $okResult
when OK_RESULT
okCardList << card
else
ngCardList << result
Expand Down Expand Up @@ -1145,7 +1148,7 @@ def tapOneCardByCardAndPlace(card, place, isUntap)

@nick_e = nick_e_original

if result == $okResult
if result == OK_RESULT
return card, nil
else
return nil, card
Expand Down
2 changes: 0 additions & 2 deletions src/TableFileData.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# -*- coding: utf-8 -*-

require 'kconv'
require 'fileutils'
require 'configBcDice.rb'

# extratables ディレクトリに置かれたテーブル定義ファイルを読み込む。
# 詳細はREADME.txtの「7.オリジナルの表追加」を参照。
Expand Down
Loading

0 comments on commit cd94ce9

Please sign in to comment.