-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New features: badge generator, jemalloc-check, yaml tools (#137)
* Adding installation workflow * Adding `bashmatic is-installed` directive * Adding the Install CI badge * Adding insgall to CI * Adding bin/badge + yaml utilities * Remove return * Bump version 3.2.0 * Updating auto-generated files
- Loading branch information
Showing
16 changed files
with
572 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Install | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
schedule: # run once a day to make sure | ||
- cron: "30 17 * * *" | ||
|
||
jobs: | ||
install: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: install using curl | ||
run: | | ||
rm -rf ~/.bashmatic | ||
bash -c "$(curl -fsSL https://bashmatic.re1.re); bashmatic-install -q" | ||
- name: verify bashmatic is there | ||
run: | | ||
bash -c "[[ -d ~/.bashmatic && -f ~/.bashmatic/init.sh ]]" | ||
- name: install bashmatic into an alternative location with a given tag | ||
run: | | ||
mkdir -p ~/workspace | ||
rm -rfv ~/workspace/bashmatic | ||
bash -c "$(curl -fsSL https://bashmatic.re1.re); \ | ||
bashmatic-install -p -d -q -f -b v3.1.2 -H ~/workspace/bashmatic" | ||
- name: finally source bashmatic init.sh on CI | ||
run: | | ||
set +ex | ||
source ~/.bashmatic/init.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.1.5 | ||
3.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/usr/bin/env ruby | ||
# vim: ft=ruby | ||
|
||
class SvgFormatter | ||
attr_reader :left, :right, :color | ||
|
||
def initialize(left, right, color = "#007ec6") | ||
@left = left | ||
@right = right | ||
@color = color | ||
end | ||
|
||
def write! | ||
$stdout.puts svg | ||
rescue RuntimeError => e | ||
@output.puts e.message | ||
@output.puts 'SvgFormatter was unable to generate a badge.' | ||
end | ||
|
||
private | ||
|
||
def svg | ||
file_content = <<~SVGTEMPLATE | ||
<?xml version="1.0"?> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="120" height="30"> | ||
<linearGradient id="a" x2="0" y2="100%"> | ||
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/> | ||
<stop offset="1" stop-opacity=".1"/> | ||
</linearGradient> | ||
<rect rx="3" width="90" height="20" fill="#555"/> | ||
<rect rx="3" x="51" width="39" height="20" fill="#{color}"/> | ||
<rect rx="3" width="90" height="20" fill="url(#a)"/> | ||
<g fill="#fff" text-anchor="middle" font-family="Cairo,DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> | ||
<text x="24.5" y="15" fill="#010101" fill-opacity=".3">#{left}</text> | ||
<text x="24.5" y="14">#{left}</text> | ||
<text x="68.5" y="15" fill="#010101" fill-opacity=".3">#{right}</text> | ||
<text x="69.5" y="14">#{right}</text> | ||
</g> | ||
</svg> | ||
SVGTEMPLATE | ||
file_content | ||
end | ||
end | ||
|
||
if ARGV.size < 2 | ||
puts " | ||
USAGE: | ||
badge left-word right-word [ right hex-color ] > badge.svg | ||
EXAMPLE: | ||
badge Ruby-API Docs > ruby-api.svg | ||
" | ||
exit 1 | ||
end | ||
|
||
SvgFormatter.new(*ARGV).write! | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.