Add badge
parent
8693b155c7
commit
b0781b1b3e
Binary file not shown.
After Width: | Height: | Size: 886 B |
Binary file not shown.
After Width: | Height: | Size: 1.0 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 998 B |
|
@ -1,8 +1,26 @@
|
||||||
require 'erb'
|
require 'erb'
|
||||||
require 'yaml'
|
require 'yaml'
|
||||||
|
|
||||||
def generate_badge
|
def generate_badge array
|
||||||
|
badge = ""
|
||||||
|
array.each { |t|
|
||||||
|
case t
|
||||||
|
when 'linux'
|
||||||
|
badge = badge + "![](./images/linux.png)"
|
||||||
|
when 'windows'
|
||||||
|
badge = badge + "![](./images/windows.png)"
|
||||||
|
when 'macos'
|
||||||
|
badge = badge + "![](./images/apple.png)"
|
||||||
|
when 'firefox'
|
||||||
|
badge = badge + "![](./images/firefox.png)"
|
||||||
|
when 'safari'
|
||||||
|
badge = badge + "![](./images/safari.png)"
|
||||||
|
when 'chrome'
|
||||||
|
badge = badge + "![](./images/chrome.png)"
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
return badge
|
||||||
end
|
end
|
||||||
|
|
||||||
template = %q{
|
template = %q{
|
||||||
|
@ -70,7 +88,7 @@ Dir.entries("./weapons/").each do | name |
|
||||||
split_result = data['url'].split "//github.com/"
|
split_result = data['url'].split "//github.com/"
|
||||||
popularity = "![](https://img.shields.io/github/stars/#{split_result[1]})"
|
popularity = "![](https://img.shields.io/github/stars/#{split_result[1]})"
|
||||||
end
|
end
|
||||||
badge = generate_badge
|
badge = generate_badge(data['platform'])
|
||||||
line = "|#{data['types']}|#{name}|#{data['description']}|#{badge}|#{popularity}|"
|
line = "|#{data['types']}|#{name}|#{data['description']}|#{badge}|#{popularity}|"
|
||||||
case data['category']
|
case data['category']
|
||||||
when 'tool'
|
when 'tool'
|
||||||
|
|
Loading…
Reference in New Issue