sinatra-mapping 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,8 +1,13 @@
1
1
  = Changes
2
2
 
3
+ [1.0.3 - July 2009]
4
+ * Error in root path without script name in environment have been fixed.
5
+
3
6
  [1.0.2 - July 2009]
4
7
  * The method for creates paths with parameters has been fixed.
5
8
 
9
+ * RDoc has been updated.
10
+
6
11
  [1.0.1 - July 2009]
7
12
  * The method for creates links has been fixed.
8
13
 
data/VERSION CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  :release:
3
- :date: 2009-07-21
3
+ :date: 2009-07-27
4
4
  :cycle: Release
5
5
  :major: 1
6
6
  :minor: 0
7
- :patch: 2
7
+ :patch: 3
@@ -23,9 +23,10 @@ module Sinatra
23
23
  # map :root, "tasks" # => /tasks/
24
24
  # map :changes, "last-changes # => /tasks/last-changes
25
25
  def map(name, path = nil)
26
+ @env ||= {}
26
27
  @locations ||= {}
27
28
  if name.to_sym == :root
28
- @locations[:root] = cleanup_paths("/#{path}/")
29
+ @locations[:root] = cleanup_paths("/#{@env['SCRIPT_NAME']}/#{path}/")
29
30
  metadef "#{name}_path" do |*paths|
30
31
  @locations[:root]
31
32
  end
data/test/test_mapping.rb CHANGED
@@ -7,6 +7,12 @@ require 'test/unit'
7
7
  require 'rack/test'
8
8
  require 'ruby-debug'
9
9
 
10
+ class Sinatra::Base
11
+ def env
12
+ {'SCRIPT_NAME' => 'blog'}
13
+ end
14
+ end
15
+
10
16
  class AppForTest < Sinatra::Base
11
17
 
12
18
  register Sinatra::Mapping
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-mapping
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hallison Batista
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-07-21 00:00:00 -04:00
12
+ date: 2009-07-27 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency