lib/sample_cmdlet_patterns/commands/which_exist.rb
# Execute WhichExist subcommand taking input from
# a input stream and writing to output stream
#
# sample: output.puts 'OK'
Execute WhichExist subcommand taking input from
a input stream and writing to output stream


Execute WhichExist subcommand taking input from a input stream and writing to output stream
def execute(input: $stdin, output: $stdout)
        values = [
          ['less', exec_exist?('less')],
          ['git', exec_exist?('git')],
          ['ruby', exec_exist?('ruby')],
          ['/usr/bin/ruby', exec_exist?('/usr/bin/ruby')],
          ['go', exec_exist?('go')],
          ['fred', exec_exist?('fred')]
        ]
        pretty_table('Paths Exist?', %w[key exists], values)
        :gui
      end
def execute ( input : $stdin , output : $stdout ) values = [ [ 'less' , exec_exist? ( 'less' ) ] , [ 'git' , exec_exist? ( 'git' ) ] , [ 'ruby' , exec_exist? ( 'ruby' ) ] , [ '/usr/bin/ruby' , exec_exist? ( '/usr/bin/ruby' ) ] , [ 'go' , exec_exist? ( 'go' ) ] , [ 'fred' , exec_exist? ( 'fred' ) ] ] pretty_table ( 'Paths Exist?' , %w[ key exists ] , values ) :gui end
Execute WhichExist subcommand taking input from
a input stream and writing to output stream
Execute WhichExist subcommand taking input from a input stream and writing to output stream
input
output