dotenv-deployment 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4d1c2ce94d97eeabf2bc88d2bcf1d1b26db3f7bc
4
+ data.tar.gz: 71739e84b1881af268542d16ce5fe86f2b843fcd
5
+ SHA512:
6
+ metadata.gz: 853e5f6efafe502d11fe82a5e08ac5abffd6f821beb3488853da484e5d10527da96401a7a85fb9c827d4cc77c7cf1389b5adb2daf6732b990267b0e41659e347
7
+ data.tar.gz: 57888ed44b2b37db707d58cd8301e18badbb523e1a5e4eaea7d1a2a2197e5a98fb3034a4ee955ccb1df4af005a29a88ef853a45d47fec42bf669b8cd9b22c2df
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ .idea
7
+ Gemfile.lock
8
+ InstalledFiles
9
+ _yardoc
10
+ coverage
11
+ doc/
12
+ lib/bundler/man
13
+ pkg
14
+ rdoc
15
+ spec/reports
16
+ test/tmp
17
+ test/version_tmp
18
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Brandon Keepers
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,56 @@
1
+ # dotenv
2
+
3
+ [dotenv](https://github.com/bkeepers/dotenv) is designed to load configuration variables into `ENV` in *development*. It does not concern itself with production environments because there are typically better ways to manage configuration in those environments—such as `/etc/environment` managed by [Puppet](https://github.com/puppetlabs/puppet) or [Chef](https://github.com/opscode/chef), `heroku config`, etc.
4
+
5
+ However, some find dotenv to be a convenient way to configure applications in staging and production environments. This gem makes it easier to do that by adding support for:
6
+
7
+ * [multiple environments](#multiple-environments)
8
+ * [Capistrano](#capistrano)
9
+
10
+ ## Installation
11
+
12
+ Add this line to your application's Gemfile:
13
+
14
+ gem 'dotenv-deployment'
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ ## Usage
21
+
22
+ ## Multiple Environments
23
+
24
+ By default `.env` will be loaded when `dotenv-deployment` is required. It will not override existing environment variables.
25
+
26
+ If you're using Rails or `ENV['RACK_ENV']` is set, an environment-specific file (like `.env.production`) will be loaded and override any existing variables. In a Rails project, `config/*.env` and `config/*.env.#{environment}` will also be loaded.
27
+
28
+ ## Capistrano
29
+
30
+ ### Capistrano 2
31
+
32
+ Add the gem to your `config/deploy.rb` file:
33
+
34
+ ```ruby
35
+ require "dotenv/deployment/capistrano"
36
+ ```
37
+
38
+ **NOTE: If you are upgrading from previous versions of dotenv, you will need to change your require from "dotenv/capistrano" to "dotenv/deployment/capistrano".**
39
+
40
+ It will symlink the `.env` located in `/path/to/shared` in the new release.
41
+
42
+ ### Capistrano 3
43
+
44
+ Just add `.env` to the list of linked files, for example:
45
+
46
+ ```ruby
47
+ set :linked_files, %w{config/database.yml .env}
48
+ ```
49
+
50
+ ## Contributing
51
+
52
+ 1. Fork it ( http://github.com/bkeepers/dotenv-deployment/fork )
53
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
54
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
55
+ 4. Push to the branch (`git push origin my-new-feature`)
56
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,22 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'dotenv/deployment/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "dotenv-deployment"
8
+ spec.version = Dotenv::Deployment::VERSION
9
+ spec.authors = ["Brandon Keepers"]
10
+ spec.email = ["brandon@opensoul.org"]
11
+ spec.summary = %q{Deployment concerns for dotenv}
12
+ spec.homepage = "https://github.com/bkeepers/dotenv-deployment"
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files`.split($/)
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_development_dependency "bundler", "~> 1.5"
21
+ spec.add_development_dependency "rake"
22
+ end
@@ -0,0 +1,11 @@
1
+ require "dotenv"
2
+ require "dotenv/deployment/version"
3
+
4
+ # Load defaults from .env or *.env in config
5
+ Dotenv.load '.env', *configs
6
+ Dotenv.load *Dir.glob("#{Rails.root}/config/**/*.env") if defined?(Rails)
7
+
8
+ # Override any existing variables if an environment-specific file exists
9
+ environment = ENV['RACK_ENV'] || (defined?(Rails) && Rails.env)
10
+ Dotenv.overload ".env.#{environment}"
11
+ Dotenv.overload *Dir.glob("#{Rails.root}/config/**/*.env.#{environment}") if defined?(Rails)
@@ -0,0 +1,11 @@
1
+ require 'capistrano/version'
2
+
3
+ if defined?(Capistrano::VERSION) && Capistrano::VERSION >= '3.0'
4
+ raise 'Please read https://github.com/bkeepers/dotenv-deployment#capistrano to update your dotenv configuration for new Capistrano version'
5
+ else
6
+ require 'dotenv/capistrano/recipes'
7
+
8
+ Capistrano::Configuration.instance(:must_exist).load do
9
+ before "deploy:finalize_update", "dotenv:symlink"
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ Capistrano::Configuration.instance(:must_exist).load do
2
+ _cset(:dotenv_path){ "#{shared_path}/.env" }
3
+
4
+ symlink_args = (role = fetch(:dotenv_role, nil) ? {:roles => role} : {})
5
+
6
+ namespace :dotenv do
7
+ desc "Symlink shared .env to current release"
8
+ task :symlink, symlink_args do
9
+ run "ln -nfs #{dotenv_path} #{release_path}/.env"
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,5 @@
1
+ module Dotenv
2
+ module Deployment
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dotenv-deployment
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Brandon Keepers
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-04-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.5'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description:
42
+ email:
43
+ - brandon@opensoul.org
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - .gitignore
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - dotenv-deployment.gemspec
54
+ - lib/dotenv/deployment.rb
55
+ - lib/dotenv/deployment/capistrano.rb
56
+ - lib/dotenv/deployment/capistrano/recipes.rb
57
+ - lib/dotenv/deployment/version.rb
58
+ homepage: https://github.com/bkeepers/dotenv-deployment
59
+ licenses:
60
+ - MIT
61
+ metadata: {}
62
+ post_install_message:
63
+ rdoc_options: []
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - '>='
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ requirements: []
77
+ rubyforge_project:
78
+ rubygems_version: 2.0.3
79
+ signing_key:
80
+ specification_version: 4
81
+ summary: Deployment concerns for dotenv
82
+ test_files: []
83
+ has_rdoc: