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 623581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:06:29+00:00 2026-05-13T19:06:29+00:00

Having a hard time getting any useful results from various searches on this concept

  • 0

Having a hard time getting any useful results from various searches on this concept — probably because it’s a. Wrong and/or b. obscure. Essentially, though, I’d like to write an application which works as either a normal web app or with a command-line interface. I’ve done this in the ancient past for sysadmin-y stuff using Perl, but that had none of the joy that using Ruby/Rails brings.

I am comfortable enough with Rails itself, and also use standalone Ruby for all manner of CLI stuff. What I’m looking for is best practices, if they exist, for extending a Rails application to have CLI functionality.

Perhaps the answer is as simple as using script/runner and doing my own “VC” while using my Rails models… This is what I was planning on doing, but I thought I’d step back and sanity-check that approach first. I’m having a hard time imagining how I’d utilize any of the Rails controller stuff, given that it’s so tightly married to HTTP requests, but I’m often surprised by what clever(er) folks come up with.

Thanks for any useful responses.

  • 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-05-13T19:06:29+00:00Added an answer on May 13, 2026 at 7:06 pm

    I think it all depends on whether you want to reuse your controller logic. If you do then you can go down the route of writing a gem/Rake task/standalone Ruby script that makes HTTP requests to the application and receives the responses as JSON/XML/plain text or whatever. Something like HTTParty is ideal for this.

    The second alternative is as you describe: drive your Rails models directly from your own script and present the results.

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

Sidebar

Related Questions

I'm having a hard time getting my head around this, and Google just isn't
I'm having a hard time getting this to work, and I'm hopelessly confused with
i'm having a hard time getting this to work, all I need to do
I am having a really hard time getting this to work. I have two
I'm having hard time getting my head wrapped around this one - and it
I'm having hard time getting this snippet to work. I have made a minimal
Anyone have any examples of javascript actionresults? I am having a hard time getting
So, I am having a hard time getting this to work. I am trying
I'm having a hard time getting the hang of this. Say I have: NSMutableArray
I am having a really hard time getting this marshalling down. I have umanaged

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.