ika3 0.4.0 → 0.4.1
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 +4 -4
- data/.rubocop.yml +26 -0
- data/.vscode/settings.json +1 -1
- data/Gemfile +10 -5
- data/Gemfile.lock +48 -20
- data/README.md +2 -0
- data/Rakefile +2 -2
- data/Steepfile +5 -4
- data/config/weapons.yml +1 -1
- data/ika3.gemspec +16 -17
- data/lib/ika3/concerns/utils.rb +2 -1
- data/lib/ika3/response.rb +3 -1
- data/lib/ika3/schedule.rb +26 -8
- data/lib/ika3/version.rb +1 -1
- data/lib/ika3/weapons.rb +9 -11
- data/lib/ika3.rb +9 -9
- metadata +10 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e59b22c78fa322cfcf98b2515ad63334823654db64e56a1a97641a682cd7456
|
4
|
+
data.tar.gz: 2bfefd4d6ec498f29ae52cb9bc6265a18b739226eff0c8f2b80ab0206e2fe92d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08efd00880f7714e10ca559116329f818fbc1e4a04c4ae8b44ecfb050c56d6634299420ab9fa8b4d4460d6586fc761635559d816beee11c49094bd2ea713e52e'
|
7
|
+
data.tar.gz: f5787ae06e6818241ac407f5ac7a7ee476a9c72c7d9a48de60448c29f0149c2873510137bd6bbd1ce26e13657943288fafabf5be3fc9e6857a4dc3c96284540c
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-rspec
|
3
|
+
- rubocop-rake
|
4
|
+
|
5
|
+
AllCops:
|
6
|
+
NewCops: enable
|
7
|
+
TargetRubyVersion: 2.7
|
8
|
+
|
9
|
+
Layout/LineLength:
|
10
|
+
Exclude:
|
11
|
+
- 'spec/**/*'
|
12
|
+
- 'ika3.gemspec'
|
13
|
+
|
14
|
+
Metrics/BlockLength:
|
15
|
+
Exclude:
|
16
|
+
- 'spec/**/*'
|
17
|
+
|
18
|
+
RSpec/MultipleExpectations:
|
19
|
+
Max: 5
|
20
|
+
|
21
|
+
RSpec/ExampleLength:
|
22
|
+
Max: 15
|
23
|
+
CountAsOne: ["array", "hash", "heredoc"]
|
24
|
+
|
25
|
+
Style/Documentation:
|
26
|
+
Enabled: false
|
data/.vscode/settings.json
CHANGED
data/Gemfile
CHANGED
@@ -1,11 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
source
|
3
|
+
source 'https://rubygems.org'
|
4
4
|
|
5
5
|
# Specify your gem's dependencies in ika3.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
|
-
gem
|
9
|
-
gem
|
10
|
-
gem
|
11
|
-
gem
|
8
|
+
gem 'rake', '~> 13.0'
|
9
|
+
gem 'rbs'
|
10
|
+
gem 'rspec', '~> 3.0'
|
11
|
+
gem 'rubocop', require: false
|
12
|
+
gem 'steep'
|
13
|
+
|
14
|
+
gem 'rubocop-rake', '~> 0.6.0'
|
15
|
+
|
16
|
+
gem 'rubocop-rspec', '~> 2.22'
|
data/Gemfile.lock
CHANGED
@@ -1,46 +1,48 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ika3 (0.4.
|
4
|
+
ika3 (0.4.1)
|
5
5
|
activesupport (>= 5.0.0)
|
6
6
|
faraday (>= 2.7.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activesupport (7.0.4.
|
11
|
+
activesupport (7.0.4.3)
|
12
12
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
13
13
|
i18n (>= 1.6, < 2)
|
14
14
|
minitest (>= 5.1)
|
15
15
|
tzinfo (~> 2.0)
|
16
16
|
ast (2.4.2)
|
17
|
-
concurrent-ruby (1.2.
|
18
|
-
csv (3.2.
|
17
|
+
concurrent-ruby (1.2.2)
|
18
|
+
csv (3.2.6)
|
19
19
|
diff-lcs (1.5.0)
|
20
20
|
faraday (2.7.4)
|
21
21
|
faraday-net_http (>= 2.0, < 3.1)
|
22
22
|
ruby2_keywords (>= 0.0.4)
|
23
23
|
faraday-net_http (3.0.2)
|
24
24
|
ffi (1.15.5)
|
25
|
-
fileutils (1.
|
26
|
-
i18n (1.
|
25
|
+
fileutils (1.7.1)
|
26
|
+
i18n (1.13.0)
|
27
27
|
concurrent-ruby (~> 1.0)
|
28
|
-
json (2.6.
|
29
|
-
language_server-protocol (3.17.0.
|
30
|
-
listen (3.
|
28
|
+
json (2.6.3)
|
29
|
+
language_server-protocol (3.17.0.3)
|
30
|
+
listen (3.8.0)
|
31
31
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
32
32
|
rb-inotify (~> 0.9, >= 0.9.10)
|
33
|
-
logger (1.5.
|
34
|
-
minitest (5.
|
35
|
-
parallel (1.
|
36
|
-
parser (3.
|
33
|
+
logger (1.5.3)
|
34
|
+
minitest (5.18.0)
|
35
|
+
parallel (1.23.0)
|
36
|
+
parser (3.2.2.1)
|
37
37
|
ast (~> 2.4.1)
|
38
38
|
rainbow (3.1.1)
|
39
39
|
rake (13.0.6)
|
40
40
|
rb-fsevent (0.11.2)
|
41
41
|
rb-inotify (0.10.1)
|
42
42
|
ffi (~> 1.0)
|
43
|
-
rbs (3.0
|
43
|
+
rbs (3.1.0)
|
44
|
+
regexp_parser (2.8.0)
|
45
|
+
rexml (3.2.5)
|
44
46
|
rspec (3.12.0)
|
45
47
|
rspec-core (~> 3.12.0)
|
46
48
|
rspec-expectations (~> 3.12.0)
|
@@ -54,29 +56,52 @@ GEM
|
|
54
56
|
diff-lcs (>= 1.2.0, < 2.0)
|
55
57
|
rspec-support (~> 3.12.0)
|
56
58
|
rspec-support (3.12.0)
|
59
|
+
rubocop (1.50.2)
|
60
|
+
json (~> 2.3)
|
61
|
+
parallel (~> 1.10)
|
62
|
+
parser (>= 3.2.0.0)
|
63
|
+
rainbow (>= 2.2.2, < 4.0)
|
64
|
+
regexp_parser (>= 1.8, < 3.0)
|
65
|
+
rexml (>= 3.2.5, < 4.0)
|
66
|
+
rubocop-ast (>= 1.28.0, < 2.0)
|
67
|
+
ruby-progressbar (~> 1.7)
|
68
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
69
|
+
rubocop-ast (1.28.1)
|
70
|
+
parser (>= 3.2.1.0)
|
71
|
+
rubocop-capybara (2.18.0)
|
72
|
+
rubocop (~> 1.41)
|
73
|
+
rubocop-factory_bot (2.22.0)
|
74
|
+
rubocop (~> 1.33)
|
75
|
+
rubocop-rake (0.6.0)
|
76
|
+
rubocop (~> 1.0)
|
77
|
+
rubocop-rspec (2.22.0)
|
78
|
+
rubocop (~> 1.33)
|
79
|
+
rubocop-capybara (~> 2.17)
|
80
|
+
rubocop-factory_bot (~> 2.22)
|
81
|
+
ruby-progressbar (1.13.0)
|
57
82
|
ruby2_keywords (0.0.5)
|
58
|
-
securerandom (0.2.
|
59
|
-
steep (1.
|
83
|
+
securerandom (0.2.2)
|
84
|
+
steep (1.4.0)
|
60
85
|
activesupport (>= 5.1)
|
86
|
+
concurrent-ruby (>= 1.2.2)
|
61
87
|
csv (>= 3.0.9)
|
62
88
|
fileutils (>= 1.1.0)
|
63
89
|
json (>= 2.1.0)
|
64
90
|
language_server-protocol (>= 3.15, < 4.0)
|
65
91
|
listen (~> 3.0)
|
66
92
|
logger (>= 1.3.0)
|
67
|
-
parallel (>= 1.0.0)
|
68
93
|
parser (>= 3.1)
|
69
94
|
rainbow (>= 2.2.2, < 4.0)
|
70
95
|
rbs (>= 2.8.0)
|
71
96
|
securerandom (>= 0.1)
|
72
97
|
strscan (>= 1.0.0)
|
73
98
|
terminal-table (>= 2, < 4)
|
74
|
-
strscan (3.0.
|
99
|
+
strscan (3.0.6)
|
75
100
|
terminal-table (3.0.2)
|
76
101
|
unicode-display_width (>= 1.1.1, < 3)
|
77
|
-
tzinfo (2.0.
|
102
|
+
tzinfo (2.0.6)
|
78
103
|
concurrent-ruby (~> 1.0)
|
79
|
-
unicode-display_width (2.
|
104
|
+
unicode-display_width (2.4.2)
|
80
105
|
|
81
106
|
PLATFORMS
|
82
107
|
x86_64-linux
|
@@ -86,6 +111,9 @@ DEPENDENCIES
|
|
86
111
|
rake (~> 13.0)
|
87
112
|
rbs
|
88
113
|
rspec (~> 3.0)
|
114
|
+
rubocop
|
115
|
+
rubocop-rake (~> 0.6.0)
|
116
|
+
rubocop-rspec (~> 2.22)
|
89
117
|
steep
|
90
118
|
|
91
119
|
BUNDLED WITH
|
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
[](https://dl.circleci.com/status-badge/redirect/gh/YutaGoto/ika3/tree/main)
|
4
4
|
|
5
|
+
[](https://github.com/rubocop/rubocop)
|
6
|
+
|
5
7
|
Weapon data from Splatoon3. This is Unofficial data.
|
6
8
|
|
7
9
|
## Installation
|
data/Rakefile
CHANGED
data/Steepfile
CHANGED
data/config/weapons.yml
CHANGED
data/ika3.gemspec
CHANGED
@@ -1,23 +1,21 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative 'lib/ika3/version'
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
|
-
spec.name =
|
6
|
+
spec.name = 'ika3'
|
7
7
|
spec.version = Ika3::VERSION
|
8
|
-
spec.authors = [
|
9
|
-
spec.email = [
|
8
|
+
spec.authors = ['YutaGoto']
|
9
|
+
spec.email = ['you.goto.510@gmail.com']
|
10
10
|
|
11
|
-
spec.summary =
|
12
|
-
spec.description =
|
13
|
-
spec.homepage =
|
14
|
-
spec.license =
|
15
|
-
spec.required_ruby_version =
|
11
|
+
spec.summary = 'Splatoon3 weapons information library.'
|
12
|
+
spec.description = 'Splatoon3 weapons information library. This gem provide weapon name, sub, and special. not official'
|
13
|
+
spec.homepage = 'https://github.com/YutaGoto/ika3'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
spec.required_ruby_version = '>= 2.7.0'
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
spec.metadata["homepage_uri"] = spec.homepage
|
20
|
-
spec.metadata["source_code_uri"] = "https://github.com/YutaGoto/ika3"
|
17
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
18
|
+
spec.metadata['source_code_uri'] = 'https://github.com/YutaGoto/ika3'
|
21
19
|
|
22
20
|
# Specify which files should be added to the gem when it is released.
|
23
21
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -26,13 +24,14 @@ Gem::Specification.new do |spec|
|
|
26
24
|
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
27
25
|
end
|
28
26
|
end
|
29
|
-
spec.bindir =
|
27
|
+
spec.bindir = 'exe'
|
30
28
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
31
|
-
spec.require_paths = [
|
29
|
+
spec.require_paths = ['lib']
|
32
30
|
|
33
|
-
spec.add_dependency
|
34
|
-
spec.add_dependency
|
31
|
+
spec.add_dependency 'activesupport', '>= 5.0.0'
|
32
|
+
spec.add_dependency 'faraday', '>= 2.7.0'
|
35
33
|
|
36
34
|
# For more information and examples about making a new gem, check out our
|
37
35
|
# guide at: https://bundler.io/guides/creating_gem.html
|
36
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
38
37
|
end
|
data/lib/ika3/concerns/utils.rb
CHANGED
data/lib/ika3/response.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Ika3
|
2
4
|
class Response
|
3
5
|
def initialize(faraday_response)
|
@@ -12,7 +14,7 @@ module Ika3
|
|
12
14
|
|
13
15
|
def headers
|
14
16
|
@headers ||= @raw_headers.inject({}) do |result, (key, value)|
|
15
|
-
result.merge(key.split(
|
17
|
+
result.merge(key.split('-').map(&:capitalize).join('-') => value)
|
16
18
|
end
|
17
19
|
end
|
18
20
|
|
data/lib/ika3/schedule.rb
CHANGED
@@ -1,4 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class Hash
|
4
|
+
def respond_to_missing?(sym)
|
5
|
+
key? name ? true : super
|
6
|
+
end
|
7
|
+
|
2
8
|
def method_missing(name)
|
3
9
|
return self[name] if key? name
|
4
10
|
|
@@ -13,22 +19,34 @@ module Ika3
|
|
13
19
|
@contact = contact
|
14
20
|
end
|
15
21
|
|
16
|
-
modes = [
|
17
|
-
schedules = [
|
22
|
+
modes = %w[regular bankara_challenge bankara_open x fest]
|
23
|
+
schedules = %w[now next]
|
18
24
|
|
19
25
|
schedules.each do |schedule|
|
20
26
|
modes.each do |mode|
|
21
27
|
define_method("#{mode}_#{schedule}".to_sym) do
|
22
|
-
|
28
|
+
if instance_variable_defined?("@#{mode}_#{schedule}_obj")
|
29
|
+
return instance_variable_get("@#{mode}_#{schedule}_obj")
|
30
|
+
end
|
23
31
|
|
24
|
-
instance_variable_set("@#{mode}_#{schedule}_obj",
|
32
|
+
instance_variable_set("@#{mode}_#{schedule}_obj",
|
33
|
+
send_request(:get, "/api/#{mode.dasherize}/#{schedule}").body.results[0])
|
25
34
|
end
|
26
35
|
end
|
27
36
|
|
28
37
|
define_method("salmon_run_#{schedule}".to_sym) do
|
29
|
-
|
38
|
+
if instance_variable_defined?("@salmon_run_#{schedule}_obj")
|
39
|
+
return instance_variable_get("@salmon_run_#{schedule}_obj")
|
40
|
+
end
|
41
|
+
|
42
|
+
instance_variable_set("@salmon_run_#{schedule}_obj",
|
43
|
+
send_request(:get, "/api/coop-grouping/#{schedule}").body.results[0])
|
44
|
+
end
|
45
|
+
|
46
|
+
def salmon_run_team_contest
|
47
|
+
return @salmon_run_team_contest_obj unless @salmon_run_team_contest_obj.nil?
|
30
48
|
|
31
|
-
|
49
|
+
@salmon_run_team_contest_obj = send_request(:get, '/api/coop-grouping-team-contest/schedule').body.results[0]
|
32
50
|
end
|
33
51
|
end
|
34
52
|
|
@@ -40,11 +58,11 @@ module Ika3
|
|
40
58
|
end
|
41
59
|
|
42
60
|
def api_url
|
43
|
-
|
61
|
+
'https://spla3.yuu26.com/'
|
44
62
|
end
|
45
63
|
|
46
64
|
def splat3_connection
|
47
|
-
@splat3_connection ||= Faraday
|
65
|
+
@splat3_connection ||= Faraday.new(faraday_options) do |c|
|
48
66
|
c.request :json
|
49
67
|
c.response :json
|
50
68
|
c.adapter Faraday.default_adapter
|
data/lib/ika3/version.rb
CHANGED
data/lib/ika3/weapons.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Ika3
|
2
4
|
class Weapon
|
3
|
-
ATTRIBUTES = [
|
4
|
-
|
5
|
+
ATTRIBUTES = %i[
|
6
|
+
name sub special
|
5
7
|
].freeze
|
6
8
|
|
7
9
|
ATTRIBUTES.each do |attribute|
|
@@ -35,13 +37,13 @@ module Ika3
|
|
35
37
|
def filter_by_sub(sub_name)
|
36
38
|
raise "unknown sub weapon: #{sub_name}" unless sub_weapons.values.include?(sub_name)
|
37
39
|
|
38
|
-
config.values.filter{|weapon| weapon[:sub] == sub_name}
|
40
|
+
config.values.filter { |weapon| weapon[:sub] == sub_name }
|
39
41
|
end
|
40
42
|
|
41
43
|
def reload_config!
|
42
44
|
@cache = {}
|
43
45
|
@config = nil
|
44
|
-
@
|
46
|
+
@sub_weapons = nil
|
45
47
|
config
|
46
48
|
config_sub_weapons
|
47
49
|
end
|
@@ -73,17 +75,13 @@ module Ika3
|
|
73
75
|
end
|
74
76
|
|
75
77
|
def config
|
76
|
-
|
77
|
-
@config = load_yaml_file("#{File.dirname(__FILE__)}/../../config/weapons.yml").deep_symbolize_keys
|
78
|
-
end
|
78
|
+
@config ||= load_yaml_file("#{File.dirname(__FILE__)}/../../config/weapons.yml").deep_symbolize_keys
|
79
79
|
@config
|
80
80
|
end
|
81
81
|
|
82
82
|
def config_sub_weapons
|
83
|
-
|
84
|
-
|
85
|
-
end
|
86
|
-
@config_sub_weapons
|
83
|
+
@sub_weapons ||= load_yaml_file("#{File.dirname(__FILE__)}/../../config/sub_weapons.yml").deep_symbolize_keys
|
84
|
+
@sub_weapons
|
87
85
|
end
|
88
86
|
|
89
87
|
def valid?(weapon_key)
|
data/lib/ika3.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require 'yaml'
|
4
4
|
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
5
|
+
require 'active_support/core_ext/hash/keys'
|
6
|
+
require 'active_support/core_ext/string/inflections'
|
7
|
+
require 'faraday'
|
8
8
|
|
9
|
-
require
|
10
|
-
require
|
11
|
-
require
|
12
|
-
require
|
13
|
-
require
|
9
|
+
require 'ika3/version'
|
10
|
+
require 'ika3/concerns/utils'
|
11
|
+
require 'ika3/response'
|
12
|
+
require 'ika3/weapons'
|
13
|
+
require 'ika3/schedule'
|
14
14
|
|
15
15
|
module Ika3
|
16
16
|
class Error < StandardError; end
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ika3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- YutaGoto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 5.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 5.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: faraday
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 2.7.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 2.7.0
|
41
41
|
description: Splatoon3 weapons information library. This gem provide weapon name,
|
42
42
|
sub, and special. not official
|
43
43
|
email:
|
@@ -48,6 +48,7 @@ extra_rdoc_files: []
|
|
48
48
|
files:
|
49
49
|
- ".codespellrc"
|
50
50
|
- ".rspec"
|
51
|
+
- ".rubocop.yml"
|
51
52
|
- ".vscode/settings.json"
|
52
53
|
- Gemfile
|
53
54
|
- Gemfile.lock
|
@@ -76,6 +77,7 @@ licenses:
|
|
76
77
|
metadata:
|
77
78
|
homepage_uri: https://github.com/YutaGoto/ika3
|
78
79
|
source_code_uri: https://github.com/YutaGoto/ika3
|
80
|
+
rubygems_mfa_required: 'true'
|
79
81
|
post_install_message:
|
80
82
|
rdoc_options: []
|
81
83
|
require_paths:
|