Socket
Book a DemoInstallSign in
Socket

spore-rails

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spore-rails

0.1.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

spore-rails

Ruby/Rails gem to load Spore environment variables. See the Spore Website for more information.

Installation

Rails

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

gem 'spore-rails'

And then execute:

$ bundle

Note on load order

Spore is initialized in your Rails app during the before_configuration callback, which is fired when the Application constant is defined in config/application.rb with class Application < Rails::Application. If you need it to be initialized sooner, you can manually call Spore::Railtie.load.

# config/application.rb
Bundler.require(*Rails.groups)

Spore::Railtie.load

HOSTNAME = ENV['HOSTNAME']

If you use gems that require environment variables to be set before they are loaded, then list spore-rails in the Gemfile before those other gems and require spore/rails-now.

gem 'spore-rails', :require => 'spore/rails-now'
gem 'gem-that-requires-env-variables'

Sinatra or Plain ol' Ruby

Install the gem:

$ gem install spore

As early as possible in your application bootstrap process, load Spore:

require 'spore'
Spore.load

To ensure Spore is loaded in rake, load the tasks:

require 'spore/tasks'

task :mytask => :spore do
    # things that require environment variables
end

Contributing

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Added some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

Notes

The spore-rails gem was based on dotenv by Brandon Keepers.

FAQs

Package last updated on 02 Oct 2015

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.