discorb 0.2.3 → 0.3.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.
@@ -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.3
4
+ version: 0.3.1
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-01 00:00:00.000000000 Z
11
+ date: 2021-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async
@@ -70,7 +70,7 @@ description:
70
70
  email:
71
71
  - sevenc-nanashi@sevenbot.jp
72
72
  executables:
73
- - discord-irb
73
+ - discorb
74
74
  extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
@@ -84,10 +84,13 @@ 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
90
- - docs/discord_irb.md
91
+ - docs/cli.md
92
+ - docs/cli/init.md
93
+ - docs/cli/irb.md
91
94
  - docs/events.md
92
95
  - docs/extension.md
93
96
  - docs/voice_events.md
@@ -102,7 +105,7 @@ files:
102
105
  - examples/simple/ping_pong.rb
103
106
  - examples/simple/rolepanel.rb
104
107
  - examples/simple/wait_for_message.rb
105
- - exe/discord-irb
108
+ - exe/discorb
106
109
  - lib/discorb.rb
107
110
  - lib/discorb/application.rb
108
111
  - lib/discorb/asset.rb
@@ -119,6 +122,9 @@ files:
119
122
  - lib/discorb/emoji_table.rb
120
123
  - lib/discorb/error.rb
121
124
  - lib/discorb/event.rb
125
+ - lib/discorb/exe/init.rb
126
+ - lib/discorb/exe/irb.rb
127
+ - lib/discorb/exe/show.rb
122
128
  - lib/discorb/extend.rb
123
129
  - lib/discorb/extension.rb
124
130
  - lib/discorb/file.rb
@@ -144,8 +150,16 @@ files:
144
150
  - lib/discorb/sticker.rb
145
151
  - lib/discorb/user.rb
146
152
  - lib/discorb/utils.rb
153
+ - lib/discorb/utils/colored_puts.rb
147
154
  - lib/discorb/voice_state.rb
148
155
  - lib/discorb/webhook.rb
156
+ - po/yard.pot
157
+ - template-replace/files/css/common.css
158
+ - template-replace/resources/version_list.html
159
+ - template-replace/scripts/index.rb
160
+ - template-replace/scripts/sidebar.rb
161
+ - template-replace/scripts/version.rb
162
+ - template-replace/scripts/yard_replace.rb
149
163
  homepage: https://github.com/discorb-lib/discorb
150
164
  licenses:
151
165
  - MIT
@@ -154,6 +168,7 @@ metadata:
154
168
  homepage_uri: https://github.com/discorb-lib/discorb
155
169
  source_code_uri: https://github.com/discorb-lib/discorb
156
170
  changelog_uri: https://github.com/discorb-lib/discorb/blob/main/Changelog.md
171
+ documentation_uri: https://discorb-lib.github.io
157
172
  post_install_message:
158
173
  rdoc_options: []
159
174
  require_paths: