model_driven_api 3.11.1 → 3.11.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b61b86707e2570cba451926c97e8f3859aab908d3cafeeeb4a3ef1a1688319db
4
- data.tar.gz: 05d89a0b5675947a69579aeab316fc320de7e061c648d13882148c1c471c462f
3
+ metadata.gz: f10db84ebc3b2fbb5b3461fcaa14c879096999fcdef4c90353172ac8313af7eb
4
+ data.tar.gz: ca43a58797580f249f6b48c80f3be07b607731a6a1973d04dc6d9af64adc654c
5
5
  SHA512:
6
- metadata.gz: 266a7903c7736fa65577d7e7f33466a965882af174619b957755eca5ca8901c920429a3c39daf48f1689450d40177a71a4db9c413eb4442210abae2c4ec3f6ec
7
- data.tar.gz: 37139ea1c430213aa4e8bdd43b9d770f7e08bd7d1df4bd898dd561a3112f550d9ded0b411f38ab4bd982af5716a0b0963042aca2c7a782d25b59fa7f459dc850
6
+ metadata.gz: 39ca452f1c60589d6406de607425ce798a84882a366aa42ad648a8dc6b16e05e9535d6db18a8ea578b623ba6fcf1ec2a9c241a667369dd0fc03f505acad1a96f
7
+ data.tar.gz: 1c2dfe78a0c08f66eaf09bc6550213a988c42295549f0e7ffb23a66d13bea8a134ce52fb06dc60e65e67cca91f3dbe818929ffd5743bbc2cb460318e2551b982
@@ -6,7 +6,7 @@ class Api::V2::InfoController < Api::V2::ApplicationController
6
6
 
7
7
  # api :GET, '/api/v2/info/version', "Just prints the APPVERSION."
8
8
  def version
9
- render json: { version: "TODO: Find a Way to Dynamically Obtain It" }.to_json, status: 200
9
+ render json: { version: ModelDrivenApi.app_version }.to_json, status: 200
10
10
  end
11
11
 
12
12
  # api :GET, '/api/v2/info/roles'
@@ -9,7 +9,6 @@ module ApiExceptionManagement
9
9
  # AccessDenied (wrong login credentials), RecordNotFound, RecordInvalid, CanCan
10
10
  # denial... answered 500. Covered by spec/lib/concerns/api_exception_management_spec.rb.
11
11
  rescue_from StandardError, with: :fivehundred!
12
- rescue_from NoMethodError, with: :not_found!
13
12
  rescue_from CanCan::AccessDenied, with: :unauthorized!
14
13
  rescue_from AuthenticateUser::AccessDenied, with: :unauthenticated!
15
14
  rescue_from ActionController::RoutingError, with: :not_found!
@@ -1,3 +1,3 @@
1
1
  module ModelDrivenApi
2
- VERSION = "3.11.1".freeze
2
+ VERSION = "3.11.2".freeze
3
3
  end
@@ -28,6 +28,14 @@ require "api/v3/serializer_factory"
28
28
  module ModelDrivenApi
29
29
  UTC_ZONE_NAMES = %w[UTC Etc/UTC].freeze
30
30
 
31
+ # The host app's deployed version: the `version` file in its root (Thecore release convention —
32
+ # CI builds and deploys when it changes; the image is `ADD . /app`, so it ships in Rails.root).
33
+ # nil when the app has no such file. Served by GET /api/v2|v3/info/version.
34
+ def self.app_version
35
+ file = Rails.root.join("version")
36
+ file.file? ? file.read.strip.presence : nil
37
+ end
38
+
31
39
  # Raises unless the app is UTC-only: +time_zone+ is config.time_zone, +db_zone+ is
32
40
  # config.active_record.default_timezone (nil = Rails' default, :utc). Called at boot by
33
41
  # ModelDrivenApi::Engine's :enforce_utc_time_zone initializer.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: model_driven_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.11.1
4
+ version: 3.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni