Skip to content

Commit

Permalink
Merge branch 'master' into tester-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
ysakasin committed Jan 30, 2023
2 parents e9efab8 + e4bc5f0 commit 1c748df
Show file tree
Hide file tree
Showing 26 changed files with 909 additions and 260 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.git/
vendor/
vendor/
bcdice/
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [2.5, 2.6, 2.7]
ruby: ["2.6", "2.7", "3.0", "3.1"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -15,5 +15,4 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle install
- run: bundle exec rake test
18 changes: 3 additions & 15 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
AllCops:
NewCops: disable
Exclude:
- "bcdice/**/*"
- "config/**/*"
- "vendor/**/*"

Metrics:
Exclude:
- "lib/bcdice_wrap.rb"
- "lib/bcdice_api/app.rb"

Metrics/ClassLength:
Exclude:
- "test/**/*"

Metrics/AbcSize:
Exclude:
- "test/**/*"
- "lib/bcdice_wrap.rb"
- "lib/bcdice_api/app.rb"

Metrics/BlockLength:
Exclude:
- "test/**/*"
- "lib/bcdice_api/app.rb"
- "lib/bcdice_api/controller/v1.rb"
- "lib/bcdice_api/controller/v2.rb"

Lint/RaiseException:
Enabled: true
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.1
3.1.2
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
## 2.1.1
- BCDice 3.7.0
- セキュリティアップデート: Rack
- 依存Gemのアップデート

## 2.1.0
- BCDice 3.6.0
- Ruby 3.0, 3.1をサポート対象に
- Ruby 2.5をサポート対象外に
- Pumaを5.Xにアップデート

## 2.0.1

- セキュリティアップデート : Puma, rexml
- BCDice 3.3.0

## 2.0.0

- 新しいAPIバージョン `/v2` を作成。詳しくはAPIドキュメントを参照してください
- BCDice 3.0.0

## 1.0.0

- BCDice Ver2.07.01 にアップデート
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

source 'https://rubygems.org'

gem 'bcdice', '3.0.0.pre.alpha.1'
gem 'bcdice', '~>3.0'

gem 'sinatra', '~>2.0'
gem 'sinatra-contrib', '~>2.0'
gem 'sinatra-jsonp', '~>0.5.0'

gem 'puma', '~>4.3'
gem 'puma', '~>5.6'

group :development, :test do
gem 'rack-test', '~>1.1'
gem 'rake', '~>13.0'
gem 'rubocop', '~> 0.81.0', require: false
gem 'rubocop', '~> 1.15.0', require: false
gem 'test-unit', '~>3.3'
gem 'tomlrb'
end
85 changes: 45 additions & 40 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,73 +1,78 @@
GEM
remote: https://rubygems.org/
specs:
ast (2.4.0)
backports (3.16.1)
bcdice (3.0.0.pre.alpha.1)
jaro_winkler (1.5.4)
multi_json (1.14.1)
mustermann (1.1.1)
ast (2.4.2)
bcdice (3.7.0)
i18n (~> 1.8.5)
concurrent-ruby (1.1.10)
i18n (1.8.11)
concurrent-ruby (~> 1.0)
multi_json (1.15.0)
mustermann (2.0.2)
ruby2_keywords (~> 0.0.1)
nio4r (2.5.2)
parallel (1.19.1)
parser (2.7.1.0)
ast (~> 2.4.0)
power_assert (1.1.6)
puma (4.3.5)
nio4r (2.5.8)
parallel (1.22.1)
parser (3.1.2.1)
ast (~> 2.4.1)
power_assert (2.0.2)
puma (5.6.5)
nio4r (~> 2.0)
rack (2.2.3)
rack-protection (2.0.8.1)
rack (2.2.4)
rack-protection (2.2.2)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rainbow (3.0.0)
rake (13.0.1)
rexml (3.2.4)
rubocop (0.81.0)
jaro_winkler (~> 1.5.1)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.6.0)
rexml (3.2.5)
rubocop (1.15.0)
parallel (~> 1.10)
parser (>= 2.7.0.1)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.5.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
ruby-progressbar (1.10.1)
ruby2_keywords (0.0.2)
sinatra (2.0.8.1)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.8.1)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.23.0)
parser (>= 3.1.1.0)
ruby-progressbar (1.11.0)
ruby2_keywords (0.0.5)
sinatra (2.2.2)
mustermann (~> 2.0)
rack (~> 2.2)
rack-protection (= 2.2.2)
tilt (~> 2.0)
sinatra-contrib (2.0.8.1)
backports (>= 2.8.2)
sinatra-contrib (2.2.2)
multi_json
mustermann (~> 1.0)
rack-protection (= 2.0.8.1)
sinatra (= 2.0.8.1)
mustermann (~> 2.0)
rack-protection (= 2.2.2)
sinatra (= 2.2.2)
tilt (~> 2.0)
sinatra-jsonp (0.5.0)
multi_json (~> 1.8)
sinatra (>= 1.0)
test-unit (3.3.5)
test-unit (3.5.5)
power_assert
tilt (2.0.10)
tomlrb (1.3.0)
unicode-display_width (1.7.0)
tilt (2.0.11)
tomlrb (2.0.3)
unicode-display_width (2.3.0)

PLATFORMS
ruby

