micro_api 0.1.3 → 0.1.5

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: 99a6cfc6d82c9d35036f0b7fffb1a7076ad78593e731ee1a025e68fcb60d82dd
4
- data.tar.gz: 41a25e79645d7f6bb5b9f3135bbb0436ab96ac15f2492512d47c4b6b7ecd9aca
3
+ metadata.gz: d0e3bde703f8a782da96ab2ad0e30fc6e0bc0dcd7d003483978bf68d14fe3a2c
4
+ data.tar.gz: da112e0bcb5c9a69e8e8fcce8b2eb044bac4f89aedf1253102ea45245121e4e7
5
5
  SHA512:
6
- metadata.gz: 9d7f1a612213b649bbe000fef4878674733fa2834406d3151e64b0d8fc25d2575166832a6db26e435b6d1be1fa4ce78e23e82373e73da1d429ec28ca392dee5d
7
- data.tar.gz: 917ab03be4c3901914ab3c1c21c339fa09eae405889891f7209fe0f70e965782f08fbfeecef2d5012baa76e8451b5153aaa3a9aff982f89afcbc2aa8f18b0995
6
+ metadata.gz: e00368add9fd6a64873807fef6b306376df684774e8fc7cc72f255114416ac34c3180001fae647f33361b301f44983a56402001f90730cd52032f0aafc3cf666
7
+ data.tar.gz: 82713af196ee221570b924bcf751e924fe3e76c1434773928bb4a6e7610e5db16a8ef95d16ba6e0014bdd2bbd76aaabdfd44fbb267c7251b460607bd8f7a0018
data/README.md CHANGED
@@ -36,6 +36,19 @@ Or install it yourself as:
36
36
  $ gem install micro_api
37
37
  ```
38
38
 
39
+ ## Implementation
40
+
41
+ ### testing
42
+ ```bash
43
+ docker run -ti --rm -v $(pwd):/app --workdir="/app" ruby:alpine sh
44
+ apk add --update build-base libxml2-dev libxslt-dev git postgresql-dev postgresql-client
45
+ bundle install
46
+ gem update --system
47
+ bundle exec rspec
48
+ bundle exec rubocop
49
+ bundle exec rubocop -A
50
+ ```
51
+
39
52
  ## Contributing
40
53
  Contribution directions go here.
41
54
 
@@ -1,7 +1,10 @@
1
1
  module MicroApi
2
2
  class StaticController < ApplicationController
3
3
  def healthz
4
- render json: { status: :ok }
4
+ render json: {
5
+ db: active_record_check,
6
+ status: :ok
7
+ }
5
8
  end
6
9
 
7
10
  def version
@@ -26,5 +29,15 @@ module MicroApi
26
29
  rescue StandardError
27
30
  nil
28
31
  end
32
+
33
+ def active_record_check
34
+ return { status: :nd } unless defined?(ActiveRecord)
35
+
36
+ ActiveRecord::Base.establish_connection # Establishes connection
37
+ ActiveRecord::Base.connection # Calls connection object
38
+ { status: ActiveRecord::Base.connected? ? :connected : :not_connected }
39
+ rescue StandardError
40
+ { status: :exception }
41
+ end
29
42
  end
30
43
  end
@@ -1,5 +1,5 @@
1
1
  require 'micro_api'
2
2
 
3
3
  MicroApi.setup do |config|
4
- config.routes_path = "/mse"
4
+ config.routes_path = '/mse'
5
5
  end
@@ -1,3 +1,3 @@
1
1
  module MicroApi
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: micro_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-17 00:00:00.000000000 Z
11
+ date: 2024-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-rails