Sha256: 6e576aaa47a3399335d7c492c2d01443af3acb2e169d988ef6463bbade3f965d

Contents?: true

Size: 405 Bytes

Versions: 4

Compression:

Stored size: 405 Bytes

Contents

require_relative 'settings'
require_relative 'text_wrapper'

module LovelyRufus
  class CLIWrapper
    def initialize(args = ARGV, text_wrapper: TextWrapper)
      @settings     = Settings.new(args)
      @text_wrapper = text_wrapper
    end

    def run(stream = $stdin)
      puts text_wrapper.wrap(stream.read, width: settings.width)
    end

    private_attr_reader :settings, :text_wrapper
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lovely_rufus-1.0.0 lib/lovely_rufus/cli_wrapper.rb
lovely_rufus-0.3.2 lib/lovely_rufus/cli_wrapper.rb
lovely_rufus-0.3.1 lib/lovely_rufus/cli_wrapper.rb
lovely_rufus-0.3.0 lib/lovely_rufus/cli_wrapper.rb