Sha256: 04a23f3d4d655969c7b64c9756be4912325f00600391fcbb69c7bc6b9fd7d450

Contents?: true

Size: 1.14 KB

Versions: 7

Compression:

Stored size: 1.14 KB

Contents

# frozen_string_literal: true

module Spandx
  module Cli
    class Command
      extend Forwardable

      def_delegators :command, :run

      def execute(*)
        raise(NotImplementedError, "#{self.class}##{__method__} must be implemented")
      end

      def command(**options)
        require 'tty-command'
        TTY::Command.new(options)
      end

      def cursor
        require 'tty-cursor'
        TTY::Cursor
      end

      def editor
        require 'tty-editor'
        TTY::Editor
      end

      def generator
        require 'tty-file'
        TTY::File
      end

      def pager(**options)
        require 'tty-pager'
        TTY::Pager.new(options)
      end

      def platform
        require 'tty-platform'
        TTY::Platform.new
      end

      def prompt(**options)
        require 'tty-prompt'
        TTY::Prompt.new(options)
      end

      def screen
        require 'tty-screen'
        TTY::Screen
      end

      def which(*args)
        require 'tty-which'
        TTY::Which.which(*args)
      end

      def exec_exist?(*args)
        require 'tty-which'
        TTY::Which.exist?(*args)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
spandx-0.11.0 lib/spandx/cli/command.rb
spandx-0.10.1 lib/spandx/cli/command.rb
spandx-0.10.0 lib/spandx/cli/command.rb
spandx-0.9.0 lib/spandx/cli/command.rb
spandx-0.8.0 lib/spandx/cli/command.rb
spandx-0.7.0 lib/spandx/cli/command.rb
spandx-0.6.0 lib/spandx/cli/command.rb