forest_admin_rails 1.11.2 → 1.11.3
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.
- checksums.yaml +4 -4
- data/lib/forest_admin_rails/engine.rb +14 -1
- data/lib/forest_admin_rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 794baa61d7f50615c03c5c0778a4951598ea94fc6b952de518ee12ff7aa23444
|
|
4
|
+
data.tar.gz: 8633b3f585ee7634226eb9d284b92a6b751bc51331b88b10cb244cc93a6d0efb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3e23b9d315b9214d8be0c1200b0860b69a84ecfcaff67b9ba714168b041f6b2807ba324ab06db0e9420efa151c4861fab4b027732b2099cb86972167886c81ef
|
|
7
|
+
data.tar.gz: 3400939489cc713ba0a7e97b21b3bb2a2020278b15f7318be1bcbb2bd0a07b266f4fa4f185c5783404e26e8fe236b52c4ef350d949d5bf64b809d63583e63cc2
|
|
@@ -38,7 +38,7 @@ module ForestAdminRails
|
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def load_configuration
|
|
41
|
-
return unless
|
|
41
|
+
return unless running_web_server?
|
|
42
42
|
return unless File.exist?(Rails.root.join('app', 'lib', 'forest_admin_rails', 'create_agent.rb'))
|
|
43
43
|
|
|
44
44
|
# force eager loading models
|
|
@@ -56,6 +56,19 @@ module ForestAdminRails
|
|
|
56
56
|
sse.run if ForestAdminRails.config[:instant_cache_refresh]
|
|
57
57
|
end
|
|
58
58
|
|
|
59
|
+
def running_web_server?
|
|
60
|
+
return true if defined?(::Rails::Server)
|
|
61
|
+
|
|
62
|
+
# check if a web server is running with the given command line arguments
|
|
63
|
+
server_commands = %w[puma unicorn thin passenger rackup]
|
|
64
|
+
return true if server_commands.any? { |cmd| ARGV.any? { |arg| arg.include?(cmd) } }
|
|
65
|
+
|
|
66
|
+
# check if running via common server executables
|
|
67
|
+
return true if $PROGRAM_NAME.match?(/puma|unicorn|thin|passenger/)
|
|
68
|
+
|
|
69
|
+
false
|
|
70
|
+
end
|
|
71
|
+
|
|
59
72
|
def load_cors
|
|
60
73
|
config.middleware.insert_before 0, Rack::Cors do
|
|
61
74
|
allow do
|