discorb 0.10.1 → 0.10.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 711fc9fac1407a6de44da571555d6b5eb0575983453a8371bbb1df960ae376ac
4
- data.tar.gz: 33defa63e7f65c82eee318a4d3783c2640fc1dcb54ffdf4941694cef7e72b1a9
3
+ metadata.gz: 5ea8e05d77b37b7a269b43dff64422e3d49b08d6c09a639d40dc019baaa26a8c
4
+ data.tar.gz: c8ea6f45759aaf22112f6400f7d950fb09f427f98d01302a18094ad3d6a3ae08
5
5
  SHA512:
6
- metadata.gz: 6a58931cea651763d030c14a61f1f463b7959449bcd70599819c0140884a2a0d86cde1706f97fb3af81013eb6fe2d5372df743a5275dc86f454d01618ba1a90a
7
- data.tar.gz: 884bdcfa59ff7612bcf9f0f12186c5e4cf51313b22a71dac308edc2abaaf45f33cf5e6f85c48681beb976309a245610d16dfd5c781bc6e50c90c0f9e215bc11a
6
+ metadata.gz: b3f5e77107192aec6943087251c5b61ab1476eb421ddb0297d61178e5146466a5a59c50f4665a2b81c362d927765259142ed1bc08ed9c07e3018102becab3294
7
+ data.tar.gz: b88f74d4f3e0f0025f7086e95c2b1e2b96ed19a35a258a72dd29f1814986465ac9fdd8443f920fe8b7dcd610d35871b59354ba8cc6b478bcf883797cd17d463d
data/Changelog.md CHANGED
@@ -4,6 +4,11 @@
4
4
 
5
5
  ## v0.10
6
6
 
7
+ ### v0.10.2
8
+
9
+ - Change: `discorb init` is now `discorb new`
10
+ - Add: Add `:channel_types` parameter to `ApplicationCommand::Handler#slash` and some
11
+
7
12
  ### v0.10.1
8
13
 
9
14
  - Add: Add `Client#extensions`
@@ -68,6 +68,7 @@ In `options`, hash should be like this:
68
68
  | `:type` | `Object` | Type of the option. |
69
69
  | `:choice` | `Hash{String => String, Integer, Float}` | Type of the option. |
70
70
  | `:default` | `Object` | Default value of the option. |
71
+ | `:channel_types` | `Array<Class<Discorb::Channel>>` | Type of the channel option. |
71
72
 
72
73
  `choices` should be unspecified if you don't want to use it.
73
74
  `choices` is hash like this:
data/docs/cli/init.md CHANGED
@@ -1,13 +1,13 @@
1
- # @title CLI: discorb init
1
+ # @title CLI: discorb new
2
2
 
3
- # discorb init
3
+ # discorb new
4
4
 
5
5
  This command will create a new project in the directory.
6
6
 
7
7
  ## Usage
8
8
 
9
9
  ```bash
10
- discorb init [options] [dir]
10
+ discorb new [options] [dir]
11
11
  ```
12
12
 
13
13
  ## Options
data/docs/tutorial.md CHANGED
@@ -74,7 +74,7 @@ Create a new directory and go to it.
74
74
  Open terminal and type:
75
75
 
76
76
  ```
77
- discorb init
77
+ discorb new
78
78
  ```
79
79
 
80
80
  Specify `--git` if you want to use git.
@@ -25,6 +25,7 @@ module Discorb
25
25
  # | `:type` | `Object` | Type of the option. |
26
26
  # | `:choice` | `Hash{String => String, Integer, Float}` | Type of the option. |
27
27
  # | `:default` | `Object` | Default value of the option. |
28
+ # | `:channel_types` | `Array<Class<Discorb::Channel>>` | Type of the channel option. |
28
29
  #
29
30
  # @param [Array<#to_s>, false, nil] guild_ids Guild IDs to set the command to. `false` to global command, `nil` to use default.
30
31
  # @param [Proc] block Command block.
@@ -238,6 +239,9 @@ module Discorb
238
239
  if value[:choices]
239
240
  ret[:choices] = value[:choices].map { |t| { name: t[0], value: t[1] } }
240
241
  end
242
+ if value[:channel_types]
243
+ ret[:channel_types] = value[:channel_types].map(&:channel_type)
244
+ end
241
245
  ret
242
246
  end
243
247
  {
@@ -4,7 +4,7 @@ module Discorb
4
4
  # @return [String] The API base URL.
5
5
  API_BASE_URL = "https://discord.com/api/v9"
6
6
  # @return [String] The version of discorb.
7
- VERSION = "0.10.1"
7
+ VERSION = "0.10.2"
8
8
  # @return [String] The user agent for the bot.
9
9
  USER_AGENT = "DiscordBot (https://discorb-lib.github.io #{VERSION}) Ruby/#{RUBY_VERSION}"
10
10
 
@@ -178,7 +178,7 @@ end
178
178
  opt = OptionParser.new <<~BANNER
179
179
  A tool to make a new project.
180
180
 
181
- Usage: discorb init [options] [dir]
181
+ Usage: discorb new [options] [dir]
182
182
 
183
183
  dir The directory to make the files in.
184
184
  BANNER
@@ -4,7 +4,12 @@ def build_version_sidebar(dir, version)
4
4
  raw.gsub!(template, "")
5
5
  res = +""
6
6
  i = 0
7
- `git tag`.force_encoding("utf-8").split("\n").reverse.each.with_index do |tag|
7
+ `git tag`
8
+ .force_encoding("utf-8")
9
+ .split("\n")
10
+ .sort_by { |v| Gem::Version.new(v[1..]) }
11
+ .reverse
12
+ .each.with_index do |tag|
8
13
  i += 1
9
14
  sha = `git rev-parse #{tag}`.force_encoding("utf-8").strip
10
15
  tag_version = tag.delete_prefix("v")
@@ -32,7 +37,7 @@ def build_version_sidebar(dir, version)
32
37
  cls = i % 2 == 0 ? "even" : "odd"
33
38
  res.insert 0, template
34
39
  .gsub("!version!", "Latest")
35
- .gsub("!path!", "/")
40
+ .gsub("!path!", "")
36
41
  .gsub("!class!", cls)
37
42
  .gsub("!sha!", "Latest on RubyGems")
38
43
  File.write(dir + "/version_list.html", raw.gsub("<!--replace-->", res))
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.10.1
4
+ version: 0.10.2
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-10-02 00:00:00.000000000 Z
11
+ date: 2021-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async
@@ -142,8 +142,8 @@ files:
142
142
  - lib/discorb/error.rb
143
143
  - lib/discorb/event.rb
144
144
  - lib/discorb/exe/about.rb
145
- - lib/discorb/exe/init.rb
146
145
  - lib/discorb/exe/irb.rb
146
+ - lib/discorb/exe/new.rb
147
147
  - lib/discorb/exe/run.rb
148
148
  - lib/discorb/exe/setup.rb
149
149
  - lib/discorb/exe/show.rb