Skip to content
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

Provide default DSL to use instead of match without regexp. #177

Merged
merged 3 commits into from
Mar 1, 2016

Conversation

gongo
Copy link
Collaborator

@gongo gongo commented Mar 1, 2016

Purpose

Improvement of #173

Motivation

Without regexp match that have been implemented in #173 is very useful.
But there is anxiety and surprise such as ":hushed: < I don't know what to match".

So, rename without regexp match to default. (example from #173 (comment))

placeholder :user_name do
  match /admin: (.*)/ do |user_name|
    User.find_by!(name: user_name, role: :admin)
  end

  match /superuser: (.*)/ do |user_name|
    User.find_by!(name: user_name, role: :super)
  end

  default do |user_name|
    User.find_by!(name: user_name)
  end
end

@gongo gongo self-assigned this Mar 1, 2016
gongo added a commit that referenced this pull request Mar 1, 2016
Provide `default` DSL to use instead of `match` without regexp.
@gongo gongo merged commit 85082af into master Mar 1, 2016
@gongo gongo deleted the default_dsl branch March 1, 2016 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant