merb-slices 0.9.13 → 1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -65,7 +65,8 @@ Merb::Router.extensions do
65
65
  #
66
66
  # This will still setup a namespace, but doesn't set a path prefix. Only for special cases.
67
67
  def slice(slice_module, options = {}, &block)
68
- add_slice(slice_module, options.merge(:path => '', :reset_controller_prefix => true), &block)
68
+ options[:path] ||= ""
69
+ add_slice(slice_module, options.merge(:reset_controller_prefix => true), &block)
69
70
  end
70
71
 
71
72
  end
@@ -48,7 +48,7 @@ describe "The Merb::Router::Behavior methods" do
48
48
  )
49
49
  end
50
50
 
51
- before :all do
51
+ before :each do
52
52
  Merb::Router.prepare do
53
53
  add_slice(:FullTestSlice, :path_prefix => 'full') do |scope|
54
54
  scope.match('/dashboard').to(:controller => 'main', :action => 'index').name(:dashboard)
@@ -58,7 +58,7 @@ describe "The Merb::Router::Behavior methods" do
58
58
  end
59
59
  end
60
60
 
61
- after :all do
61
+ after :each do
62
62
  Merb::Router.reset!
63
63
  end
64
64
 
@@ -78,6 +78,14 @@ describe "The Merb::Router::Behavior methods" do
78
78
  Merb::Router.named_routes[:thin_test_slice_default].should == ThinTestSlice.named_routes[:default]
79
79
  end
80
80
 
81
+ it "should allow you to set the path" do
82
+ Merb::Router.prepare do
83
+ slice(:FullTestSlice, :path => "hi")
84
+ end
85
+
86
+ Merb::Router.named_routes[:full_test_slice_default].inspect.should == "/hi/:controller(/:action(/:id))(.:format)"
87
+ end
88
+
81
89
  it "should mount a slice directly at the root using #slice" do
82
90
  Merb::Router.named_routes[:awesome_default].inspect.should == '/:controller(/:action(/:id))(.:format)'
83
91
  Merb::Router.named_routes[:awesome_default].should == VeryThinTestSlice.named_routes[:default]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: merb-slices
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.13
4
+ version: "1.0"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabien Franzen
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-03 00:00:00 -08:00
12
+ date: 2008-11-08 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 0.9.13
23
+ version: "1.0"
24
24
  version:
25
25
  description: Merb-Slices is a Merb plugin for using and creating application 'slices' which help you modularize your application.
26
26
  email: info@fabien.be