Sha256: 376543b279ad5fdf2d1210db1b6344427ed362bd2356d24455d46011affd49df

Contents?: true

Size: 735 Bytes

Versions: 6

Compression:

Stored size: 735 Bytes

Contents

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|
          rendered = Graphics::Renderer.new(
            WhirledPeas.config.template_factory.build(frame, frame_args),
            width,
            height
          ).paint
          Device::Screen.new(10000).handle_renders([rendered])
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
whirled_peas-0.11.1 lib/whirled_peas/command/still.rb
whirled_peas-0.11.0 lib/whirled_peas/command/still.rb
whirled_peas-0.10.0 lib/whirled_peas/command/still.rb
whirled_peas-0.9.1 lib/whirled_peas/command/still.rb
whirled_peas-0.9.0 lib/whirled_peas/command/still.rb
whirled_peas-0.8.0 lib/whirled_peas/command/still.rb