trusty-multi-site-extension 2.0.5 → 2.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 051525d2e6fb79b13a021a819ccd192bb9d1b975
4
- data.tar.gz: 5a1ad1f30229359ebdd7272001dc4c1816806377
3
+ metadata.gz: 8cc418f29b7ebc97289a7e27876e6128e567a9c4
4
+ data.tar.gz: 54329c1b4e9d59134c227fae36d075c93c4ccce5
5
5
  SHA512:
6
- metadata.gz: b79f839db9c3f701da91744368d5910337f065a2892f4b24dffa4e0fb5edb03785fdbd42addb329a0ec5bc9c5478acbdeba25de4e6f8bccdf32340ec8e416f46
7
- data.tar.gz: e9c6645e09223dbddc1955c549806b66264c131f83710e52abba90f966bfb029887fbea0ccd29329446aa1f81ed2331d081b1598306d9c5a8877b50ecc604b81
6
+ metadata.gz: 21ac25398cdefa494ecccf8ef6536c3a4ec32a5b824e457af2cf97ad9f6e7e210e910970a090c64a0dd519b7b56eb78cd6395aafb66ff7af0e73d3d84d6597ba
7
+ data.tar.gz: e5853a79398180f3d805e94e51e86da8877a9dc456276d10ad4434d5da1d021e4d7401bc654f34d528b813e09e792da86e52a005479caf36c897bf6d6b5de8e2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trusty-multi-site-extension (2.0.3)
4
+ trusty-multi-site-extension (2.0.6)
5
5
  acts_as_list (= 0.4.0)
6
6
  trusty-cms (~> 2.0.0)
7
7
  trusty-snippets-extension (~> 2.0.0)
@@ -47,7 +47,7 @@ GEM
47
47
  tzinfo (~> 1.1)
48
48
  acts_as_list (0.4.0)
49
49
  activerecord (>= 3.0)
50
- acts_as_tree (2.2.0)
50
+ acts_as_tree (2.4.0)
51
51
  activerecord (>= 3.0.0)
52
52
  addressable (2.3.8)
53
53
  arel (6.0.3)
@@ -94,7 +94,7 @@ GEM
94
94
  diff-lcs (1.2.5)
95
95
  erubis (2.7.0)
96
96
  eventmachine (1.0.8)
97
- execjs (2.5.2)
97
+ execjs (2.6.0)
98
98
  factory_girl (4.5.0)
99
99
  activesupport (>= 3.0.0)
100
100
  factory_girl_rails (4.5.0)
@@ -111,7 +111,7 @@ GEM
111
111
  haml (>= 4.0.6, < 5.0)
112
112
  html2haml (>= 1.0.1)
113
113
  railties (>= 4.0.1)
114
- highline (1.7.3)
114
+ highline (1.7.8)
115
115
  hike (1.2.3)
116
116
  html2haml (2.0.0)
117
117
  erubis (~> 2.7.0)
@@ -119,13 +119,13 @@ GEM
119
119
  nokogiri (~> 1.6.0)
120
120
  ruby_parser (~> 3.5)
121
121
  i18n (0.7.0)
122
- jquery-rails (3.1.3)
122
+ jquery-rails (3.1.4)
123
123
  railties (>= 3.0, < 5.0)
124
124
  thor (>= 0.14, < 2.0)
125
125
  json (1.8.3)
126
126
  launchy (2.4.3)
127
127
  addressable (~> 2.3)
128
- libv8 (3.16.14.11)
128
+ libv8 (3.16.14.13)
129
129
  loofah (2.0.2)
130
130
  nokogiri (>= 1.5.9)
131
131
  mail (2.6.3)
@@ -135,7 +135,7 @@ GEM
135
135
  mini_portile (0.6.2)
136
136
  minitest (5.8.0)
137
137
  multi_json (1.11.2)
138
- mysql (2.9.1)
138
+ mysql2 (0.4.2)
139
139
  nokogiri (1.6.6.2)
140
140
  mini_portile (~> 0.6.0)
141
141
  orm_adapter (0.5.0)
@@ -154,7 +154,7 @@ GEM
154
154
  byebug (~> 5.0)
155
155
  pry (~> 0.10)
156
156
  rack (1.6.4)
157
- rack-cache (1.2)
157
+ rack-cache (1.6.0)
158
158
  rack (>= 0.4)
159
159
  rack-test (0.6.3)
160
160
  rack (>= 1.0)
@@ -208,7 +208,7 @@ GEM
208
208
  rspec-mocks (~> 3.0.0)
209
209
  rspec-support (~> 3.0.0)
210
210
  rspec-support (3.0.4)
211
- ruby_parser (3.7.1)
211
+ ruby_parser (3.7.3)
212
212
  sexp_processor (~> 4.1)
213
213
  sass (3.4.16)
214
214
  sass-rails (5.0.1)
@@ -217,7 +217,7 @@ GEM
217
217
  sprockets (>= 2.8, < 4.0)
218
218
  sprockets-rails (>= 2.0, < 4.0)
219
219
  tilt (~> 1.1)
220
- sexp_processor (4.6.0)
220
+ sexp_processor (4.6.1)
221
221
  slop (3.6.0)
222
222
  sprockets (2.12.4)
223
223
  hike (~> 1.2)
@@ -239,7 +239,7 @@ GEM
239
239
  thor (0.19.1)
