Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.

Commit

Permalink
Use Mustermann from master until a release is made
Browse files Browse the repository at this point in the history
Since master has a patch which fixes the missing `:+` implementation for
Regular and Sinatra-based patterns.

We can also re-enable the namespace specs for accepting regular expressions for
path concatination.

/cc #200 and #207
  • Loading branch information
Zachary Scott committed Jul 19, 2016
1 parent dd3e6c3 commit 9500d76
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
source "https://rubygems.org" unless ENV['QUICK']
gemspec

gem 'mustermann', github: 'sinatra/mustermann'

group :development, :test do

platform :ruby_18 do
Expand Down
4 changes: 1 addition & 3 deletions lib/sinatra/namespace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,7 @@ def compile(pattern, conditions, default_pattern = nil)
def prefixed_path(a, b)
return a || b || /.*/ unless a and b

Mustermann.new(a.to_s + b.to_s)
rescue
Mustermann.new(/#{a}#{b}/)
Mustermann.new(a) + Mustermann.new(b)
end

def prefixed(method, pattern = nil, conditions = {}, &block)
Expand Down
4 changes: 0 additions & 4 deletions spec/namespace_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ def namespace(*args, &block)
end

it 'accepts the path as regular expression' do
skip "Sinatra::Namespace accepts regular expressions for pattern"

namespace('/:foo') { send(verb, %r{/bar}) { params[:foo] }}
send(verb, '/foo/bar').should be_ok
body.should == 'foo' unless verb == :head
Expand All @@ -99,8 +97,6 @@ def namespace(*args, &block)
end

it 'accepts the path as a named parameter' do
skip "Sinatra::Namespace accepts regular expressions for pattern"

namespace(%r{/foo}) { send(verb, '/:bar') { params[:bar] }}
send(verb, '/foo/bar').should be_ok
body.should == 'bar' unless verb == :head
Expand Down

0 comments on commit 9500d76

Please sign in to comment.