discorb 0.13.0 → 0.13.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build_main.yml +1 -0
  3. data/.github/workflows/build_version.yml +4 -3
  4. data/.github/workflows/crowdin.yml +32 -0
  5. data/.gitignore +3 -1
  6. data/.yardopts +2 -0
  7. data/CODE_OF_CONDUCT.md +128 -0
  8. data/Changelog.md +420 -388
  9. data/Gemfile +5 -1
  10. data/README.md +2 -2
  11. data/Rakefile +131 -1
  12. data/crowdin.yml +2 -0
  13. data/discorb.gemspec +12 -1
  14. data/docs/Examples.md +2 -0
  15. data/docs/application_command.md +7 -5
  16. data/docs/cli/irb.md +2 -0
  17. data/docs/cli/new.md +2 -0
  18. data/docs/cli/run.md +3 -1
  19. data/docs/cli/setup.md +4 -2
  20. data/docs/cli.md +2 -0
  21. data/docs/events.md +6 -4
  22. data/docs/extension.md +2 -2
  23. data/docs/faq.md +4 -2
  24. data/docs/license.md +2 -0
  25. data/docs/tutorial.md +4 -3
  26. data/docs/voice_events.md +2 -0
  27. data/lib/discorb/app_command.rb +32 -9
  28. data/lib/discorb/application.rb +1 -1
  29. data/lib/discorb/asset.rb +1 -1
  30. data/lib/discorb/channel.rb +170 -125
  31. data/lib/discorb/client.rb +20 -22
  32. data/lib/discorb/common.rb +32 -1
  33. data/lib/discorb/dictionary.rb +10 -2
  34. data/lib/discorb/emoji.rb +7 -9
  35. data/lib/discorb/emoji_table.rb +3891 -3891
  36. data/lib/discorb/event.rb +12 -11
  37. data/lib/discorb/exe/show.rb +2 -0
  38. data/lib/discorb/extension.rb +1 -1
  39. data/lib/discorb/flag.rb +1 -1
  40. data/lib/discorb/gateway.rb +63 -17
  41. data/lib/discorb/guild.rb +110 -156
  42. data/lib/discorb/guild_template.rb +15 -12
  43. data/lib/discorb/http.rb +41 -136
  44. data/lib/discorb/integration.rb +34 -2
  45. data/lib/discorb/interaction/autocomplete.rb +1 -1
  46. data/lib/discorb/interaction/response.rb +34 -32
  47. data/lib/discorb/interaction/root.rb +8 -0
  48. data/lib/discorb/invite.rb +4 -3
  49. data/lib/discorb/log.rb +3 -2
  50. data/lib/discorb/member.rb +44 -15
  51. data/lib/discorb/message.rb +33 -22
  52. data/lib/discorb/modules.rb +28 -35
  53. data/lib/discorb/presence.rb +2 -2
  54. data/lib/discorb/rate_limit.rb +14 -18
  55. data/lib/discorb/role.rb +18 -14
  56. data/lib/discorb/sticker.rb +10 -14
  57. data/lib/discorb/user.rb +10 -10
  58. data/lib/discorb/voice_state.rb +12 -7
  59. data/lib/discorb/webhook.rb +44 -50
  60. data/lib/discorb.rb +1 -1
  61. data/po/yard.pot +7772 -5154
  62. data/sig/discorb.rbs +3316 -3819
  63. data/template-replace/scripts/locale_ja.rb +62 -0
  64. metadata +18 -5
