![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
= settings-tree
== Introduction
This gem offers you a convenient settings structure for parameterizing your applications.
The good things over similar gems is the ability to have deep, recursive structures and the ability to have 'specialized' config according to the environment.
Example :
Settings.web_app.root_url => 'localhost:3000'
Settings.web_app.infos.company_name => 'Acme' Settings.web_app.infos.app_name => 'Coffe maker'
Settings.web_app.engine.workers_count => 3
Those settings are read from a YAML file, like this one :
####### Common / default values ####### defaults: root_url: localhost:3000 public_access: true
infos:
company_name: 'Acme'
app_name: 'Coffe maker'
copyright_starting_year: 2011
legend: 'A superb app which does ...'
engine:
workers_count: 3
auto_manage_workers: true
auto_manage_workers_redirect_output: true
####### production environment ####### production:
####### development environment ####### development: engine: auto_manage_workers_redirect_output: false
####### test environment ####### test: engine: workers_count: 0
The common settings reside under a root named 'defaults'. Other roots ('production', 'development'...) will be picked depending on the environment. (more about that later)
This gem has more good features, keep reading.
Ideas taken from : http://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/
== Installation Available as a gem in rubygems, the default gem repository : gem 'settings-tree' Isn't that easy ? (Thank you jeweler for making everything so easy)
== Use
You can uses several, independent 'groups'.
Just register a settings group from a file : Settings.register_settings_file('web_app', File.join(File.dirname(FILE), "config/config_web_app.yml")) or for ruby on rails : (put this line in an initializer in config/initializer) Settings.register_settings_file('web_app', File.join(::Rails.root.to_s, "config/config_web_app.yml")) Note : of course, the group name must be a valid keyword, able to be converted to a sym.
And now you can access your settings from anywhere : Settings.web_app.infos.company_name => 'Acme' (considering the YAML file given previously)
You can register any number of group you want : Settings.register_settings_file('web_game', File.join(File.dirname(FILE), "config/config_web_game.yml")) example, with this file : ####### Common / default values ####### defaults: guild_name: 'gang' party_size: 4 gives : puts Settings.web_game.guild_name => 'gang'
It's common to have settings that you don't want under version control (accounts, passwords). A solution is to use a complementary file not under version control (thanks to a gitignore for example). Just use : Settings.register_settings_file('web_app', File.join(File.dirname(FILE), "config/config_complement.yml")) Since the 'web_app' group already exists, data will be merged, the new one taking precedence in case of conflicts. (Precedence is set according to the order of declaration.) (All the source files are memorized, this is a complement, not a replacement.)
In case you want to reload the settings, you have two functions for that : Settings.reload_all Settings.reload_group('web_app') (You may need that in development mode)
== Advanced use Note : since those functions are rarely used, they don't have 'Settings.' shortcuts. Don't mind, it's the same. === Environment In a rails app, the environment will be taken automatically from 'Rails.env'. If not under a rails app or if the environment is not available, you may want to set it manually : SettingsHolder.instance.set_environment('test') (The existing files/groups will automatically be reloaded to take that into account.)
=== Reset You may also want to reset all the settings (everything will be forgotten) : SettingsHolder.instance.reset
=== Debug A convenient debug function to see all the settings and their values : SettingsHolder.instance.debug_inspect
== Contributing to settings-tree
== Copyright
Copyright (c) 2011 Offirmo. See LICENSE.txt for further details.
FAQs
Unknown package
We found that settings-tree demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.