Sha256: 01ca2b09050de440e84484bce6f8748d78e82ffe98165827a3437b035e3f305e

Contents?: true

Size: 454 Bytes

Versions: 1

Compression:

Stored size: 454 Bytes

Contents

require 'fasten/ui/console'

module Fasten
  module Support
    module UI
      def ui
        require 'fasten/ui/curses'
        @ui ||= STDIN.tty? && STDOUT.tty? ? Fasten::UI::Curses.new(runner: self) : Fasten::UI::Console.new(runner: self)
      rescue StandardError, LoadError
        @ui = Fasten::UI::Console.new(runner: self)
      end

      def run_ui
        ui.update

        yield
      ensure
        ui.cleanup
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fasten-0.6.0 lib/fasten/support/ui.rb