nonsequitur / inf-ruby

218 stars 69 forks source link

Hanami console #105

Closed choallin closed 7 years ago

choallin commented 7 years ago

I'm using the Hanami framework to develop my Ruby app. Hanami has a console as well which boots the app. (The command is hanami console) How can I configure inf-ruby to boot this console?

dgutov commented 7 years ago

You add an appropriate element to inf-ruby-console-patterns-alist. Or wait for me to do that. :)

choallin commented 7 years ago

I would love to do so, but I have absolutly no idea on how to do that... As said in another issue, I'm a beginner and I don't know elisp...

dgutov commented 7 years ago

Do you usually call hanami console or bundle exec hanami console?

choallin commented 7 years ago

Usually I call it with bundle exec

dgutov commented 7 years ago

OK. Next question: how do I figure out that the current project uses Hanami?

For example, this is what we do for Rails: https://github.com/nonsequitur/inf-ruby/blob/master/inf-ruby.el#L748-L753

choallin commented 7 years ago

One difference between Rails and Hanami is the apps directory. (Notice the plural) Of course it has a Gemfile and a Gemfile.lock as well. If it is easily done, you can take a look into the config.ru file as well. If it is a Hanami app, there must be the line run Hanami.app. Or, maybe you can check if the config/boot.rb file exists.

dgutov commented 7 years ago

So: config.ru exists and contains run Hanami.app?

choallin commented 7 years ago

Not only but it contains this line, yes.

dgutov commented 7 years ago

I've pushed some code. Please try it out with M-x inf-ruby-console-auto or M-x inf-ruby-console-hanami.