Skip to content

Commit

Permalink
Attempt to load spring/watcher
Browse files Browse the repository at this point in the history
Fixes #140
  • Loading branch information
bkeepers committed Oct 4, 2014
1 parent f4e0256 commit 415eee2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/dotenv/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ module Dotenv
class Railtie < Rails::Railtie
config.before_configuration do
Dotenv.load Rails.root.join('.env')
Spring.watch Rails.root.join('.env') if defined?(Spring)

begin
require "spring/watcher"
Spring.watch Rails.root.join('.env')
rescue LoadError
end
end
end
end

0 comments on commit 415eee2

Please sign in to comment.