240
240
  thread_safe (0.3.5)
241
241
  tilt (1.4.1)
242
- trusty-cms (2.0.11)
242
+ trusty-cms (2.0.13)
243
243
  RedCloth (~> 4.2)
244
244
  acts_as_tree (~> 2.1)
245
245
  bundler (~> 1.7)
@@ -251,7 +251,7 @@ GEM
251
251
  haml-rails (~> 0.5)
252
252
  highline (~> 1.6)
253
253
  jquery-rails (~> 3.1)
254
- mysql (~> 2.9)
254
+ mysql2 (~> 0.4.2)
255
255
  protected_attributes (~> 1.0.9)
256
256
  rack (~> 1.4)
257
257
  rack-cache (~> 1.2)
@@ -263,19 +263,19 @@ GEM
263
263
  tzinfo (~> 1.2)
264
264
  uglifier (~> 2.6)
265
265
  will_paginate (~> 3.0)
266
- trusty-snippets-extension (2.0.3)
267
- trusty-cms (~> 2.0.0.pre.beta)
266
+ trusty-snippets-extension (2.0.5)
267
+ trusty-cms (~> 2.0.0)
268
268
  trustygems (0.2.1)
269
269
  rake
270
270
  tzinfo (1.2.2)
271
271
  thread_safe (~> 0.1)
272
- uglifier (2.7.1)
272
+ uglifier (2.7.2)
273
273
  execjs (>= 0.3.0)
274
274
  json (>= 1.8.0)
275
275
  websocket-driver (0.6.2)
276
276
  websocket-extensions (>= 0.1.0)
277
277
  websocket-extensions (0.1.2)
278
- will_paginate (3.0.7)
278
+ will_paginate (3.1.0)
279
279
  xpath (2.0.0)
280
280
  nokogiri (~> 1.3)
281
281
 
@@ -298,3 +298,6 @@ DEPENDENCIES
298
298
  thin (~> 1.6.2)
299
299
  trusty-multi-site-extension!
300
300
  trustygems (~> 0.2.0)
301
+
302
+ BUNDLED WITH
303
+ 1.10.6
@@ -16,7 +16,16 @@ module MultiSite::PageExtensions
16
16
  root = homepage
17
17
  raise Page::MissingRootPageError unless root
18
18
  path = root.path if clean_path(path) == "/"
19
- root.find_by_path(path, live)
19
+ result = root.find_by_path(path, live)
20
+
21
+ # If the result is a FileNotFoundPage that doesn't match the current
22
+ # site, try to find one that does.
23
+ if result.is_a?(FileNotFoundPage) && result.site_id != homepage.site_id
24
+ get_site_specific_file_not_found(result)
25
+ else
26
+ result
27
+ end
28
+
20
29
  end
21
30
  def current_site
22
31
  @current_site ||= Site.default
@@ -27,6 +36,14 @@ module MultiSite::PageExtensions
27
36
  def clean_path(path)
28
37
  "/#{ path.to_s.strip }/".gsub(%r{//+}, '/')
29
38
  end
39
+
40
+ # if the result is a FileNotFoundPage, try to find the one for this site.
41
+ # if you can't, return the initial result
42
+ def get_site_specific_file_not_found(result)
43
+ site_file_not_founds = FileNotFoundPage.where(site_id: homepage.site_id)
44
+ site_file_not_founds.any? ? site_file_not_founds.first : result
45
+ end
46
+
30
47
  end
31
48
  end
32
49
 
@@ -1,7 +1,7 @@
1
1
  require_dependency 'application_controller'
2
2
 
3
3
  class MultiSiteExtension < TrustyCms::Extension
4
- version "1.0.0"
4
+ version "2.0.6"
5
5
  description %{ Enables virtual sites to be created with associated domain names.
6
6
  Also scopes the sitemap view to any given page (or the root of an
7
7
  individual site) and allows model classes to be scoped by site. }
@@ -12,7 +12,7 @@ class MultiSiteExtension < TrustyCms::Extension
12
12
  # ActionController::Routing modules are required rather than sent as includes
13
13
  # because the routing persists between dev. requests and is not compatible
14
14
  # with multiple alias_method_chain calls.
15
-
15
+
16
16
  # likewise for ScopedValidation, which is a pre-emptive hack that shouldn't run more than once.
17
17
 
18
18
 
@@ -49,7 +49,7 @@ class MultiSiteExtension < TrustyCms::Extension
49
49
  TrustyCms::AdminUI.send :include, MultiSite::AdminUI
50
50
  admin.site = TrustyCms::AdminUI.load_default_site_regions
51
51
  end
52
-
52
+
53
53
  if respond_to?(:tab)
54
54
  tab("Settings") do
55
55
  add_item "Sites", "/admin/sites", :after => "Extensions", :visibility => [:admin]
@@ -4,7 +4,7 @@ require "trusty-multi-site-extension"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "trusty-multi-site-extension"
7
- s.version = "2.0.5"
7
+ s.version = "2.0.6"
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.authors = ["Sean Cribbs", "Eric Sipple", "Danielle Greaves"]
10
10
  s.description = %q{Extends Trusty CMS Layouts to support multiple sites, defined by domain}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trusty-multi-site-extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Cribbs
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-12-23 00:00:00.000000000 Z
13
+ date: 2016-02-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: acts_as_list