New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match plugin names with dashes #2025

Merged
merged 1 commit into from May 1, 2016

Conversation

Projects
None yet
2 participants
@wikimatze
Member

wikimatze commented May 1, 2016

I was cleaning up the plugins under https://github.com/padrino/padrino-recipes/tree/master/plugins and found that the twitter-login plugin is not listed when running listing all plugins:

wm@wm ~ » padrino g plugin -l
Available plugins:
  - ["960"]
  - ["access"]
  - ["ar_permalink_i18n"]
  - ["ar_permalink"]
  - ["ar_textile"]
  - ["ar_translate"]
  - ["auto_locale"]
  - ["barista"]
  - ["better_errors"]
  - ["blueprint"]
  - ["bootstrap"]
  - ["bug"]
  - ["camorra"]
  - ["carrierwave"]
  - ["codehighlighter"]
  - ["coderay"]
  - ["coffee"]
  - ["deflect"]
  - ["disqus"]
  - ["dreamhost"]
  - ["exception_notifier"]
  - ["factory_girl"]
  - ["flash_session"]
  - ["fontawesome"]
  - ["googleanalytics"]
  - ["heroku"]
  - ["hoptoad"]
  - ["jammit"]
  - ["letter_opener"]
  - ["maintenance"]
  - ["omniauth"]
  - ["openid"]
  - ["payment"]
  - ["pry_byebug"]
  - ["pry_debugger"]
  - ["raphaeljs"]
  - ["raphy_charts"]
  - ["recaptcha"]
  - ["resque"]
  - ["rewrite"]
  - ["secure_only"]
  - ["tripoli"]
  - ["vcr"]
  - ["watchr"]
  - ["will_paginate"]

It turns out, that the regex getting the plugin names is not allowing dashes in names:

Here is what I mean:

Behavior before:

"tree/master/plugins/twitter-login_plugin.rb".scan(%r{/plugins/(\w+)_plugin.rb})
=> []

Behavior now:

>> "tree/master/plugins/twitter-login_plugin.rb".scan(%r{/plugins/(\w+-\w+)_plugin.rb})
=> [["twitter-login"]]

I tried to write a test for this issue, but found in too hard to test thor actions.

Cheers Matthias

@wikimatze wikimatze changed the title from Match plugin names with dashes in their names to Match plugin names with dashes May 1, 2016

@nesquena

This comment has been minimized.

Show comment
Hide comment
@nesquena

nesquena May 1, 2016

Member

Thanks!

Member

nesquena commented May 1, 2016

Thanks!

@nesquena nesquena merged commit f6af376 into padrino:master May 1, 2016

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment