Sha256: 9e5c456308d723cecd053c6425582defcbfcca7ac8ed65a62c4be1333b686f2e

Contents?: true

Size: 590 Bytes

Versions: 2

Compression:

Stored size: 590 Bytes

Contents

# frozen_string_literal: true

require 'thor'
require 'spongebobify'

module Spongebobify
  class CLI < Thor
    desc "spongebobify [TEXT|FILE]", "Converts TEXT or contents of FILE to spongebob case"
    def spongebobify(input = nil)
      if input.nil? && $stdin.tty?
        puts "No input provided. Use 'spongebobify \"some text\"' or 'spongebobify ./path_to_file.txt'"
        exit 1
      end

      if File.exist?(input)
        text = File.read(input)
      else
        text = input
      end

      puts Spongebobify.process(text)
    end

    default_task :spongebobify
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spongebobify-0.1.3 lib/spongebobify/cli.rb
spongebobify-0.1.2 lib/spongebobify/cli.rb