I'm building a command line client for the Strava API, https://github.com/dblock/strava-ruby-cli.
Ripl comes in handy and I could easily throw in strava console that let me delegate anything from my client and do things like athlete.name.
I also would like to be able to just pass these commands on the command line and let Ripl evaluate them for me, without a prompt. How do I do that?
module Strava
module Cli
class Console < SimpleDelegator
attr_reader :client
def initialize(access_token)
@client = Strava::Api::Client.new(access_token: access_token)
super @client
end
def run(args)
# HOW DO I DO THIS?
end
def start!
Ripl.start(binding: binding, prompt: 'Strava> ')
end
end
end
end
I can do this without ripl with just eval here, but it feels wrong.
I'm building a command line client for the Strava API, https://github.com/dblock/strava-ruby-cli.
Ripl comes in handy and I could easily throw in
strava consolethat let me delegate anything from my client and do things likeathlete.name.I also would like to be able to just pass these commands on the command line and let Ripl evaluate them for me, without a prompt. How do I do that?
I can do this without ripl with just
evalhere, but it feels wrong.