Module: WinToaster

Defined in:
lib/win_toaster.rb,
lib/win_toaster/cli.rb,
lib/win_toaster/version.rb,
lib/win_toaster/notifier.rb

Defined Under Namespace

Classes: CLI, Error, Notifier

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.notify(title:, message:, detail: nil, image: nil, hero: nil, app_id: Notifier::DEFAULT_APP_ID) ⇒ Object

Show a Windows toast notification from WSL.

WinToaster.notify(title: "Build finished", message: "All green")

image (small icon) and hero (large banner) take a file path; from WSL a Linux/WSL path is accepted and converted to a Windows path automatically.

Returns true on success and raises WinToaster::Error on failure.



16
17
18
19
20
21
# File 'lib/win_toaster.rb', line 16

def self.notify(title:, message:, detail: nil, image: nil, hero: nil, app_id: Notifier::DEFAULT_APP_ID)
  Notifier.new(
    title: title, message: message, detail: detail,
    image: image, hero: hero, app_id: app_id
  ).deliver
end