Add support for dotenv

This commit is contained in:
Thomas Reynolds 2016-05-25 10:54:49 -07:00
parent 38a9025560
commit 6440d53e7a
3 changed files with 7 additions and 1 deletions

View file

@ -9,6 +9,9 @@ end
require "middleman-core/load_paths"
Middleman.setup_load_paths
require 'dotenv'
::Dotenv.load
require 'middleman-core'
require 'middleman-core/logger'
@ -46,6 +49,8 @@ end
::Middleman::Logger.singleton(3)
::Middleman::Cli.config = ::Middleman::Application.new do
#
config[:environment] = (ENV['MM_ENV'] || ENV['RACK_ENV'] || 'development').to_sym
config[:mode] = :config
config[:exit_before_ready] = true
config[:watcher_disable] = true

View file

@ -10,7 +10,7 @@ module Middleman::Cli
class_option :environment,
aliases: '-e',
default: :production
default: ENV['MM_ENV'] || ENV['RACK_ENV'] || :production
class_option :clean,
type: :boolean,
default: true,

View file

@ -26,6 +26,7 @@ Gem::Specification.new do |s|
s.add_dependency('fast_blank')
s.add_dependency('parallel')
s.add_dependency('servolux')
s.add_dependency('dotenv')
# Helpers
s.add_dependency('activesupport', ['~> 4.2'])