Skip to content

Commit 4c4ca12

Browse files
authored
Merge pull request #25 from bcdice/api_v2
API v2
2 parents cad8f58 + d2f06b7 commit 4c4ca12

22 files changed

+886
-379
lines changed

.rubocop.yml

+2-15
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,11 @@ AllCops:
55
- "vendor/**/*"
66

77
Metrics:
8-
Exclude:
9-
- "lib/bcdice_wrap.rb"
10-
- "lib/bcdice_api/app.rb"
11-
12-
Metrics/ClassLength:
13-
Exclude:
14-
- "test/**/*"
15-
16-
Metrics/AbcSize:
178
Exclude:
189
- "test/**/*"
1910
- "lib/bcdice_wrap.rb"
20-
- "lib/bcdice_api/app.rb"
21-
22-
Metrics/BlockLength:
23-
Exclude:
24-
- "test/**/*"
25-
- "lib/bcdice_api/app.rb"
11+
- "lib/bcdice_api/controller/v1.rb"
12+
- "lib/bcdice_api/controller/v2.rb"
2613

2714
Lint/RaiseException:
2815
Enabled: true

Gemfile

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
source 'https://rubygems.org'
44

5+
gem 'bcdice', '~>3.0.0'
6+
57
gem 'sinatra', '~>2.0'
68
gem 'sinatra-contrib', '~>2.0'
79
gem 'sinatra-jsonp', '~>0.5.0'
@@ -13,4 +15,5 @@ group :development, :test do
1315
gem 'rake', '~>13.0'
1416
gem 'rubocop', '~> 0.81.0', require: false
1517
gem 'test-unit', '~>3.3'
18+
gem 'tomlrb'
1619
end

Gemfile.lock

+26-20
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
ast (2.4.0)
5-
backports (3.16.1)
4+
ast (2.4.1)
5+
bcdice (3.0.0)
6+
i18n (~> 1.8.5)
7+
concurrent-ruby (1.1.8)
8+
i18n (1.8.7)
9+
concurrent-ruby (~> 1.0)
610
jaro_winkler (1.5.4)
7-
multi_json (1.14.1)
11+
multi_json (1.15.0)
812
mustermann (1.1.1)
913
ruby2_keywords (~> 0.0.1)
10-
nio4r (2.5.2)
11-
parallel (1.19.1)
12-
parser (2.7.1.0)
13-
ast (~> 2.4.0)
14-
power_assert (1.1.6)
15-
puma (4.3.5)
14+
nio4r (2.5.4)
15+
parallel (1.20.1)
16+
parser (3.0.0.0)
17+
ast (~> 2.4.1)
18+
power_assert (1.2.0)
19+
puma (4.3.7)
1620
nio4r (~> 2.0)
1721
rack (2.2.3)
18-
rack-protection (2.0.8.1)
22+
rack-protection (2.1.0)
1923
rack
2024
rack-test (1.1.0)
2125
rack (>= 1.0, < 3)
2226
rainbow (3.0.0)
23-
rake (13.0.1)
27+
rake (13.0.3)
2428
rexml (3.2.4)
2529
rubocop (0.81.0)
2630
jaro_winkler (~> 1.5.1)
@@ -30,32 +34,33 @@ GEM
3034
rexml
3135
ruby-progressbar (~> 1.7)
3236
unicode-display_width (>= 1.4.0, < 2.0)
33-
ruby-progressbar (1.10.1)
37+
ruby-progressbar (1.11.0)
3438
ruby2_keywords (0.0.2)
35-
sinatra (2.0.8.1)
39+
sinatra (2.1.0)
3640
mustermann (~> 1.0)
37-
rack (~> 2.0)
38-
rack-protection (= 2.0.8.1)
41+
rack (~> 2.2)
42+
rack-protection (= 2.1.0)
3943
tilt (~> 2.0)
40-
sinatra-contrib (2.0.8.1)
41-
backports (>= 2.8.2)
44+
sinatra-contrib (2.1.0)
4245
multi_json
4346
mustermann (~> 1.0)
44-
rack-protection (= 2.0.8.1)
45-
sinatra (= 2.0.8.1)
47+
rack-protection (= 2.1.0)
48+
sinatra (= 2.1.0)
4649
tilt (~> 2.0)
4750
sinatra-jsonp (0.5.0)
4851
multi_json (~> 1.8)
4952
sinatra (>= 1.0)
50-
test-unit (3.3.5)
53+
test-unit (3.3.9)
5154
power_assert
5255
tilt (2.0.10)
56+
tomlrb (2.0.1)
5357
unicode-display_width (1.7.0)
5458

5559
PLATFORMS
5660
ruby
5761

5862
DEPENDENCIES
63+
bcdice (~> 3.0.0)
5964
puma (~> 4.3)
6065
rack-test (~> 1.1)
6166
rake (~> 13.0)
@@ -64,6 +69,7 @@ DEPENDENCIES
6469
sinatra-contrib (~> 2.0)
6570
sinatra-jsonp (~> 0.5.0)
6671
test-unit (~> 3.3)
72+
tomlrb
6773

6874
BUNDLED WITH
6975
2.1.4

Rakefile

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,19 @@ desc 'Run test-unit based test'
77
Rake::TestTask.new do |t|
88
# To run test for only one file (or file path pattern)
99
# $ bundle exec rake test TEST=test/test_specified_path.rb
10-
t.libs += ['lib', 'bcdice/src']
10+
t.libs += ['lib']
1111
t.test_files = Dir['test/test_*.rb']
1212
t.verbose = true
1313
end
1414

15+
namespace :test do
16+
Rake::TestTask.new(:v2) do |t|
17+
t.libs += ['lib']
18+
t.test_files = ['test/test_api_v2.rb', 'test/test_dicebot_v2.rb']
19+
t.verbose = true
20+
end
21+
end
22+
1523
RuboCop::RakeTask.new
1624

1725
Rake::Task[:test].enhance do

bcdice

Submodule bcdice updated 960 files

config.ru

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# frozen_string_literal: true
22

33
$LOAD_PATH.unshift __dir__
4-
$LOAD_PATH.unshift File.join(__dir__, 'bcdice', 'src')
54
$LOAD_PATH.unshift File.join(__dir__, 'lib')
65

76
require 'bcdice_api'
87

9-
run BCDiceAPI::App
8+
run BCDiceAPI::APP

0 commit comments

Comments
 (0)