mirror of
https://github.com/hkalexling/Mango.git
synced 2026-03-17 00:03:36 -04:00
Show plugin info on the plugin download page
This commit is contained in:
@@ -31,13 +31,13 @@ class Plugin
|
||||
"plugin directory #{dir}"
|
||||
end
|
||||
|
||||
json = JSON.parse File.read info_path
|
||||
@json = JSON.parse File.read info_path
|
||||
|
||||
begin
|
||||
{% for name in ["id", "title", "author", "version", "placeholder"] %}
|
||||
@{{name.id}} = json[{{name}}].as_s
|
||||
@{{name.id}} = @json[{{name}}].as_s
|
||||
{% end %}
|
||||
@wait_seconds = json["wait_seconds"].as_i.to_u64
|
||||
@wait_seconds = @json["wait_seconds"].as_i.to_u64
|
||||
|
||||
unless @id.alphanumeric_underscore?
|
||||
raise "Plugin ID can only contain alphanumeric characters and " \
|
||||
@@ -48,6 +48,10 @@ class Plugin
|
||||
"at #{@dir}. Error: #{e.message}"
|
||||
end
|
||||
end
|
||||
|
||||
def each(&block : String, JSON::Any -> _)
|
||||
@json.as_h.each &block
|
||||
end
|
||||
end
|
||||
|
||||
struct Storage
|
||||
|
||||
Reference in New Issue
Block a user