DEPENDENCIES
bcdice (= 3.0.0.pre.alpha.1)
puma (~> 4.3)
bcdice (~> 3.0)
puma (~> 5.6)
rack-test (~> 1.1)
rake (~> 13.0)
rubocop (~> 0.81.0)
rubocop (~> 1.15.0)
sinatra (~> 2.0)
sinatra-contrib (~> 2.0)
sinatra-jsonp (~> 0.5.0)
test-unit (~> 3.3)
tomlrb

BUNDLED WITH
2.1.4
2.3.9
27 changes: 12 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
BCDiceを提供するWebAPIサーバー

[![Action Status](https://github.com/bcdice/bcdice-api/workflows/Test/badge.svg?branch=master)](https://github.com/bcdice/bcdice-api/actions)

## Demo

下記URLは開発検証用のURLです、予告なしに挙動が変更されたり、可動していない場合があるので使用しないでください。

https://bcdice.herokuapp.com
[![Docker repository](https://img.shields.io/docker/pulls/bcdice/bcdice-api?logo=docker&logoColor=fff)](https://hub.docker.com/r/bcdice/bcdice-api)

## Public servers

Expand Down Expand Up @@ -57,14 +52,16 @@ $ APP_ENV=production bundle exec rackup -E deployment

## API

Method | Description
-------------------------------- | -----
[/v1/version](/docs/api.md#version) | BCDiceとAPIサーバーのバージョン
[/v1/admin](/docs/api.md#admin) | APIサーバ提供者の名前と連絡先
[/v1/systems](/docs/api.md#systems) | ダイスボットのシステムID一覧
[/v1/names](/docs/api.md#names) | ダイスボットのシステムIDとシステム名前の一覧
[/v1/systeminfo](/docs/api.md#systeminfo) | ダイスボットのシステム情報取得
[/v1/diceroll](/docs/api.md#diceroll) | ダイスボットのコマンドを実行
[`/v2`](https://github.com/bcdice/bcdice-api/blob/master/docs/api_v2.md)

Method | Description
------------------------- | -----
/v2/version | BCDiceとAPIサーバーのバージョン
/v2/admin | APIサーバ提供者の名前と連絡先
/v2/game_system | ゲームシステムの一覧
/v2/game_system/{id} | ゲームシステムの情報
/v2/game_system/{id}/roll | ダイスロール
/v2/original_table | オリジナル表の実行

## Plugin

Expand All @@ -73,7 +70,7 @@ Method | Description

## Documents

- [無料で独自ダイスボット入りのBCDice-APIサーバーを立てる](docs/heroku.md) (中級者向け)
- [Herokuで独自ダイスボット入りのBCDice-APIサーバーを立てる](docs/heroku.md) (中級者向け)

## Cases

Expand Down
8 changes: 8 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ Rake::TestTask.new do |t|
t.verbose = true
end

namespace :test do
Rake::TestTask.new(:v2) do |t|
t.libs += ['lib']
t.test_files = ['test/test_api_v2.rb', 'test/test_dicebot_v2.rb']
t.verbose = true
end
end

RuboCop::RakeTask.new

Rake::Task[:test].enhance do
Expand Down
2 changes: 1 addition & 1 deletion bcdice
Submodule bcdice updated 600 files
2 changes: 1 addition & 1 deletion config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ $LOAD_PATH.unshift File.join(__dir__, 'lib')

require 'bcdice_api'

run BCDiceAPI::App
run BCDiceAPI::APP
16 changes: 8 additions & 8 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ WebAPIで利用できるダイスボットのシステムID一覧が返却され
{"faces" : 10, "value" : 9}
],
"detailed_rands" : [
{"kind" : "nomal", "faces" : 10, "value" : 8},
{"kind" : "nomal", "faces" : 10, "value" : 2},
{"kind" : "nomal", "faces" : 10, "value" : 1},
{"kind" : "nomal", "faces" : 10, "value" : 9}
{"kind" : "nomal", "sides" : 10, "value" : 8},
{"kind" : "nomal", "sides" : 10, "value" : 2},
{"kind" : "nomal", "sides" : 10, "value" : 1},
{"kind" : "nomal", "sides" : 10, "value" : 9}
]
}
```
Expand All @@ -216,14 +216,14 @@ WebAPIで利用できるダイスボットのシステムID一覧が返却され

- `nomal`
- 通常のダイスロール
- `{"kind" : "nomal", "faces" : 10, "value" : 8}`
- `{"kind" : "nomal", "sides" : 10, "value" : 8}`
- `tens_d10`
- 十の位のダイス
- `{"kind" : "tens_d10", "faces" : 10, "value" : 80}`
- `{"kind" : "tens_d10", "faces" : 10, "value" : 0}`
- `{"kind" : "tens_d10", "sides" : 10, "value" : 80}`
- `{"kind" : "tens_d10", "sides" : 10, "value" : 0}`
- `00` は0として扱われます
- `d9`
- 十面体を0〜9のダイスとして扱う
- `{"kind" : "d9", "faces" : 10, "value" : 0}`
- `{"kind" : "d9", "sides" : 10, "value" : 0}`

Since: 0.9.0, BCDice Ver2.04.00
Loading

0 comments on commit 1c748df

Please sign in to comment.