New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ordered_initializers

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ordered_initializers

  • 0.3.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

According to Rails doc

After loading the framework and any gems in your application, Rails turns to loading initializers. An initializer is any Ruby file stored under config/initializers in your Rails application. The files in config/initializers are sorted and loaded one by one as part of the load_config_initializers initializer. If an initializer has code that relies on code in another initializer, you can combine them into a single initializer instead. This makes the dependencies more explicit, and can help surface new concepts within your application. Rails also supports numbering of initializer file names, but this can lead to file name churn.

Ordered Initiliazers simply allows you to choose the order in which you want your initializers to be loaded, independently of their name.

Installation

Add this line to the top of your Rails application's Gemfile:

gem 'ordered_initializers'

And then install the gem:

$ bundle install

You can set your initializers order in the config/initializers.yml file. Because there is no possibility to prevent Rails from loading files in config/initializers, you need to store your initializers files in the config/ordered_initializers folder.

Ordered Initiliazers provides a rake task that will automatically moves the files from config/initializers toconfig/ordered_initializers, generates the config/initializers.yml file and leaves a small reminder in config/initializers.

$ rake ordered_initializers:install

You can reorder the initializers path as you see fit.

You can still add files to config/initializers. They will be loaded alphabetically after the ones in config/ordered_initializers.

Running rake ordered_initializers:install again will simply append the new files from config/initializers at the end of config/initializers.yml.

FAQs

Package last updated on 13 Oct 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc