sitepress-rails 0.1.22 → 0.1.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sitepress/engine.rb +12 -3
- data/lib/sitepress/rails_configuration.rb +4 -2
- data/lib/sitepress/route_constraint.rb +3 -3
- data/spec/dummy/log/production.log +56 -0
- data/spec/dummy/log/test.log +28435 -0
- data/spec/sitepress/rails_configuration_spec.rb +2 -21
- data/spec/sitepress-rails_spec.rb +41 -18
- data/spec/spec_helper.rb +3 -1
- metadata +18 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89e2092d8248342bf625c8a29089055564aaa324
|
4
|
+
data.tar.gz: e1602ac7344029a4194a6830be120c6df1947fcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64b2be3393caeef5f52868493a0c7db54625ffa5796e3bf2a606f1ccf3539e4ac621dac630b41e34fa6ff3f10455ff4e88c7824a0b54e452b563214efd593502
|
7
|
+
data.tar.gz: b65ebdf75334f2d712fad08469130a33f2cb50e55d218801ed32f3b61f533ed936ed47cd0ba5d82fa3441ef7b4ac89b4a1f3bcfd793babbfac14bb7e47cae53f
|
data/lib/sitepress/engine.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
module Sitepress
|
2
2
|
class Engine < ::Rails::Engine
|
3
3
|
config.before_configuration do |app|
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
Sitepress.configure do |config|
|
5
|
+
app.paths["app/helpers"].push config.site.root_path.join("helpers")
|
6
|
+
app.paths["app/assets"].push config.site.root_path.join("assets")
|
7
|
+
app.paths["app/views"].push config.site.root_path
|
8
|
+
end
|
7
9
|
|
8
10
|
# Setup concerns paths for Rails 4 (doesn't automatically populate)
|
9
11
|
concerns_path = "app/controllers/concerns"
|
@@ -11,5 +13,12 @@ module Sitepress
|
|
11
13
|
app.paths.add(concerns_path)
|
12
14
|
end
|
13
15
|
end
|
16
|
+
|
17
|
+
initializer "sitepress.configure" do |app|
|
18
|
+
Sitepress.configure do |config|
|
19
|
+
config.parent_engine = app
|
20
|
+
config.cache_resources = app.config.cache_classes
|
21
|
+
end
|
22
|
+
end
|
14
23
|
end
|
15
24
|
end
|
@@ -15,8 +15,10 @@ module Sitepress
|
|
15
15
|
# Set defaults.
|
16
16
|
def initialize
|
17
17
|
self.routes = true
|
18
|
-
|
19
|
-
|
18
|
+
end
|
19
|
+
|
20
|
+
def parent_engine
|
21
|
+
@parent_engine ||= Rails.application
|
20
22
|
end
|
21
23
|
|
22
24
|
def site
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module Sitepress
|
2
2
|
# Route constraint for rails routes.rb file.
|
3
3
|
class RouteConstraint
|
4
|
-
def initialize(
|
5
|
-
@
|
4
|
+
def initialize(site: Sitepress.site)
|
5
|
+
@site = site
|
6
6
|
end
|
7
7
|
|
8
8
|
def matches?(request)
|
9
|
-
!!@resources.get(request.path)
|
9
|
+
!!@site.resources.get(request.path)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -334,3 +334,59 @@ I, [2016-10-30T00:54:50.747688 #72487] INFO -- : Processing by Sitepress::SiteC
|
|
334
334
|
I, [2016-10-30T00:54:50.747736 #72487] INFO -- : Parameters: {"resource_path"=>"page-9999.html"}
|
335
335
|
I, [2016-10-30T00:54:57.255036 #72487] INFO -- : Rendered inline template within layouts/application (4906.7ms)
|
336
336
|
I, [2016-10-30T00:54:57.256676 #72487] INFO -- : Completed 200 OK in 6509ms (Views: 4908.3ms | ActiveRecord: 0.0ms)
|
337
|
+
I, [2016-11-04T14:26:01.023011 #33176] INFO -- : Started GET "/baseline/render" for 127.0.0.1 at 2016-11-04 14:26:01 -0700
|
338
|
+
I, [2016-11-04T14:26:01.037152 #33176] INFO -- : Processing by BaselineController#show as HTML
|
339
|
+
I, [2016-11-04T14:26:01.044659 #33176] INFO -- : Rendered baseline/show.html.erb within layouts/application (0.4ms)
|
340
|
+
I, [2016-11-04T14:26:01.051659 #33176] INFO -- : Completed 200 OK in 14ms (Views: 14.1ms | ActiveRecord: 0.0ms)
|
341
|
+
I, [2016-11-04T14:26:01.054928 #33176] INFO -- : Started GET "/page-1.html" for 127.0.0.1 at 2016-11-04 14:26:01 -0700
|
342
|
+
I, [2016-11-04T14:26:01.056223 #33176] INFO -- : Processing by Sitepress::SiteController#show as HTML
|
343
|
+
I, [2016-11-04T14:26:01.056265 #33176] INFO -- : Parameters: {"resource_path"=>"page-1.html"}
|
344
|
+
I, [2016-11-04T14:26:02.533755 #33176] INFO -- : Rendered inline template within layouts/application (1472.3ms)
|
345
|
+
I, [2016-11-04T14:26:02.536156 #33176] INFO -- : Completed 200 OK in 1480ms (Views: 1477.3ms | ActiveRecord: 0.0ms)
|
346
|
+
I, [2016-11-04T14:26:02.539657 #33176] INFO -- : Started GET "/page-9999.html" for 127.0.0.1 at 2016-11-04 14:26:02 -0700
|
347
|
+
I, [2016-11-04T14:26:02.540346 #33176] INFO -- : Processing by Sitepress::SiteController#show as HTML
|
348
|
+
I, [2016-11-04T14:26:02.540382 #33176] INFO -- : Parameters: {"resource_path"=>"page-9999.html"}
|
349
|
+
I, [2016-11-04T14:26:02.898415 #33176] INFO -- : Rendered inline template within layouts/application (357.1ms)
|
350
|
+
I, [2016-11-04T14:26:02.899834 #33176] INFO -- : Completed 200 OK in 359ms (Views: 359.0ms | ActiveRecord: 0.0ms)
|
351
|
+
I, [2016-11-04T14:26:03.123811 #33176] INFO -- : Started GET "/baseline/render" for 127.0.0.1 at 2016-11-04 14:26:03 -0700
|
352
|
+
I, [2016-11-04T14:26:03.124455 #33176] INFO -- : Processing by BaselineController#show as HTML
|
353
|
+
I, [2016-11-04T14:26:03.124832 #33176] INFO -- : Rendered baseline/show.html.erb within layouts/application (0.0ms)
|
354
|
+
I, [2016-11-04T14:26:03.125392 #33176] INFO -- : Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)
|
355
|
+
I, [2016-11-04T14:26:03.193300 #33176] INFO -- : Started GET "/page-1.html" for 127.0.0.1 at 2016-11-04 14:26:03 -0700
|
356
|
+
I, [2016-11-04T14:26:03.193796 #33176] INFO -- : Processing by Sitepress::SiteController#show as HTML
|
357
|
+
I, [2016-11-04T14:26:03.193828 #33176] INFO -- : Parameters: {"resource_path"=>"page-1.html"}
|
358
|
+
I, [2016-11-04T14:26:03.393249 #33176] INFO -- : Rendered inline template within layouts/application (199.0ms)
|
359
|
+
I, [2016-11-04T14:26:03.394013 #33176] INFO -- : Completed 200 OK in 200ms (Views: 199.9ms | ActiveRecord: 0.0ms)
|
360
|
+
I, [2016-11-04T14:26:03.473757 #33176] INFO -- : Started GET "/page-9999.html" for 127.0.0.1 at 2016-11-04 14:26:03 -0700
|
361
|
+
I, [2016-11-04T14:26:03.474371 #33176] INFO -- : Processing by Sitepress::SiteController#show as HTML
|
362
|
+
I, [2016-11-04T14:26:03.474409 #33176] INFO -- : Parameters: {"resource_path"=>"page-9999.html"}
|
363
|
+
I, [2016-11-04T14:26:03.670317 #33176] INFO -- : Rendered inline template within layouts/application (195.5ms)
|
364
|
+
I, [2016-11-04T14:26:03.671044 #33176] INFO -- : Completed 200 OK in 197ms (Views: 196.3ms | ActiveRecord: 0.0ms)
|
365
|
+
I, [2016-11-04T14:26:07.409683 #33176] INFO -- : Started GET "/baseline/render" for 127.0.0.1 at 2016-11-04 14:26:07 -0700
|
366
|
+
I, [2016-11-04T14:26:07.410324 #33176] INFO -- : Processing by BaselineController#show as HTML
|
367
|
+
I, [2016-11-04T14:26:07.410705 #33176] INFO -- : Rendered baseline/show.html.erb within layouts/application (0.1ms)
|
368
|
+
I, [2016-11-04T14:26:07.411154 #33176] INFO -- : Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)
|
369
|
+
I, [2016-11-04T14:26:07.412192 #33176] INFO -- : Started GET "/page-1.html" for 127.0.0.1 at 2016-11-04 14:26:07 -0700
|
370
|
+
I, [2016-11-04T14:26:09.775058 #33176] INFO -- : Processing by Sitepress::SiteController#show as HTML
|
371
|
+
I, [2016-11-04T14:26:09.775117 #33176] INFO -- : Parameters: {"resource_path"=>"page-1.html"}
|
372
|
+
I, [2016-11-04T14:26:19.754950 #33176] INFO -- : Rendered inline template within layouts/application (7510.0ms)
|
373
|
+
I, [2016-11-04T14:26:19.756618 #33176] INFO -- : Completed 200 OK in 9981ms (Views: 7511.8ms | ActiveRecord: 0.0ms)
|
374
|
+
I, [2016-11-04T14:26:19.760259 #33176] INFO -- : Started GET "/page-9999.html" for 127.0.0.1 at 2016-11-04 14:26:19 -0700
|
375
|
+
I, [2016-11-04T14:26:21.871391 #33176] INFO -- : Processing by Sitepress::SiteController#show as HTML
|
376
|
+
I, [2016-11-04T14:26:21.871463 #33176] INFO -- : Parameters: {"resource_path"=>"page-9999.html"}
|
377
|
+
I, [2016-11-04T14:26:31.559809 #33176] INFO -- : Rendered inline template within layouts/application (7949.0ms)
|
378
|
+
I, [2016-11-04T14:26:31.560950 #33176] INFO -- : Completed 200 OK in 9689ms (Views: 7950.3ms | ActiveRecord: 0.0ms)
|
379
|
+
I, [2016-11-04T14:26:36.741458 #33176] INFO -- : Started GET "/baseline/render" for 127.0.0.1 at 2016-11-04 14:26:36 -0700
|
380
|
+
I, [2016-11-04T14:26:36.742048 #33176] INFO -- : Processing by BaselineController#show as HTML
|
381
|
+
I, [2016-11-04T14:26:36.742402 #33176] INFO -- : Rendered baseline/show.html.erb within layouts/application (0.0ms)
|
382
|
+
I, [2016-11-04T14:26:36.742845 #33176] INFO -- : Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)
|
383
|
+
I, [2016-11-04T14:26:36.885105 #33176] INFO -- : Started GET "/page-1.html" for 127.0.0.1 at 2016-11-04 14:26:36 -0700
|
384
|
+
I, [2016-11-04T14:26:39.958111 #33176] INFO -- : Processing by Sitepress::SiteController#show as HTML
|
385
|
+
I, [2016-11-04T14:26:39.958187 #33176] INFO -- : Parameters: {"resource_path"=>"page-1.html"}
|
386
|
+
I, [2016-11-04T14:26:49.226907 #33176] INFO -- : Rendered inline template within layouts/application (7301.4ms)
|
387
|
+
I, [2016-11-04T14:26:49.227823 #33176] INFO -- : Completed 200 OK in 9270ms (Views: 7302.6ms | ActiveRecord: 0.0ms)
|
388
|
+
I, [2016-11-04T14:26:49.694364 #33176] INFO -- : Started GET "/page-9999.html" for 127.0.0.1 at 2016-11-04 14:26:49 -0700
|
389
|
+
I, [2016-11-04T14:26:51.740173 #33176] INFO -- : Processing by Sitepress::SiteController#show as HTML
|
390
|
+
I, [2016-11-04T14:26:51.740236 #33176] INFO -- : Parameters: {"resource_path"=>"page-9999.html"}
|
391
|
+
I, [2016-11-04T14:27:02.514913 #33176] INFO -- : Rendered inline template within layouts/application (8493.2ms)
|
392
|
+
I, [2016-11-04T14:27:02.515947 #33176] INFO -- : Completed 200 OK in 10776ms (Views: 8494.3ms | ActiveRecord: 0.0ms)
|