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

config_reader

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

config_reader

  • 3.0.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

ConfigReader

Maintainability Specs Ruby 3.0+

Provides a way to manage environment specific configuration settings. It will use the defaults for any environment and override any values you specify for an environment.

Example config file:

defaults:
  site_url: http://localhost:3000
  host_name: example.com
  mail_from: noreply@example.com
  site_name: example
  admin_email: admin@example.com

production:
  site_url: http://example.com

Sekrets

Includes Sekrets integration. See https://github.com/ahoward/sekrets for more information.

The format of the sekrets file is the same as the regular file.

Setup

class MyConfig < ConfigReader
  configure do |config|
    config.environment = Rails.env # (set this however you access the env in your app)
    config.config_file = "config/my_config.yml"
    config.sekrets_file = "config/my_config.yml.enc" # (default nil)
    config.ignore_missing_keys = true # (default false, raises KeyError)
  end
end

Usage

MyConfig.mail_from    #=> noreply@example.com
MyConfig[:mail_from]  #=> noreply@example.com
MyConfig["mail_from"] #=> noreply@example.com

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don"t break it in a future version unintentionally.
  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.

Copyright (c) Michael Moen. See LICENSE for details.

FAQs

Package last updated on 06 Jan 2025

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