openstax_utilities 4.5.2 → 5.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a0f5f4c56fdba82e036469ad782df61b733f67e3061ea4c12416257d399e477
4
- data.tar.gz: 063645a0e123dc5e916f499a4ce3ecfa734a04a2092742e9bb5c200be52a55c7
3
+ metadata.gz: 7f13ad1defdb5604276e2eab9d0f23793a33908a214d5a61fbb2a22fad36cc1b
4
+ data.tar.gz: '089da22149096cb195614dc678b3afe1cf2ba442b26d892ae7018bf56bb98494'
5
5
  SHA512:
6
- metadata.gz: f698f5074753000c1a83989a6aa78238d00fb17291390c8f0abef3eb7112be2fa4edb72a068bdfade5cab9f56df401a8027bfff79b1b0af521557b8795e2682f
7
- data.tar.gz: c1aa9accccf3acad744e2090762f6c83af9c3e2cc0f0d8f2d0c30eb2b8277b40490740d741403c53a643b9666bfa24f0454a0a1b6a8a1d5dceef0e4ad7207f24
6
+ metadata.gz: 2343b8930eb4046e1caf6ebcddba02fec06f2bd765f060b5486f79b9a0cec064b4b15849a59a54ae4b8ff08c2a784039e7e8332ef3b9b63aad425a323dab5111
7
+ data.tar.gz: 0d1d416ff4b4eeb4d537193377c3f16438473924c5c997f28deefe0c8c7791abfe38b296249287d24a0907a7a2e2abd90598a4d13b089a0f1051f1bdf65a8e9a
@@ -7,7 +7,7 @@ class OpenStax::Utilities::StatusController < ActionController::Base
7
7
 
8
8
  def index
9
9
  @application_name = OSU::SITE_NAME.humanize
10
- @environment_name = Rails.application.secrets.environment_name
10
+ @environment_name = OpenStax::Utilities.configuration.environment_name
11
11
 
12
12
  @statuses = if @environment_name == 'development'
13
13
  [ [ 'local', 1, 1, :ok ] ]
@@ -56,7 +56,7 @@ module OpenStax
56
56
 
57
57
  fatal_error(offending_inputs: :per_page,
58
58
  message: 'Invalid page size',
59
- code: :invalid_per_page) if !per_page.nil? && per_page < 1
59
+ code: :invalid_per_page) if !per_page.nil? && per_page < 0
60
60
  fatal_error(offending_inputs: :page,
61
61
  message: 'Invalid page number',
62
62
  code: :invalid_page) if page < 1
@@ -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 %>): <%= Rails.application.secrets.release_version || 'not deployed' %>
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 (tutor-js): <%= OpenStax::Utilities::Assets.manifest.version || 'not deployed' %>
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 (tutor-deployment): <%=
30
- Rails.application.secrets.deployment_version || 'not deployed'
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('assets.json')
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
@@ -4,7 +4,7 @@ require_relative 'assets/manifest'
4
4
  module OpenStax::Utilities
5
5
  module Assets
6
6
  def self.url
7
- url = Rails.application.secrets.assets_url
7
+ url = OpenStax::Utilities.configuration.assets_url
8
8
  url.ends_with?('/') ? url : "#{url}/"
9
9
  end
10
10
 
@@ -1,5 +1,5 @@
1
1
  module OpenStax
2
2
  module Utilities
3
- VERSION = '4.5.2'
3
+ VERSION = '5.1.0'
4
4
  end
5
5
  end
@@ -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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstax_utilities
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.5.2
4
+ version: 5.1.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-02-02 00:00:00.000000000 Z
11
+ date: 2023-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -244,7 +244,7 @@ homepage: http://github.com/openstax/openstax_utilities
244
244
  licenses:
245
245
  - MIT
246
246
  metadata: {}
247
- post_install_message:
247
+ post_install_message:
248
248
  rdoc_options: []
249
249
  require_paths:
250
250
  - lib
@@ -259,8 +259,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
259
259
  - !ruby/object:Gem::Version
260
260
  version: '0'
261
261
  requirements: []
262
- rubygems_version: 3.2.7
263
- signing_key:
262
+ rubygems_version: 3.1.4
263
+ signing_key:
264
264
  specification_version: 4
265
265
  summary: Utilities for OpenStax web sites
266
266
  test_files: []