healthier 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +22 -10
- data/lib/generators/healthier/config_generator.rb +31 -0
- data/lib/healthier/engine.rb +1 -5
- data/lib/healthier/version.rb +1 -1
- data/lib/healthier.rb +6 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 711f2ef8a3f208c3e4a4cc710fc86f73ff049a1734e0726caca32ef2d3c597f0
|
4
|
+
data.tar.gz: ceb81192506fb5d7132840da224ac48bdb6f31d216dc2867da3d2afca0bd5576
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c2b4a07809bdb88f6bd292ba9b284c5b6612ca525c0929341d4757aa01a6b98a56c3c0e60a160859e8e1b93d7c41cf13dfe9f1946997ec038b15d46b3516b8f
|
7
|
+
data.tar.gz: 8b260ec426e1544f745843ede0eaa38719aa08dd75636aa6a839a65412b7308d8bc2f0a90eba950779b76571d6b8117b9cb73de389861f24f6307fe335cc4731
|
data/README.md
CHANGED
@@ -26,23 +26,35 @@ Or install it yourself as:
|
|
26
26
|
$ gem install healthier
|
27
27
|
```
|
28
28
|
|
29
|
-
|
29
|
+
# Installer:
|
30
30
|
|
31
|
-
```
|
32
|
-
|
31
|
+
```bash
|
32
|
+
rails generate healthier:config
|
33
33
|
```
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
This will generate these two files:
|
36
|
+
1. config/healthier.yml
|
38
37
|
```yaml
|
39
38
|
---
|
40
39
|
healthier:
|
41
40
|
depends_on:
|
42
|
-
|
43
|
-
- name: '
|
44
|
-
- name: '
|
45
|
-
- name: '
|
41
|
+
# Uncomment accordingly
|
42
|
+
# - name: 'postgresql'
|
43
|
+
# - name: 'mongodb'
|
44
|
+
# - name: 'redis'
|
45
|
+
# - name: 'rabbitmq'
|
46
|
+
```
|
47
|
+
2. config/initializers/healthier.rb
|
48
|
+
```ruby
|
49
|
+
Healthier.setup do |config|
|
50
|
+
config.depends_on = config.healthier.call
|
51
|
+
end
|
52
|
+
```
|
53
|
+
|
54
|
+
In your application routes.rb file:
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
mount Healthier::Engine => '/healthier'
|
46
58
|
```
|
47
59
|
|
48
60
|
ENVs for basic authentication:
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Healthier
|
4
|
+
# Generates a healthier.yml
|
5
|
+
class ConfigGenerator < Rails::Generators::Base
|
6
|
+
source_root File.expand_path('templates', __dir__)
|
7
|
+
|
8
|
+
def create_healthier_file
|
9
|
+
create_file 'config/initializers/healthier.rb', <<~RUBY
|
10
|
+
# frozen_string_literal: true
|
11
|
+
|
12
|
+
Healthier.setup do |config|
|
13
|
+
config.depends_on = config.healthier.call
|
14
|
+
end
|
15
|
+
RUBY
|
16
|
+
end
|
17
|
+
|
18
|
+
def create_healthier_yaml
|
19
|
+
create_file 'config/healthier.yml', <<~YAML
|
20
|
+
---
|
21
|
+
healthier:
|
22
|
+
# Uncomment accordingly
|
23
|
+
depends_on:
|
24
|
+
# - name: 'postgresql'
|
25
|
+
# - name: 'mongodb'
|
26
|
+
# - name: 'redis'
|
27
|
+
# - name: 'rabbitmq'
|
28
|
+
YAML
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/healthier/engine.rb
CHANGED
@@ -37,11 +37,7 @@ module Healthier
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def conf
|
40
|
-
@conf ||=
|
41
|
-
end
|
42
|
-
|
43
|
-
def config_path
|
44
|
-
Rails.root.join('config/healthier/services.yml')
|
40
|
+
@conf ||= Healthier.depends_on['healthier']
|
45
41
|
end
|
46
42
|
|
47
43
|
def ping_it(service)
|
data/lib/healthier/version.rb
CHANGED
data/lib/healthier.rb
CHANGED
@@ -5,5 +5,10 @@ require 'healthier/engine'
|
|
5
5
|
|
6
6
|
# Healthier
|
7
7
|
module Healthier
|
8
|
-
|
8
|
+
def self.setup
|
9
|
+
yield self
|
10
|
+
end
|
11
|
+
|
12
|
+
mattr_accessor :healthier, default: -> { YAML.load_file(Rails.root.join('config/healthier.yml')) }
|
13
|
+
mattr_accessor :depends_on, default: {}
|
9
14
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: healthier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nima Yonten
|
@@ -38,6 +38,7 @@ files:
|
|
38
38
|
- app/controllers/healthier/checks_controller.rb
|
39
39
|
- app/services/basic_auth_service.rb
|
40
40
|
- config/routes.rb
|
41
|
+
- lib/generators/healthier/config_generator.rb
|
41
42
|
- lib/healthier.rb
|
42
43
|
- lib/healthier/engine.rb
|
43
44
|
- lib/healthier/version.rb
|