vagrant-env 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8adbfb5eb2ce2cf95bf3f2e3d56ad50c7a77f0aa
4
+ data.tar.gz: 356e0844b04cb42aaad076eba505e0bff9e40857
5
+ SHA512:
6
+ metadata.gz: ddf00596b856be0df3662d5d46dfe30be4e043bc8009d04fcf06a088f1eeb6d78613d7ed73e2323081333569976f804eb2cd2860c9dff81ce0b821ffa24a7ba6
7
+ data.tar.gz: bd548215fa26c3c24b6edae972fcebdf7286a42b2b3e2671b2ec0e1720429714c1aee57bede459b5eb38ee4a0dad18d5769bbab3b692fac654d4d4e8cc95dc49
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
15
+ Vagrantfile
16
+ .vagrant
17
+ .env
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in vagrant-env.gemspec
4
+ gemspec
5
+
6
+ group :development do
7
+ gem "vagrant", git: "https://github.com/mitchellh/vagrant.git"
8
+ end
9
+
10
+ group :plugins do
11
+ gem "vagrant-env", path: "."
12
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Greg Osuri
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # Vagrant ENV Plugin
2
+
3
+ This is a [Vagrant](http://www.vagrantup.com) plugin to load environment variables from .env into ENV
4
+
5
+ ## Usage
6
+
7
+ Install using standard Vagrant plugin installation methods.
8
+
9
+ ```
10
+ $ vagrant plugin install vagrant-env
11
+ ```
12
+
13
+ After installing, add your application configuration to your .env file in the root of your project
14
+
15
+ ```
16
+ $ echo BOX_NAME=foo > .env
17
+ ```
18
+
19
+ And then make a Vagrantfile that looks like the following, filling in your information where necessary.
20
+
21
+ ```
22
+ Vagrant.configure("2") do |config|
23
+ congig.env.enable
24
+ config.vm.box = ENV['BOX_NAME']
25
+ end
26
+ ```
27
+
28
+ You may also add export in front of each line so you can source the file in bash:
29
+
30
+ ```
31
+ export AWS_ACCESS_ID=YOURACCESSIDGOESHERE
32
+ export AWS_SECRET_ACCESS_ID=YOURSECRETKEYGOESHERE
33
+ ```
34
+
35
+ ### Should I commit my .env file?
36
+
37
+ It is recommended that you store development-only settings in your .env file, and commit it to your repository. Make sure that all your credentials for your development environment are different from your other deployments. This makes it easy for other developers to get started on your project, without compromising your credentials for other environments.
38
+
39
+ ## Contributing
40
+
41
+ 1. Fork it ( https://github.com/gosuri/vagrant-env/fork )
42
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
43
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
44
+ 4. Push to the branch (`git push origin my-new-feature`)
45
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+ Bundler::GemHelper.install_tasks
4
+
@@ -0,0 +1,6 @@
1
+ require "dotenv"
2
+ require "vagrant-env/plugin"
3
+
4
+ module VagrantPlugins
5
+ module Env; end
6
+ end
@@ -0,0 +1,13 @@
1
+ require 'dotenv'
2
+
3
+ module VagrantPlugins
4
+ module Env
5
+ class Config < Vagrant.plugin("2", :config)
6
+ attr_accessor :enable
7
+ def initialize
8
+ @enable = UNSET_VALUE
9
+ Dotenv.load
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,27 @@
1
+ begin
2
+ require "vagrant"
3
+ rescue LoadError
4
+ raise "The Vagrant ENV plugin must be run within Vagrant."
5
+ end
6
+
7
+ # This is a sanity check to make sure no one is attempting to install
8
+ # this into an early Vagrant version.
9
+ if Vagrant::VERSION < "1.2.0"
10
+ raise "The Vagrant ENV plugin is only compatible with Vagrant 1.2+"
11
+ end
12
+
13
+ module VagrantPlugins
14
+ module Env
15
+ class Plugin < Vagrant.plugin("2")
16
+ name "ENV"
17
+ description <<-DESC
18
+ Vagrant plugin to load environment variables from .env into ENV
19
+ DESC
20
+
21
+ config "env" do
22
+ require_relative "config"
23
+ Config
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,5 @@
1
+ module VagrantPlugins
2
+ module Env
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'vagrant-env/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "vagrant-env"
8
+ spec.version = VagrantPlugins::Env::VERSION
9
+ spec.authors = ["Greg Osuri"]
10
+ spec.email = ["greg@overclock.io"]
11
+ spec.summary = %q{Vagrant plugin to load environment variables from .env into ENV}
12
+ spec.description = %q{Vagrant plugin to load environment variables from .env into ENV}
13
+ spec.homepage = "http://github.com/gosuri/vagrant-env"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_runtime_dependency "dotenv", "~> 0.9"
22
+ spec.add_development_dependency "bundler", "~> 1.6"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ end
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vagrant-env
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Greg Osuri
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-08-31 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: dotenv
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '0.9'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '0.9'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.6'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.6'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description: Vagrant plugin to load environment variables from .env into ENV
56
+ email:
57
+ - greg@overclock.io
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - .gitignore
63
+ - Gemfile
64
+ - LICENSE.txt
65
+ - README.md
66
+ - Rakefile
67
+ - lib/vagrant-env.rb
68
+ - lib/vagrant-env/config.rb
69
+ - lib/vagrant-env/plugin.rb
70
+ - lib/vagrant-env/version.rb
71
+ - vagrant-env.gemspec
72
+ homepage: http://github.com/gosuri/vagrant-env
73
+ licenses:
74
+ - MIT
75
+ metadata: {}
76
+ post_install_message:
77
+ rdoc_options: []
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - '>='
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ requirements: []
91
+ rubyforge_project:
92
+ rubygems_version: 2.4.1
93
+ signing_key:
94
+ specification_version: 4
95
+ summary: Vagrant plugin to load environment variables from .env into ENV
96
+ test_files: []