sinatra-named-routes-subdomains 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/sinatra/named_routes.rb +2 -2
- data/lib/sinatra/route_parser.rb +4 -1
- data/lib/sinatra/version.rb +1 -1
- metadata +2 -2
data/lib/sinatra/named_routes.rb
CHANGED
data/lib/sinatra/route_parser.rb
CHANGED
@@ -3,12 +3,13 @@ module Sinatra
|
|
3
3
|
class Route
|
4
4
|
attr_reader :source
|
5
5
|
|
6
|
-
def initialize(route)
|
6
|
+
def initialize(route, params = {})
|
7
7
|
route = route.source if route.is_a? Regexp
|
8
8
|
|
9
9
|
@source = route
|
10
10
|
@input = StringScanner.new(route)
|
11
11
|
@output = []
|
12
|
+
@params = params
|
12
13
|
|
13
14
|
parse
|
14
15
|
end
|
@@ -17,6 +18,8 @@ module Sinatra
|
|
17
18
|
path = []
|
18
19
|
params = {} if params.nil?
|
19
20
|
|
21
|
+
params = @params.merge( params )
|
22
|
+
|
20
23
|
@output.each_index do |index|
|
21
24
|
item = @output[index]
|
22
25
|
next_item = @output.fetch(index + 1, nil)
|
data/lib/sinatra/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-named-routes-subdomains
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sinatra
|