Sha256: 84676d466c72fe21bd685843ea5acd7acfe8c877d00f5f37c73a9049cbd9aba7

Contents?: true

Size: 834 Bytes

Versions: 2

Compression:

Stored size: 834 Bytes

Contents

require 'whirled_peas/device/rendered_frame'

require_relative 'frame_command'

module WhirledPeas
  module Command
    # Display a still frame with the specified arguments.
    class Still < FrameCommand
      def self.description
        'Show the specified still frame'
      end

      def start
        super

        require 'whirled_peas/device/screen'
        require 'whirled_peas/graphics/renderer'
        require 'whirled_peas/utils/ansi'

        Utils::Ansi.with_screen do |width, height|
          strokes = Graphics::Renderer.new(
            WhirledPeas.config.template_factory.build(frame, frame_args),
            width,
            height
          ).paint
          Device::Screen.new.handle_rendered_frames(
            [Device::RenderedFrame.new(strokes, 0)]
          )
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
whirled_peas-0.13.0 lib/whirled_peas/command/still.rb
whirled_peas-0.12.0 lib/whirled_peas/command/still.rb