erp_app 3.0.1 → 3.0.2
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/erp_app/application_resource_loader/desktop_organizer_loader.rb +35 -32
- data/lib/erp_app/version.rb +1 -1
- metadata +3259 -3259
@@ -17,52 +17,55 @@ module ErpApp
|
|
17
17
|
private
|
18
18
|
|
19
19
|
def locate_resource_files(resource_type)
|
20
|
-
|
20
|
+
engine_dirs = Rails::Application::Railties.engines.map{|p| p.config.root.to_s}
|
21
21
|
root_and_engines_dirs = ([Rails.root] | engine_dirs)
|
22
22
|
|
23
23
|
application_files = []
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
24
|
+
root_and_engines_dirs.each do |engine_dir|
|
25
|
+
#get all files based on resource type we are loading for the given application type and application
|
26
|
+
if File.exists? File.join(engine_dir,"public/#{resource_type}/erp_app/#{@app_type}/applications",@app_name)
|
27
|
+
application_path = File.join(engine_dir,"public/#{resource_type}/erp_app/#{@app_type}/applications",@app_name)
|
28
|
+
search_path = File.join(application_path,"**/*.#{(resource_type == 'javascripts') ? 'js' : 'css'}")
|
29
|
+
application_files = application_files | Dir.glob(search_path).collect{|path| path.gsub(application_path,'')}
|
30
|
+
end
|
31
|
+
end
|
32
|
+
application_files = sort_files(application_files)
|
32
33
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
application_files.map!{|file| "erp_app/#{@app_type}/applications/#{@app_name}
|
34
|
+
#make sure the base js file is loaded before all others
|
35
|
+
if resource_type == 'javascripts' && (application_files.index{|x| x =~ /module.js/} || application_files.index{|x| x =~ /base.js/})
|
36
|
+
index = (@app_type == 'desktop') ? application_files.index{|x| x =~ /module.js/} : application_files.index{|x| x =~ /base.js/}
|
37
|
+
first_load_js = application_files[index]
|
38
|
+
application_files.delete_at(index)
|
39
|
+
application_files.push(first_load_js)
|
40
|
+
application_files.reverse!
|
41
|
+
end
|
42
|
+
application_files.map!{|file| File.join("erp_app/#{@app_type}/applications/#{@app_name}",file)}
|
42
43
|
|
43
44
|
#get any extensions from other engines
|
44
45
|
engine_extension_files = []
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
engine_extension_files.
|
46
|
+
engine_dirs.each do |engine_dir|
|
47
|
+
#get all files based on resource type we are loading for the given application type and application
|
48
|
+
if File.exists? File.join(engine_dir,"public/#{resource_type}/extensions/compass_ae/erp_app/#{@app_type}/applications",@app_name)
|
49
|
+
application_path = File.join(engine_dir,"public/#{resource_type}/extensions/compass_ae/erp_app/#{@app_type}/applications",@app_name)
|
50
|
+
search_path = File.join(application_path,"**/*.#{(resource_type == 'javascripts') ? 'js' : 'css'}")
|
51
|
+
engine_extension_files = engine_extension_files | Dir.glob(search_path).collect{|path| path.gsub(application_path,'')}
|
52
|
+
end
|
53
|
+
end
|
54
|
+
engine_extension_files = sort_files(engine_extension_files.collect{|file| File.basename(file)})
|
55
|
+
engine_extension_files.map!{|file| File.join("extensions/compass_ae/erp_app/#{@app_type}/applications/#{@app_name}",file)}
|
54
56
|
|
55
57
|
#get any extension from root rails app
|
56
58
|
root_extension_files = []
|
57
59
|
if File.exists? File.join(Rails.root,"public/#{resource_type}/extensions/compass_ae/erp_app", @app_type, 'applications', @app_name)
|
58
|
-
application_path = File.join(Rails.root,"public/#{resource_type}/extensions/compass_ae/erp_app", @app_type, 'applications', @app_name
|
59
|
-
|
60
|
+
application_path = File.join(Rails.root,"public/#{resource_type}/extensions/compass_ae/erp_app", @app_type, 'applications', @app_name)
|
61
|
+
search_path = File.join(application_path,"**/*.#{(resource_type == 'javascripts') ? 'js' : 'css'}")
|
62
|
+
root_extension_files = root_extension_files | Dir.glob(search_path).collect{|path| path.gsub(application_path,'')}
|
60
63
|
end
|
61
64
|
root_extension_files = sort_files(root_extension_files.collect{|file| File.basename(file)})
|
62
|
-
root_extension_files.map!{|file| "extensions/compass_ae/erp_app/#{@app_type}/applications/#{@app_name}
|
65
|
+
root_extension_files.map!{|file| File.join("extensions/compass_ae/erp_app/#{@app_type}/applications/#{@app_name}",file)}
|
63
66
|
|
64
|
-
|
65
|
-
|
67
|
+
(application_files + engine_extension_files + root_extension_files)
|
68
|
+
end
|
66
69
|
|
67
70
|
end#DesktopOrganizerLoader
|
68
71
|
end#ApplicationResourceLoader
|