module PaintSamplesRealS78
PaintSamples — real formatter output for S7–S8 plugins.
Public Instance Methods
Source
# File lib/paint_samples/register_real_s7_s8.rb, line 23 def register_all PaintSamples.register("qld") do events = QldTraffic.parse_geojson( "features" => [{ "properties" => { "id" => 123, "event_type" => "Hazard", "event_subtype" => "Flooding", "description" => "Road closed due to water over road", "road_summary" => { "road_name" => "Smith St", "locality" => "Brisbane" }, "impact" => { "impact_type" => "Road closed" } } }] ) QldTraffic.format_events(events, title: "QLD traffic · Brisbane").split("\n") end PaintSamples.register("sunbus") do SunbusFormat.format_times( stop_name: "Cairns City", rows: [{ route: "100", dest: "Smithfield", time: "14:05" }], region: "cns" ).split("\n") end PaintSamples.register("geo") do result = Geocoder::Result::Test.new( "coordinates" => [-27.47, 153.03], "city" => "Brisbane", "state_code" => "QLD", "country" => "Australia", "timezone" => "Australia/Brisbane", "offset" => 36_000 ) GeoLookup.format_location_report(nick: "MeatAnt", result: result).split("\n") end PaintSamples.register("globe") do search = lambda do |_query| [Geocoder::Result::Test.new("coordinates" => [32.0, 53.0], "country" => "Iran", "address" => "Iran")] end Globe.format_globe("iran", search: search).split("\n") end PaintSamples.register("holidays") do holiday = { date: "2026-01-01", observed_date: "2026-01-01", local_name: "New Year's Day", name: "New Year's Day", country_code: "AU", id: "AU-NY" } HolidayCalendar.format_list([holiday], country: "AU", title: "Australia · upcoming").split("\n") end PaintSamples.register("quake") do events = QuakeFeed.parse_geojson( "features" => [{ "id" => "test1", "properties" => { "mag" => 4.5, "place" => "30 km SW of Tennant Creek, Australia", "time" => 1_780_388_333_668 }, "geometry" => { "coordinates" => [133.97, -19.84, 10] } }] ) QuakeFeed.format_recent(events).split("\n") end PaintSamples.register("govau") do results = [ { title: "PTV Timetable API", name: "ptv-timetable-api", organization: "Public Transport Victoria", notes: "Real-time train, tram and bus data for Victoria." } ] GovauCkan.format_search("ptv", results).split("\n") end PaintSamples.register("abs") do AbsPopulation.format_population("sydney").split("\n") end PaintSamples.register("aec") do AecResults.format_seat( name: "Warringah", state: "NSW", tcp: "54.2", swing: "+3.1" ).split("\n") end PaintSamples.register("fuel") do FuelNsw.format_cheapest( "U91", "2000", { name: "Metro Petroleum", suburb: "Sydney", price: 189.9 } ).split("\n") end PaintSamples.register("tm") do TmSearch.format_search("rabbot", { count: 2 }).split("\n") end PaintSamples.register("rba") do RbaRates.format_pair( series_id: "FXAUDUSD", label: "AUD/USD", value: "0.6521", date: "2026-06-18" ).split("\n") end PaintSamples.register("distance") do [ IrcFormat.report_header(tag: "Fuel", title: "Fuel · QLD"), "Petrol · 189.9c/L · trip $41.41", "Diesel · 199.5c/L · trip $43.49", "Average vehicle · trip $42.45 · 8.9 L/100km", IrcFormat.report_footer("fuel prices", "QLD", "avg 8.9 L/100km") ] end end