Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7709969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:59:41+00:00 2026-06-01T00:59:41+00:00

I want make interactive application where user launches it and can do various task

  • 0

I want make interactive application where user launches it and can do various task by typing commands (some kind of shell)

example:

./myapp.rb  
App says Hi  
Commands:   
  help - display help about command
  open - open task
  do - do action
Start>help open
  open <TaskName>
  opens specified task
Start>open Something  
Something>do SomeAction
  Success!
Something> (blinking cursor here)

I searched but couldn’t find any ruby gems that I could use specially for console interaction, so I’m about to my make my own…

I looked at Thor, but that’s not exactly as I want, maybe I could use it, but not sure…

it could look something like:

class Tasks
  attr_reader :opened_task

  desc "open <TaskName>", "opens specified task"
  def open(params)
  end

  desc "do <ActionName>", "do specified action"
  def do(params)
  end
end

tasks = Tasks.new
# theoretical Console class
console = Console.new
console.addCommand("open",tasks.method(:open),"open task")
console.addCommand("do",tasks.method(:do),"do action")
console.start("%s>",[*tasks.opened_task])

so my question is, what gems I could use to make such console class? maybe someone have already made something similar?
I plan using HighLine for input/output, but any other suggestion what could I use?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T00:59:42+00:00Added an answer on June 1, 2026 at 12:59 am

    What you want is a REPL – Read → Evaluate → Print Loop.

    IRB, for example, implements a REPL for the Ruby language.

    Here’s a very simple implementation of your application’s REPL:

    loop do
      Application::Console.prompt.display
      input = gets.chomp
      command, *params = input.split /\s/
    
      case command
      when /\Ahelp\z/i
        puts Application::Console.help_text
      when /\Aopen\z/i
        Application::Task.open params.first
      when /\Ado\z/i
        Application::Action.perform *params
      else puts 'Invalid command'
      end
    end
    

    \A and \z match the start of the string and the end of the string, respectively.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make a application that runs with no form interaction with user
Let's say I want make some of my sources publicly available via my blog
I want to make sure people can't type the name of a PHP script
I have make an application. In this application client need that when user download
I want to make a camera application in which i want to start front
I am using Ajax with ModelGlue in a ColdFusion Application. I want to make
I want make datetimepicker in my project. Using jquery how it is possible? I
I have style sheet with a class name changebackgroundcolor i want make change in
I am traversing a HTML document using javascript DOM. I want make a list
I want to make an etag that matches what Apache produces. How does apache

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.