Class: VagrantPlugins::Env::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::Env::Config
- Defined in:
- lib/vagrant-env/config.rb
Instance Method Summary collapse
-
#enable(vagrantfile = nil) ⇒ Object
Simple interface: config.env.enable __FILE__.
-
#load(*filenames) ⇒ Object
Lower-level methods - proxy to Dotenv:.
- #load!(*filenames) ⇒ Object
- #overload(*filenames) ⇒ Object
Instance Method Details
#enable(vagrantfile = nil) ⇒ Object
Simple interface: config.env.enable __FILE__
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/vagrant-env/config.rb', line 9 def enable(vagrantfile = nil) if vagrantfile load File.dirname(vagrantfile) + '/.env' else # The default is .env in the current directory - but that may not be # the same directory that the Vagrantfile is in # https://github.com/gosuri/vagrant-env/issues/2 load end end |
#load(*filenames) ⇒ Object
Lower-level methods - proxy to Dotenv:
21 22 23 |
# File 'lib/vagrant-env/config.rb', line 21 def load(*filenames) Dotenv::load *filenames end |
#load!(*filenames) ⇒ Object
25 26 27 |
# File 'lib/vagrant-env/config.rb', line 25 def load!(*filenames) Dotenv::load! *filenames end |
#overload(*filenames) ⇒ Object
29 30 31 |
# File 'lib/vagrant-env/config.rb', line 29 def overload(*filenames) Dotenv::overload *filenames end |