Module: HeapScope::Branding
- Defined in:
- lib/heapscope/branding.rb
Overview
Central brand + funding metadata for CLI, reports, and docs generation.
Constant Summary collapse
- NAME =
"HeapScope"- TAGLINE =
"Ruby retention & heap growth diagnostics"- GITHUB_USER =
"theworker02"- GITHUB_REPO =
"https://github.com/theworker02/heapscope"- PAGES_URL =
"https://theworker02.github.io/heapscope/"- SPONSORS_URL =
"https://github.com/sponsors/theworker02"- THANKS_DEV_URL =
"https://thanks.dev/u/gh/theworker02"- THANKS_DEV_PATH =
"u/gh/theworker02"- LOGO_SVG =
"assets/logo.svg"- WORDMARK_SVG =
"assets/wordmark.svg"- LOGO_PNG =
"assets/heapscope-logo.png"
Class Method Summary collapse
- .about_text ⇒ Object
- .asset_path(relative) ⇒ Object
- .banner ⇒ Object
- .compact_banner ⇒ Object
- .funding_lines ⇒ Object
- .gem_root ⇒ Object
- .html_footer ⇒ Object
- .logo_svg_inline ⇒ Object
- .report_footer ⇒ Object
- .to_h ⇒ Object
Class Method Details
.about_text ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/heapscope/branding.rb', line 44 def about_text lines = [] lines << lines << "" lines << "Repository: #{GITHUB_REPO}" lines << "Website: #{PAGES_URL}" funding_lines.each { |l| lines << l } lines << "" lines << "Privacy: local-only diagnostics — no telemetry, no object-value dumps by default." lines.join("\n") end |
.asset_path(relative) ⇒ Object
70 71 72 |
# File 'lib/heapscope/branding.rb', line 70 def asset_path(relative) File.join(gem_root, relative) end |
.banner ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/heapscope/branding.rb', line 20 def <<~BANNER ██╗ ██╗███████╗ █████╗ ██████╗ ███████╗ ██████╗ ██████╗ ██████╗ ███████╗ ██║ ██║██╔════╝██╔══██╗██╔══██╗██╔════╝██╔════╝██╔═══██╗██╔══██╗██╔════╝ ███████║█████╗ ███████║██████╔╝███████╗██║ ██║ ██║██████╔╝█████╗ ██╔══██║██╔══╝ ██╔══██║██╔═══╝ ╚════██║██║ ██║ ██║██╔═══╝ ██╔══╝ ██║ ██║███████╗██║ ██║██║ ███████║╚██████╗╚██████╔╝██║ ███████╗ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═╝ ╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚══════╝ #{TAGLINE} v#{VERSION} BANNER end |
.compact_banner ⇒ Object
32 33 34 |
# File 'lib/heapscope/branding.rb', line 32 def "#{NAME} v#{VERSION} — #{TAGLINE}" end |
.funding_lines ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/heapscope/branding.rb', line 36 def funding_lines [ "Sponsor: #{SPONSORS_URL}", "thanks.dev: #{THANKS_DEV_URL}", "Docs site: #{PAGES_URL}" ] end |
.gem_root ⇒ Object
66 67 68 |
# File 'lib/heapscope/branding.rb', line 66 def gem_root File.("../..", __dir__) end |
.html_footer ⇒ Object
60 61 62 63 64 |
# File 'lib/heapscope/branding.rb', line 60 def "Generated locally by #{NAME} · no network · no telemetry · " \ "<a href=\"#{THANKS_DEV_URL}\">thanks.dev</a> · " \ "<a href=\"#{PAGES_URL}\">docs</a>" end |
.logo_svg_inline ⇒ Object
74 75 76 77 78 79 |
# File 'lib/heapscope/branding.rb', line 74 def logo_svg_inline path = asset_path(LOGO_SVG) return nil unless File.file?(path) File.read(path) end |
.report_footer ⇒ Object
56 57 58 |
# File 'lib/heapscope/branding.rb', line 56 def "Privacy: object values are not serialized by default. · #{THANKS_DEV_URL} · #{PAGES_URL}" end |
.to_h ⇒ Object
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/heapscope/branding.rb', line 81 def to_h { name: NAME, tagline: TAGLINE, version: VERSION, github_user: GITHUB_USER, github_repo: GITHUB_REPO, pages_url: PAGES_URL, sponsors_url: SPONSORS_URL, thanks_dev_url: THANKS_DEV_URL, thanks_dev_path: THANKS_DEV_PATH, logo_svg: LOGO_SVG, wordmark_svg: WORDMARK_SVG, logo_png: LOGO_PNG } end |