discorb 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/.yardopts +1 -0
- data/Changelog.md +10 -1
- data/Gemfile +17 -17
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/Rakefile +159 -46
- data/crowdin.yml +3 -0
- data/discorb.gemspec +1 -0
- data/docs/application_command.md +6 -6
- data/docs/discord_irb.md +1 -1
- data/docs/events.md +21 -7
- data/docs/extension.md +15 -3
- data/examples/commands/inspect.rb +1 -1
- data/lib/discorb/client.rb +15 -3
- data/lib/discorb/color.rb +1 -0
- data/lib/discorb/common.rb +1 -1
- data/lib/discorb/image.rb +1 -4
- data/lib/discorb/interaction.rb +6 -1
- data/lib/discorb/message.rb +4 -2
- data/lib/discorb/permission.rb +3 -0
- data/po/yard.pot +12452 -0
- data/template-replace/files/css/common.css +519 -0
- data/template-replace/resources/version_list.html +61 -0
- data/template-replace/scripts/index.rb +13 -0
- data/template-replace/scripts/sidebar.rb +11 -0
- data/template-replace/scripts/version.rb +12 -0
- data/template-replace/scripts/yard_replace.rb +27 -0
- metadata +11 -2
@@ -0,0 +1,61 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
|
4
|
+
<head>
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<meta charset="utf-8" />
|
7
|
+
|
8
|
+
<link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" />
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
15
|
+
|
16
|
+
<script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
|
17
|
+
|
18
|
+
|
19
|
+
<title>Version List</title>
|
20
|
+
<base id="base_target" target="_parent" />
|
21
|
+
</head>
|
22
|
+
|
23
|
+
<body>
|
24
|
+
<div id="content">
|
25
|
+
<div class="fixed_header">
|
26
|
+
<h1 id="full_list_header">Version List</h1>
|
27
|
+
<div id="full_list_nav">
|
28
|
+
|
29
|
+
<span><a target="_self" href="class_list.html">
|
30
|
+
Classes
|
31
|
+
</a></span>
|
32
|
+
|
33
|
+
<span><a target="_self" href="method_list.html">
|
34
|
+
Methods
|
35
|
+
</a></span>
|
36
|
+
|
37
|
+
<span><a target="_self" href="file_list.html">
|
38
|
+
Files
|
39
|
+
</a></span>
|
40
|
+
<!--od--><span><a target="_self" href="version_list.html">Versions</a></span>
|
41
|
+
<!--eod-->
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<div id="search">Search: <input type="text" /></div>
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<ul id="full_list" class="method">
|
48
|
+
<!--replace-->
|
49
|
+
<!--template-->
|
50
|
+
<li class="!eo!">
|
51
|
+
<div class="item">
|
52
|
+
<span class='object_link'><a href="../!version!/index.html" title="!version!">!version!</a></span>
|
53
|
+
<small class='git_sha'>!sha!</small>
|
54
|
+
</div>
|
55
|
+
</li>
|
56
|
+
<!--endtemplate-->
|
57
|
+
</ul>
|
58
|
+
</div>
|
59
|
+
</body>
|
60
|
+
|
61
|
+
</html>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require "fileutils"
|
2
|
+
|
3
|
+
def replace_index(dir, version)
|
4
|
+
Dir.glob("#{dir}/**/*.html").each do |file|
|
5
|
+
next if (m = file.match(/[0-9]+\.[0-9]+\.[0-9]+(-[a-z]+)?/)) && m[0] != version
|
6
|
+
|
7
|
+
content = File.read(file)
|
8
|
+
content.gsub!(/(?<=["\/])_index.html/, "a_index.html")
|
9
|
+
File.write(file, content)
|
10
|
+
end
|
11
|
+
|
12
|
+
FileUtils.cp("#{dir}/_index.html", "#{dir}/a_index.html")
|
13
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
def replace_sidebar(file)
|
2
|
+
html = File.read(file)
|
3
|
+
files_html = <<-HTML
|
4
|
+
<span><a target="_self" href="file_list.html">
|
5
|
+
Files
|
6
|
+
</a></span>
|
7
|
+
HTML
|
8
|
+
index = html.index(files_html)
|
9
|
+
html.insert(index + files_html.length, '<!--od--><span><a target="_self" href="version_list.html">Versions</a></span><!--eod-->')
|
10
|
+
File.write(file, html)
|
11
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
def build_version_sidebar(dir)
|
2
|
+
raw = File.read("template-replace/resources/version_list.html")
|
3
|
+
template = raw.match(/<!--template-->(.*)<!--endtemplate-->/m)[1]
|
4
|
+
raw.gsub!(template, "")
|
5
|
+
res = +""
|
6
|
+
`git tag`.force_encoding("utf-8").split("\n").each.with_index do |tag, i|
|
7
|
+
sha = `git rev-parse #{tag}`.force_encoding("utf-8").strip
|
8
|
+
version = tag.delete_prefix("v")
|
9
|
+
res += template.gsub("!version!", version).gsub("!eo!", i % 2 == 0 ? "even" : "odd").gsub("!sha!", sha)
|
10
|
+
end
|
11
|
+
File.write(dir + "/version_list.html", raw.gsub("<!--replace-->", res))
|
12
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require "yard"
|
2
|
+
|
3
|
+
def yard_replace(dir, version)
|
4
|
+
sha = `git rev-parse HEAD`.strip
|
5
|
+
tag = `git describe --exact-match #{sha}`
|
6
|
+
tag = tag.empty? ? "(main)" : tag.strip
|
7
|
+
Dir.glob("#{dir}/**/*.html") do |file|
|
8
|
+
next if (m = file.match(/[0-9]+\.[0-9]+\.[0-9]+(-[a-z]+)?/)) && m[0] != version
|
9
|
+
contents = File.read(file)
|
10
|
+
contents.gsub!(Regexp.new(<<-'HTML1'), <<-HTML2)
|
11
|
+
<div id="footer">
|
12
|
+
Generated on .+ by
|
13
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
14
|
+
.+\.
|
15
|
+
</div>
|
16
|
+
HTML1
|
17
|
+
<div id="footer">
|
18
|
+
Generated from <a href="https://github.com/discorb-lib/discorb/tree/#{sha}"><code>#{sha}</code></a>, version #{tag}, with YARD #{YARD::VERSION}.
|
19
|
+
</div>
|
20
|
+
HTML2
|
21
|
+
contents.gsub!(<<-'HTML3', <<-HTML4)
|
22
|
+
<h1 class="noborder title">Documentation by YARD 0.9.26</h1>
|
23
|
+
HTML3
|
24
|
+
HTML4
|
25
|
+
File.write(file, contents)
|
26
|
+
end
|
27
|
+
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.2.
|
4
|
+
version: 0.2.5
|
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-09-
|
11
|
+
date: 2021-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|
@@ -84,6 +84,7 @@ files:
|
|
84
84
|
- Rakefile
|
85
85
|
- bin/console
|
86
86
|
- bin/setup
|
87
|
+
- crowdin.yml
|
87
88
|
- discorb.gemspec
|
88
89
|
- docs/Examples.md
|
89
90
|
- docs/application_command.md
|
@@ -146,6 +147,13 @@ files:
|
|
146
147
|
- lib/discorb/utils.rb
|
147
148
|
- lib/discorb/voice_state.rb
|
148
149
|
- lib/discorb/webhook.rb
|
150
|
+
- po/yard.pot
|
151
|
+
- template-replace/files/css/common.css
|
152
|
+
- template-replace/resources/version_list.html
|
153
|
+
- template-replace/scripts/index.rb
|
154
|
+
- template-replace/scripts/sidebar.rb
|
155
|
+
- template-replace/scripts/version.rb
|
156
|
+
- template-replace/scripts/yard_replace.rb
|
149
157
|
homepage: https://github.com/discorb-lib/discorb
|
150
158
|
licenses:
|
151
159
|
- MIT
|
@@ -154,6 +162,7 @@ metadata:
|
|
154
162
|
homepage_uri: https://github.com/discorb-lib/discorb
|
155
163
|
source_code_uri: https://github.com/discorb-lib/discorb
|
156
164
|
changelog_uri: https://github.com/discorb-lib/discorb/blob/main/Changelog.md
|
165
|
+
documentation_uri: https://discorb-lib.github.io
|
157
166
|
post_install_message:
|
158
167
|
rdoc_options: []
|
159
168
|
require_paths:
|