rory 0.3.7 → 0.3.8
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/rory/dispatcher.rb +3 -1
- data/lib/rory/version.rb +1 -1
- data/rory.gemspec +1 -0
- data/spec/application_spec.rb +3 -2
- data/spec/fixture_app/config/routes.rb +1 -0
- data/spec/fixture_app/controllers/for_reals_controller.rb +5 -0
- data/spec/fixture_app/views/for_reals/srsly.html.erb +1 -0
- data/spec/requests/controller_spec.rb +9 -0
- data/spec/spec_helper.rb +3 -1
- metadata +20 -1
data/lib/rory/dispatcher.rb
CHANGED
@@ -45,7 +45,9 @@ module Rory
|
|
45
45
|
|
46
46
|
def controller
|
47
47
|
if klass = controller_class
|
48
|
-
|
48
|
+
request_for_delivery = @request.dup
|
49
|
+
request_for_delivery[:dispatcher] = self
|
50
|
+
klass.new(request_for_delivery, @context)
|
49
51
|
end
|
50
52
|
end
|
51
53
|
|
data/lib/rory/version.rb
CHANGED
data/rory.gemspec
CHANGED
data/spec/application_spec.rb
CHANGED
@@ -78,7 +78,8 @@ describe Rory::Application do
|
|
78
78
|
{ :controller => 'awesome', :action => 'rad', :regex => /^this\/(?<path>[^\/]+)\/is\/(?<very_awesome>[^\/]+)$/},
|
79
79
|
{ :controller => 'lumpies', :action => 'show', :regex => /^lumpies\/(?<lump>[^\/]+)$/, :module => 'goose', :methods => [:get] },
|
80
80
|
{ :controller => 'rabbits', :action => 'chew', :regex => /^rabbits\/(?<chew>[^\/]+)$/, :module => 'goose/wombat', :methods => [:get] },
|
81
|
-
{ :controller => 'root', :action => 'vegetable', :regex => /^$/, :methods => [:get] }
|
81
|
+
{ :controller => 'root', :action => 'vegetable', :regex => /^$/, :methods => [:get] },
|
82
|
+
{ :controller => 'for_reals', :action => 'srsly', :regex => /^for_reals\/(?<parbles>[^\/]+)$/, :methods => [:get] }
|
82
83
|
].inspect
|
83
84
|
end
|
84
85
|
end
|
@@ -90,7 +91,7 @@ describe Rory::Application do
|
|
90
91
|
end
|
91
92
|
end
|
92
93
|
|
93
|
-
describe '.
|
94
|
+
describe '.auto_require_paths' do
|
94
95
|
after(:each) do
|
95
96
|
Fixture::Application.instance.instance_variable_set(:@auto_require_paths, nil)
|
96
97
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
You've done it again, <%= @gibbit %>!
|
data/spec/spec_helper.rb
CHANGED
@@ -5,6 +5,7 @@ ENV['RORY_STAGE'] = 'test'
|
|
5
5
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
6
6
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
7
7
|
require 'rspec'
|
8
|
+
require 'capybara/rspec'
|
8
9
|
require 'rory'
|
9
10
|
require 'rack'
|
10
11
|
|
@@ -14,9 +15,10 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
|
14
15
|
|
15
16
|
require_relative 'fixture_app/config/application'
|
16
17
|
Fixture::Application.root = File.join(File.dirname(__FILE__), 'fixture_app')
|
17
|
-
|
18
18
|
Fixture::Application.require_all_files
|
19
19
|
|
20
|
+
Capybara.app = Fixture::Application
|
21
|
+
|
20
22
|
RSpec.configure do |config|
|
21
23
|
|
22
24
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -91,6 +91,22 @@ dependencies:
|
|
91
91
|
- - ! '>='
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: capybara
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
94
110
|
- !ruby/object:Gem::Dependency
|
95
111
|
name: yard
|
96
112
|
requirement: !ruby/object:Gem::Requirement
|
@@ -188,13 +204,16 @@ files:
|
|
188
204
|
- spec/dispatcher_spec.rb
|
189
205
|
- spec/fixture_app/config/application.rb
|
190
206
|
- spec/fixture_app/config/routes.rb
|
207
|
+
- spec/fixture_app/controllers/for_reals_controller.rb
|
191
208
|
- spec/fixture_app/controllers/goose/lumpies_controller.rb
|
192
209
|
- spec/fixture_app/controllers/goose/wombat/rabbits_controller.rb
|
193
210
|
- spec/fixture_app/controllers/stub_controller.rb
|
211
|
+
- spec/fixture_app/views/for_reals/srsly.html.erb
|
194
212
|
- spec/fixture_app/views/layouts/surround.html.erb
|
195
213
|
- spec/fixture_app/views/test/dynamic.html.erb
|
196
214
|
- spec/fixture_app/views/test/letsgo.html.erb
|
197
215
|
- spec/fixture_app/views/test/static.html.erb
|
216
|
+
- spec/requests/controller_spec.rb
|
198
217
|
- spec/rory_spec.rb
|
199
218
|
- spec/spec_helper.rb
|
200
219
|
- spec/support_spec.rb
|