aboutsummaryrefslogtreecommitdiff
path: root/rakelib/support
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-10-07 02:25:34 +0200
committerEugen Wissner <belka@caraus.de>2026-10-07 02:25:34 +0200
commitf9dfefc52fc792099b622ae47dafa32d2512e51e (patch)
tree3be1fdc6d29bf04dc460684794ebfc566f7a2662 /rakelib/support
parente38f23a1bd6e0ee093655e1f241e524795f21fec (diff)
downloadelna-f9dfefc52fc792099b622ae47dafa32d2512e51e.tar.gz
Add some useful gems for ruby code
Diffstat (limited to 'rakelib/support')
-rw-r--r--rakelib/support/ui.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/rakelib/support/ui.rb b/rakelib/support/ui.rb
new file mode 100644
index 0000000..3120721
--- /dev/null
+++ b/rakelib/support/ui.rb
@@ -0,0 +1,25 @@
+# This Source Code Form is subject to the terms of the Mozilla Public License,
+# v. 2.0. If a copy of the MPL was not distributed with this file, You can
+# obtain one at https://mozilla.org/MPL/2.0/.
+# frozen_string_literal: true
+
+require 'term/ansicolor'
+
+# Terminal UI helpers for build milestones, debug logging, and operational errors.
+module UI
+ extend Term::ANSIColor
+
+ def self.step(message)
+ puts green(message)
+ end
+
+ def self.debug(message)
+ puts "#{dark(' ->')} #{dark(message)}" if Rake.verbose
+ end
+
+ def self.fatal(message, hint: nil)
+ output = red(message)
+ output += "\n#{bold(cyan('Hint:'))} #{hint}" if hint
+ abort output
+ end
+end