mascot-rails 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mascot/action_controller_context.rb +1 -1
- data/lib/mascot/extensions/index_request_path.rb +7 -5
- data/lib/mascot/extensions/partials_remover.rb +1 -1
- data/lib/mascot/extensions/rails_request_paths.rb +4 -1
- data/spec/dummy/log/production.log +1341 -0
- data/spec/dummy/log/test.log +4158 -0
- data/spec/mascot/action_controller_context_spec.rb +1 -1
- data/spec/mascot/extensions/index_request_path_spec.rb +3 -3
- data/spec/mascot/rails_configuration_spec.rb +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af6e9c3364ea71baba94e6f5ef9bb1da5f6b9f1a
|
4
|
+
data.tar.gz: 2005e26040c90e08b059b47badb31892f9cd13d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af3841f8d9b0e042e6ef4504fd4032e144ae40473caff36b0265db9ddbc05f8b4b6edc571c5c4055cdfe533ea16a7a7db149691b03d1c1459548e1166fc6c412
|
7
|
+
data.tar.gz: df370017cb3d2f457720c3a7126eeef85515d066278e6cb05b7bb1685dca3ceb3adb1850da4504e6f710c3c6fbb36bb9fb126e2cfefb9ffeecb92e6a22758707
|
@@ -29,7 +29,7 @@ module Mascot
|
|
29
29
|
# Mascot::PageNotFoundError is handled in the default Mascot::SiteController
|
30
30
|
# with an execption that Rails can use to display a 404 error.
|
31
31
|
def get(path)
|
32
|
-
resource = resources.
|
32
|
+
resource = resources.get_resource(path)
|
33
33
|
if resource.nil?
|
34
34
|
# TODO: Display error in context of Reources class root.
|
35
35
|
raise Mascot::PageNotFoundError, "No such page: #{path}"
|
@@ -9,11 +9,13 @@ module Mascot
|
|
9
9
|
@file_name = file_name
|
10
10
|
end
|
11
11
|
|
12
|
-
def process_resources(
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
def process_resources(node)
|
13
|
+
node.each do |r|
|
14
|
+
asset = r.asset
|
15
|
+
if asset.path.basename.to_s.start_with? @file_name
|
16
|
+
request_path = Pathname.new("/").join(r.request_path).dirname.cleanpath.to_s
|
17
|
+
node.remove_resource(r)
|
18
|
+
node.add(path: request_path, asset: asset)
|
17
19
|
end
|
18
20
|
end
|
19
21
|
end
|
@@ -7,7 +7,7 @@ module Mascot
|
|
7
7
|
|
8
8
|
def process_resources(resources)
|
9
9
|
resources.each do |r|
|
10
|
-
|
10
|
+
r.node.remove if self.class.partial? r.asset.path # Looks like a smiley face, doesn't it?
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
@@ -5,7 +5,10 @@ module Mascot
|
|
5
5
|
class RailsRequestPaths
|
6
6
|
def process_resources(resources)
|
7
7
|
resources.each do |r|
|
8
|
-
|
8
|
+
asset = r.asset
|
9
|
+
request_path = r.request_path
|
10
|
+
r.node.remove
|
11
|
+
resources.add path: self.class.format_path(request_path), asset: asset
|
9
12
|
end
|
10
13
|
end
|
11
14
|
|