openstax_utilities 4.4.2 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/openstax/utilities/status_controller.rb +4 -3
- data/app/views/layouts/openstax/utilities/status.html.erb +2 -0
- data/app/views/openstax/utilities/status/index.html.erb +10 -6
- data/lib/openstax/utilities/assets/manifest.rb +3 -1
- data/lib/openstax/utilities/assets.rb +1 -1
- data/lib/openstax/utilities/engine.rb +5 -1
- data/lib/openstax/utilities/version.rb +1 -1
- data/lib/openstax_utilities.rb +10 -4
- metadata +15 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f669c295f76fbae48ac64196c9e7f2766de0117bf6c782bf3d7b756d504d7202
|
4
|
+
data.tar.gz: d2848098c86245d8dbf392ea5baebddb45308d56d89795fd9b66f22461edd426
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e1fd6032f2d551ff8a3892dca07b9e21526c0b4ea17099fd4feb46ad600da894da92beded99fa4f2047091cdef63ab1b7d5012a20318a9877fd6f58f1b387f6
|
7
|
+
data.tar.gz: bfe7a0eb33ee4b661300d3b9e65a5f45642dd6ecb39b9a7d22c06d5d0e49b45470f6dda9583442eaf79fd6f4180f494ef3320765bfbc6cfcd95964d16b29c0db
|
@@ -6,13 +6,14 @@ class OpenStax::Utilities::StatusController < ActionController::Base
|
|
6
6
|
layout 'openstax/utilities/status'
|
7
7
|
|
8
8
|
def index
|
9
|
-
@application_name =
|
10
|
-
@environment_name =
|
9
|
+
@application_name = OSU::SITE_NAME.humanize
|
10
|
+
@environment_name = OpenStax::Utilities.configuration.environment_name
|
11
11
|
|
12
12
|
@statuses = if @environment_name == 'development'
|
13
13
|
[ [ 'local', 1, 1, :ok ] ]
|
14
14
|
else
|
15
|
-
queues =
|
15
|
+
queues = Module.const_defined?(:Delayed) && Delayed.const_defined?(:Worker) ?
|
16
|
+
Delayed::Worker.queue_attributes.keys.map(&:to_s) - [ 'migration' ] : []
|
16
17
|
asgs = [ 'migration', 'web', 'cron', 'background' ] + queues.map do |queue|
|
17
18
|
"background-#{queue}"
|
18
19
|
end
|
@@ -10,6 +10,8 @@
|
|
10
10
|
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
|
11
11
|
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
12
12
|
<%= csrf_meta_tags %>
|
13
|
+
|
14
|
+
<style>body { background: none; }</style>
|
13
15
|
</head>
|
14
16
|
|
15
17
|
<body id="status" class="status">
|
@@ -12,22 +12,26 @@
|
|
12
12
|
offline: '🔌',
|
13
13
|
sleeping: '💤'
|
14
14
|
}
|
15
|
-
|
16
|
-
backend = @application_name == 'Tutor' ? 'tutor-server' : @application_name.downcase
|
17
15
|
%>
|
18
16
|
|
19
17
|
<h3>Versions</h3>
|
20
18
|
|
21
19
|
<ul>
|
22
20
|
<li>
|
23
|
-
Backend (<%= backend %>): <%=
|
21
|
+
Backend (<%= OpenStax::Utilities.configuration.backend %>): <%=
|
22
|
+
OpenStax::Utilities.configuration.release_version || 'not deployed'
|
23
|
+
%>
|
24
24
|
</li>
|
25
|
+
<% unless OpenStax::Utilities.configuration.assets_url.blank? %>
|
25
26
|
<li>
|
26
|
-
Frontend (
|
27
|
+
Frontend (<%= OpenStax::Utilities.configuration.frontend %>): <%=
|
28
|
+
OpenStax::Utilities::Assets.manifest.version || 'not deployed'
|
29
|
+
%>
|
27
30
|
</li>
|
31
|
+
<% end %>
|
28
32
|
<li>
|
29
|
-
Deployment (
|
30
|
-
|
33
|
+
Deployment (<%= OpenStax::Utilities.configuration.deployment %>): <%=
|
34
|
+
OpenStax::Utilities.configuration.deployment_version || 'not deployed'
|
31
35
|
%>
|
32
36
|
</li>
|
33
37
|
</ul>
|
@@ -10,7 +10,9 @@ module OpenStax::Utilities
|
|
10
10
|
def initialize
|
11
11
|
@assets = HashWithIndifferentAccess.new
|
12
12
|
|
13
|
-
url = OpenStax::Utilities::Assets.url_for(
|
13
|
+
url = OpenStax::Utilities::Assets.url_for(
|
14
|
+
OpenStax::Utilities.configuration.assets_manifest_filename
|
15
|
+
)
|
14
16
|
|
15
17
|
begin
|
16
18
|
response = self.class.client.get url
|
@@ -11,7 +11,11 @@ module OpenStax
|
|
11
11
|
isolate_namespace OpenStax::Utilities
|
12
12
|
|
13
13
|
config.after_initialize do
|
14
|
-
|
14
|
+
if Rails::VERSION::MAJOR == 6
|
15
|
+
OSU::SITE_NAME = ::Rails.application.class.module_parent_name.underscore
|
16
|
+
else
|
17
|
+
OSU::SITE_NAME = ::Rails.application.class.parent_name.underscore
|
18
|
+
end
|
15
19
|
end
|
16
20
|
|
17
21
|
config.generators do |g|
|
data/lib/openstax_utilities.rb
CHANGED
@@ -23,7 +23,6 @@ require "openstax/utilities/assets"
|
|
23
23
|
|
24
24
|
module OpenStax
|
25
25
|
module Utilities
|
26
|
-
|
27
26
|
# ASSET_FILES = %w(openstax_utilities.css openstax_utilities.js)
|
28
27
|
|
29
28
|
# ActiveSupport.on_load(:before_initialize) do
|
@@ -31,7 +30,6 @@ module OpenStax
|
|
31
30
|
# end
|
32
31
|
|
33
32
|
class << self
|
34
|
-
|
35
33
|
###########################################################################
|
36
34
|
#
|
37
35
|
# Configuration machinery.
|
@@ -58,17 +56,25 @@ module OpenStax
|
|
58
56
|
attr_accessor :standard_datetime_format
|
59
57
|
attr_accessor :standard_time_format
|
60
58
|
attr_accessor :status_authenticate
|
59
|
+
attr_accessor :environment_name
|
60
|
+
attr_accessor :backend
|
61
|
+
attr_accessor :release_version
|
62
|
+
attr_accessor :frontend
|
63
|
+
attr_accessor :assets_url
|
64
|
+
attr_accessor :assets_manifest_filename
|
65
|
+
attr_accessor :deployment
|
66
|
+
attr_accessor :deployment_version
|
61
67
|
|
62
68
|
def initialize
|
63
69
|
@standard_date_format = "%b %d, %Y"
|
64
70
|
@standard_datetime_format = "%b %d, %Y %l:%M %p %Z"
|
65
71
|
@standard_time_format = "%l:%M %p %Z"
|
66
72
|
@status_authenticate = -> { head :forbidden }
|
73
|
+
@environment_name = 'development'
|
74
|
+
@assets_manifest_filename = 'assets.json'
|
67
75
|
super
|
68
76
|
end
|
69
77
|
end
|
70
|
-
|
71
78
|
end
|
72
|
-
|
73
79
|
end
|
74
80
|
end
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openstax_utilities
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JP Slavinsky
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5.0'
|
20
|
+
- - "<"
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
22
|
+
version: '7.0'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '5.0'
|
30
|
+
- - "<"
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
32
|
+
version: '7.0'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: lev
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -238,7 +244,7 @@ homepage: http://github.com/openstax/openstax_utilities
|
|
238
244
|
licenses:
|
239
245
|
- MIT
|
240
246
|
metadata: {}
|
241
|
-
post_install_message:
|
247
|
+
post_install_message:
|
242
248
|
rdoc_options: []
|
243
249
|
require_paths:
|
244
250
|
- lib
|
@@ -254,7 +260,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
254
260
|
version: '0'
|
255
261
|
requirements: []
|
256
262
|
rubygems_version: 3.1.4
|
257
|
-
signing_key:
|
263
|
+
signing_key:
|
258
264
|
specification_version: 4
|
259
265
|
summary: Utilities for OpenStax web sites
|
260
266
|
test_files: []
|