micro_api 0.1.3 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0e3bde703f8a782da96ab2ad0e30fc6e0bc0dcd7d003483978bf68d14fe3a2c
|
4
|
+
data.tar.gz: da112e0bcb5c9a69e8e8fcce8b2eb044bac4f89aedf1253102ea45245121e4e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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: {
|
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
|
data/lib/micro_api/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2024-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec-rails
|