fino-rails 1.8.3 → 1.9.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: a1733f805cdc67341681eefc7ccbde39b0f2131982fa09fa4c7d8a788f09b01d
4
- data.tar.gz: ddac291c9392c4e68004094c4eb809e9a69e1b072d62c2a991082e40c0232c9a
3
+ metadata.gz: 684fac1c4b164feabfda508efa2a495757b84cae91dc8e657487d60fe100c3b8
4
+ data.tar.gz: d9a369a7495af11836af27490896199c26a2c679524be7ef700e285f0108d0bb
5
5
  SHA512:
6
- metadata.gz: 15d2911927e6b102b25e6e336cbb7d0171b50c0009d32323203f4341b08f52f89ddd52883b2687f9939ef8838b5e7569c0738a97ccb168f4447b709a35200f08
7
- data.tar.gz: 2e58cf0c5822dfa50277369ffa3cddf3995cc20ccdf97c92c0366c2d5226650f496700555289e209814971764ed93709cb658ee9abde433081c7a13b21866ae4
6
+ metadata.gz: 4dc6d071c9b47fcd03b44586b836b4ded4bed8f4943369bd773fc46f34d473d8af813c8192fa8e4c823b847eb63f2d8388d5f0c79ab8c9586eba584c8dfb7e19
7
+ data.tar.gz: 4c50e77568d13ae6eef8081248414cf94364eb2fc1b6f2e643052e11919121f96a6d6c1035883d8f2aee5faeb14fd51d330429fc4afbdc2985fe520a386ab5e8
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # Fino
2
2
 
3
- ⚠️ Fino in active development phase at wasn't properly battle tested in production just yet. Give us a star and stay tuned for Production test results and new features
3
+ Fino is plug & play distributed settings engine for Ruby and Rails
4
4
 
5
- Fino is a dynamic settings engine for Ruby and Rails
5
+ - Blazing fast reads with multiple adapers (Redis, Active Record)
6
+ - Out of the box UI
7
+ - A/B test and override settings on the go
6
8
 
7
9
  ## Usage
8
10
 
@@ -139,6 +141,31 @@ Fino.value(:http_read_timeout, at: :my_micro_service, unit: :sec) #=> 0.2
139
141
  Fino.setting(:http_read_timeout, at: :my_micro_service).value(unit: :sec) #=> 0.2
140
142
  ```
141
143
 
144
+ ### Callbacks
145
+
146
+ Fino provides callbacks configuration that will be called once some particular action is triggered:
147
+
148
+ - `after_write` - yields `setting_definition`, `value`, `overrides` and `variants`, is triggered when setting is updated
149
+
150
+ ```ruby
151
+ Fino.configure do
152
+ # ...
153
+
154
+ after_write do |setting_definition, value, overrides, variants|
155
+ next unless setting_definition.tags.include?(:monitor)
156
+
157
+ Monitor.track_changes("Set #{setting_definition.key} to #{value}")
158
+ end
159
+
160
+ settings do
161
+ setting :maintenance_mode, :boolean, default: false
162
+
163
+ setting :http_read_timeout, :integer, unit: :ms, default: 200, tags: %i[monitor]
164
+ setting :http_open_timeout, :integer, unit: :ms, default: 500, tags: %i[monitor]
165
+ end
166
+ end
167
+ ```
168
+
142
169
  ## Rails integration
143
170
 
144
171
  Fino easily integrates with Rails. Just add the gem to your Gemfile:
@@ -6,7 +6,7 @@ module Fino::Rails::SettingsHelper
6
6
  boolean: "blue",
7
7
  integer: "yellow",
8
8
  float: "purple"
9
- }
9
+ }.freeze
10
10
 
11
11
  def setting_type_label(setting)
12
12
  color = SETTING_TYPE_TO_COLOR_MAPPING.fetch(setting.type, "gray")
data/lib/fino/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fino
4
- VERSION = "1.8.3"
5
- REQUIRED_RUBY_VERSION = ">= 3.0.0"
4
+ VERSION = "1.9.0"
5
+ REQUIRED_RUBY_VERSION = ">= 3.2.0"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fino-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.3
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Egor Iskrenkov
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 1.8.3
18
+ version: 1.9.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: 1.8.3
25
+ version: 1.9.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rails
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -99,7 +99,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - ">="
101
101
  - !ruby/object:Gem::Version
102
- version: 3.0.0
102
+ version: 3.2.0
103
103
  required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  requirements:
105
105
  - - ">="