@@ -0,0 +1,62 @@
1
+ LOCALES = {
2
+ "ja" => {
3
+ selector: {
4
+ "Classes" => "クラス",
5
+ "Methods" => "メソッド",
6
+ "Files" => "ファイル",
7
+ "Versions" => "バージョン",
8
+ },
9
+ title: {
10
+ "Class List" => "クラス一覧",
11
+ "Method List" => "メソッド一覧",
12
+ "File List" => "ファイル一覧",
13
+ "Version List" => "バージョン一覧",
14
+ },
15
+ },
16
+
17
+ }
18
+
19
+ def replace_sidebar_name(dir)
20
+ regex = /<a target="_self" href="(.+)_list\.html">\s*([a-zA-Z ]+?)\s*<\/a>/
21
+
22
+ Dir.glob("#{dir}/*_list.html") do |file|
23
+ content = File.read(file)
24
+ new_content = content.dup
25
+ content.scan(regex) do |url, name|
26
+ new_content.gsub!(
27
+ Regexp.last_match[0],
28
+ Regexp.last_match[0].gsub(name, LOCALES[ENV["rake_locale"]][:selector][name])
29
+ )
30
+ end
31
+ File.write(file, new_content)
32
+ end
33
+ end
34
+
35
+ def replace_title(dir)
36
+ regex = /(?:<h1 id="full_list_header">|<title>)([a-zA-Z ]+?)(?:<\/title>|<\/h1>)/
37
+
38
+ Dir.glob("#{dir}/*.html") do |file|
39
+ content = File.read(file)
40
+ new_content = content.dup
41
+ content.scan(regex) do |title, _|
42
+ new_content.gsub!(
43
+ Regexp.last_match[0],
44
+ Regexp.last_match[0].gsub(title, LOCALES[ENV["rake_locale"]][:title][title])
45
+ )
46
+ end
47
+ File.write(file, new_content)
48
+ end
49
+ end
50
+
51
+ def replace_version_name(dir)
52
+ content = File.read("#{dir}/version_list.html")
53
+ content.gsub!("Latest on RubyGems", "RubyGemsでの最新版")
54
+ content.gsub!("Latest on GitHub", "GitHubでの最新版")
55
+ File.write("#{dir}/version_list.html", content)
56
+ end
57
+
58
+ def replace_locale(dir)
59
+ replace_sidebar_name(dir)
60
+ replace_version_name(dir)
61
+ replace_title(dir)
62
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: discorb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.13.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - sevenc-nanashi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-01 00:00:00.000000000 Z
11
+ date: 2022-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async
@@ -66,7 +66,16 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.3'
69
- description:
69
+ description: |+
70
+ == discorb
71
+ discorb is a Discord API wrapper for Ruby, Using {socketry/async}[https://github.com/socketry/async].
72
+
73
+ === Contributing
74
+ Bug reports, feature requests, and pull requests are welcome on {the GitHub repository}[https://github.com/discorb-lib/discorb].
75
+
76
+ === License
77
+ This gem is licensed under the MIT License.
78
+
70
79
  email:
71
80
  - sevenc-nanashi@sevenbot.jp
72
81
  executables:
@@ -80,9 +89,11 @@ files:
80
89
  - ".github/PULL_REQUEST_TEMPLATE.md"
81
90
  - ".github/workflows/build_main.yml"
82
91
  - ".github/workflows/build_version.yml"
92
+ - ".github/workflows/crowdin.yml"
83
93
  - ".github/workflows/package_register.yml"
84
94
  - ".gitignore"
85
95
  - ".yardopts"
96
+ - CODE_OF_CONDUCT.md
86
97
  - CONTRIBUTING.md
87
98
  - Changelog.md
88
99
  - Gemfile
@@ -193,6 +204,7 @@ files:
193
204
  - template-replace/scripts/arrow.rb
194
205
  - template-replace/scripts/favicon.rb
195
206
  - template-replace/scripts/index.rb
207
+ - template-replace/scripts/locale_ja.rb
196
208
  - template-replace/scripts/sidebar.rb
197
209
  - template-replace/scripts/version.rb
198
210
  - template-replace/scripts/yard_replace.rb
@@ -219,8 +231,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
231
  - !ruby/object:Gem::Version
220
232
  version: '0'
221
233
  requirements: []
222
- rubygems_version: 3.2.22
234
+ rubygems_version: 3.2.32
223
235
  signing_key:
224
236
  specification_version: 4
225
- summary: A discord API wrapper written in Ruby
237
+ summary: A Discord API wrapper for Ruby, Using socketry/async.
226
238
  test_files: []
239
+ ...