lib/sawarineko/cli.rb
def run(args = ARGV)
      @options, paths = Option.new.parse(args)
      source = if paths.empty?
                 $stdin.read
               else
                 IO.read(paths[0], encoding: @options[:encoding])
               end
      converter = Converter.new(@options[:encoding])
      puts converter.convert(source)
      0
    end
# Entry point for the application logic. Process command line arguments and
# run the Sawarineko.
#
# args - An Array of Strings user passed.
#
# Returns an Integer UNIX exit code.
Entry point for the application logic. Process command line arguments and
run the Sawarineko.

An Array of Strings user passed.

Returns an Integer UNIX exit code.
Entry point for the application logic . Process command line arguments and run the Sawarineko . An Array of Strings user passed . Returns an Integer UNIX exit code .
def run(args = ARGV)
      @options, paths = Option.new.parse(args)
      source = if paths.empty?
                 $stdin.read
               else
                 IO.read(paths[0], encoding: @options[:encoding])
               end
      converter = Converter.new(@options[:encoding])
      puts converter.convert(source)
      0
    end
def run ( args = ARGV ) @options , paths = Option . new . parse ( args ) source = if paths . empty? $stdin . read else IO . read ( paths [ 0 ] , encoding : @options [ :encoding ] ) end converter = Converter . new ( @options [ :encoding ] ) puts converter . convert ( source ) 0 end
Entry point for the application logic.
Entry point for the application logic .
args