Conversation
Add standalone runnable examples rather than baking diagram/reporting logic into the gem itself — no new gem dependencies required. examples/diagramming/workflow_diagram.rb: - Fetches statuses via client.statuses.all - Renders workflow as Mermaid (default), Graphviz DOT, ASCII, and SVG - SVG via dot CLI (brew install graphviz) or ruby-graphviz gem — both optional - Hex status colors + automatic text contrast for all renderers examples/reporting/sales_report.rb: - Pages all invoices, filters by period in Ruby - Periods: today, this week, this month, this quarter, YTD, last year, custom range - Computes: gross revenue, amount paid, outstanding, paid-in-full count, average, largest examples/reporting/sales_tax_report.rb: - Approach 1: invoice-level estimate using configurable TAX_RATE env var - Approach 2: fee-level detail — fetches fees per invoice, sums taxable: true amounts - MemoryStore cache wired in to protect the rate limit on fee fetches docs/FUTURE.md: Workflow Diagram section replaced with examples reference + rationale docs/TODO.md: v0.18.1 entry added Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
examples/reporting/customers_export.rb: - CSV (Ruby stdlib, no gem), XLSX (caxlsx), XLS (spreadsheet) - vCard 3.0 (.vcf) — imports into any CRM, email client, or phone - HubSpot CSV, Salesforce CSV, Mailchimp CSV - Optional gem exports gracefully skip with gem install hint if unavailable examples/reporting/outstanding_tasks.rb: - Buckets: overdue, due today, due this week, upcoming, no due date - Sorted oldest-first for overdue, soonest-first for upcoming - ANSI color coding per urgency level - By-assignee summary with overdue count highlighted Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
customers_export.rb — four new CRM/email platform exporters: - Constant Contact CSV (contact import with note field) - Beehiiv CSV (subscriber import with UTM source tagging) - Brevo CSV (attribute-named columns: EMAIL, FIRSTNAME, LASTNAME, SMS, COMPANY, PRINTAVO_ID) - ActiveCampaign CSV (contact import with auto-tag 'printavo-customer') outstanding_tasks.rb — HTML calendar export: - Self-contained HTML file (no external CDN), printable via @media print - Monthly grid layout, up to 3 months per row - Color-coded chips per urgency: red=overdue, amber=today, blue=this week, green=upcoming - Chip tooltips show full task body + assignee - No-due-date tasks in a table below the calendars - Range defaults to span of all task due dates; override with CALENDAR_START / CALENDAR_END env vars - Output path configurable via CALENDAR_FILE env var Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Style/FormatStringToken:
- Replaced format('%-Ns %s', label, val) alignment calls with
string interpolation + ljust/rjust throughout all example files
- fmt_currency: replaced format('$%,.2f') with a manual comma-grouping
helper (Ruby's %,f flag triggers Lint/FormatParameterMismatch in RuboCop)
- fmt_pct: converted to annotated token format('%<rate>.4f%%', rate:)
Metrics/MethodLength:
- workflow_diagram: extract dot_node_defs, configure_graphviz helpers
- outstanding_tasks: extract month_header_html, day_chips_html, day_cell_html,
legend_html, no_date_section_html, month_grids_html from render_month
and build_html_calendar
Targeted rubocop:disable (intrinsically complex reporting/display methods):
- build_report, print_report — Metrics/AbcSize (hash-heavy aggregation)
- render_month — Metrics/AbcSize, Metrics/MethodLength (HTML grid builder)
- to_vcard — Metrics/AbcSize (branchy vCard field construction)
- build_html_calendar — Metrics/MethodLength (multi-section HTML template)
Naming/MethodParameterName: configure_graphviz(g) → (gviz)
Style/StringConcatenation: month_header_html converted to interpolation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
FUTURE.md now has a short cross-reference link. VISUALIZATION.md expands the section with Quick Start, output file table, DOT rendering commands, and Mermaid embedding instructions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Standalone runnable examples — no new gem dependencies added to the library itself.
examples/diagramming/workflow_diagram.rbclient.statuses.alland renders the shop's workflow in 4 formats:ascii— zero-dependency terminal output:mermaid— GitHub-renderable flowchart (paste between```mermaidfences):dot— Graphviz DOT source written toworkflow.dot; pipe todot -Tsvgfor any format:svg— written via dot CLI (brew install graphviz) orruby-graphvizgem; both optional, both skip gracefullyexamples/reporting/sales_report.rbclient.invoices.all_pages, filters by period in RubyREPORT_START/REPORT_END)examples/reporting/sales_tax_report.rbTAX_RATEenv var (fast, no extra API calls)taxable: truefees per invoice;MemoryStorecache wired inexamples/reporting/customers_export.rb— 11 formatscustomers.csvcustomers.vcfcustomers_hubspot.csvcustomers_salesforce.csvcustomers_mailchimp.csvcustomers_constantcontact.csvcustomers_beehiiv.csvcustomers_brevo.csvcustomers_activecampaign.csvprintavo-customer)customers.xlsxgem install caxlsxcustomers.xlsgem install spreadsheetOptional gem exports skip gracefully with a
gem installhint.examples/reporting/outstanding_tasks.rbtasks_calendar.html) — self-contained, no CDN, printableCALENDAR_START/CALENDAR_ENDdocs/FUTURE.mdWorkflow Diagram section replaced with examples-folder reference and rationale for keeping graphviz out of the gem.
Test plan
# frozen_string_literal: true.env.examplein both example directoriesdocs/FUTURE.mdanddocs/TODO.mdupdatedcp .env.example .env && ruby examples/diagramming/workflow_diagram.rbruby examples/reporting/customers_export.rbruby examples/reporting/outstanding_tasks.rb && open tasks_calendar.html🤖 Generated with Claude Code