Skip to content

ngmoco/bootloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bootloader

bootloader takes care of many of the common tasks across your Ruby applications:

  • Loading YAML configuration.
  • Loading multiple source files at once.
  • Setting up a syslogger.
  • etc.

Installation

Add the following line to your Gemfile:

gem 'bootloader'

And then run:

bundle install

Example

Say you have a project with the following structure:

my_project/
  Gemfile
  config/
    my_project.yml
  lib/
    foo.rb
    bar.rb

Here's the my_project.yml:

development:
  database:
    name: my_project_dev
    hosts:
      - db101
      - db102

Loading YAML configs

require 'bootloader'

Bootloader.load_configs # => Loads my_project.yml into MyProjectConfig
MyProjectConfig.database.name # => "my_project_dev"
MyProjectConfig.database.hosts # => ['db101', 'db102']

Loading multiple files at once

Bootloader.load_dir 'lib' # Loads all the files under lib

Setting up a Syslogger

Bootloader.syslogger 'my_project' # => #<Logger>

License

bootloader is released under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages