filesystem-explorer 0.0.4 → 0.0.5
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.
@@ -37,13 +37,13 @@ module FilesystemExplorer
|
|
37
37
|
private
|
38
38
|
|
39
39
|
def get_engine_configuration_options
|
40
|
-
|
40
|
+
FilesystemExplorer::Engine.filesystem_explorer_route_options.each do |path, options|
|
41
41
|
@route = options and break if request.path =~ %r(^#{path})
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
45
|
def get_engine_configuration_options_by_as(as)
|
46
|
-
|
46
|
+
FilesystemExplorer::Engine.filesystem_explorer_route_options.each do |path, options|
|
47
47
|
return options if options.as.to_sym == as.to_sym
|
48
48
|
end
|
49
49
|
|
@@ -1,14 +1,6 @@
|
|
1
1
|
module ActionDispatch
|
2
2
|
module Routing
|
3
3
|
class Mapper
|
4
|
-
def filesystem_explorer_route_options
|
5
|
-
if $filesystem_explorer_route_options.is_a?(Hash)
|
6
|
-
$filesystem_explorer_route_options.empty
|
7
|
-
else
|
8
|
-
$filesystem_explorer_route_options = {}
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
4
|
def filesystem_routes(&block)
|
13
5
|
config_file_path = Rails.root.join('config', 'filesystem_explorer.yml')
|
14
6
|
|
@@ -20,7 +12,7 @@ module ActionDispatch
|
|
20
12
|
end
|
21
13
|
end
|
22
14
|
|
23
|
-
block.call(filesystem_explorer_route_options || {}) if block
|
15
|
+
block.call(FilesystemExplorer::Engine.filesystem_explorer_route_options || {}) if block
|
24
16
|
end
|
25
17
|
|
26
18
|
def filesystem_explorer(options = {}, &block)
|
@@ -33,8 +25,7 @@ module ActionDispatch
|
|
33
25
|
|
34
26
|
route_config.instance_eval &block if block
|
35
27
|
|
36
|
-
filesystem_explorer_route_options ||=
|
37
|
-
filesystem_explorer_route_options[route_config.url] ||= route_config
|
28
|
+
FilesystemExplorer::Engine.filesystem_explorer_route_options[route_config.url] ||= route_config
|
38
29
|
|
39
30
|
FilesystemExplorer.routes << route_config
|
40
31
|
|