dotenv-heroku 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6c9399887334c714a02605defcbea8975d135bdf
4
+ data.tar.gz: e7b8231d83bee4365d3d4e99272e6889f6aec314
5
+ SHA512:
6
+ metadata.gz: e3b8d0f38883d39e31b19597f4e3c4e43711f5cc2bdca6121b5e01f9e7c8f7d7dafb5bdd67417e94d7a2d9b39bcdcb27da6869844161bb300bee01958c3eba51
7
+ data.tar.gz: d03142d35bc0808a538d26c64e508035bee41b40b491529d3ced6f795a9683e3589a48d2ac179d0d9da9965220213d77a543acebbf491a3c887d57400388255e
@@ -0,0 +1,22 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in dotenv-heroku.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Philipp Fehre
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.
@@ -0,0 +1,54 @@
1
+ # Dotenv Heroku
2
+
3
+ Support for config push and pull via Rake tasks for
4
+ [dotenv](https://github.com/bkeepers/dotenv). The rake tasks rely on the
5
+ `heroku` excutable to be present in the PATH.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ gem 'dotenv-heroku'
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install dotenv-heroku
20
+
21
+ ## Usage
22
+
23
+ Add
24
+
25
+ require "dotenv-heroku/tasks"
26
+
27
+ to your Rakefile.
28
+
29
+ You can now run
30
+
31
+ $ rake config:pull
32
+
33
+ to pull the current heroku config to the local .env file, you can also pass the
34
+ desired file as an argument
35
+
36
+ $ rake config:pull\[my_current_config\]
37
+
38
+ You can also push the config to heroku via
39
+
40
+ $ rake config:push
41
+
42
+ to push the config from the .env file, or
43
+
44
+ $ rake config:push\[my_current_config\]
45
+
46
+ to push the config from the my_current_config file
47
+
48
+ ## Contributing
49
+
50
+ 1. Fork it ( https://github.com/[my-github-username]/dotenv-heroku/fork )
51
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
52
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
53
+ 4. Push to the branch (`git push origin my-new-feature`)
54
+ 5. Create a new Pull Request
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'dotenv-heroku/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "dotenv-heroku"
8
+ spec.version = Dotenv::Heroku::VERSION
9
+ spec.authors = ["Philipp Fehre"]
10
+ spec.email = ["philipp.fehre@gmail.com"]
11
+ spec.summary = %q{Manage your heroku environment with dotenv}
12
+ spec.description = %q{Tasks to manage your heroku environment with dotenv}
13
+ spec.homepage = "https://github.com/sideshowcoder/dotenv-heroku"
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_development_dependency "bundler", "~> 1.6"
22
+ spec.add_dependency "rake"
23
+ end
@@ -0,0 +1 @@
1
+ require "dotenv-heroku/version"
@@ -0,0 +1,43 @@
1
+ require "mkmf"
2
+ # Make the MakeMakefile logger write file output to null.
3
+ module MakeMakefile::Logging
4
+ @logfile = File::NULL
5
+ end
6
+
7
+ namespace :config do
8
+ task :executable do
9
+ fail "missing heroku executable from the PATH" unless find_executable "heroku"
10
+ end
11
+
12
+ desc "push the .env file to heroku config"
13
+ task :push, [:env_file] => :executable do |t, args|
14
+ args.with_defaults(env_file: ".env")
15
+
16
+ File.readlines(args[:env_file]).map(&:strip).each do |value|
17
+ sh "heroku config:set #{value}"
18
+ end
19
+ end
20
+
21
+ desc "pull the config from heroku and write to .env file"
22
+ task :pull, [:env_file] => :executable do |t, args|
23
+ args.with_defaults(env_file: ".env")
24
+
25
+ remote_config = `heroku config`
26
+ remote_config or fail "could not fetch remote config"
27
+ remote_config = remote_config.split("\n")
28
+ remote_config.shift # remove the header
29
+
30
+ # reformat the lines from
31
+ # XYZ: abc
32
+ # to
33
+ # XYZ=abc
34
+ lines = remote_config.map { |cl|
35
+ cl.split(":").map(&:strip).join("=")
36
+ }
37
+
38
+ File.open(args[:env_file], "w") do |f|
39
+ f.puts lines
40
+ end
41
+ end
42
+ end
43
+
@@ -0,0 +1,5 @@
1
+ module Dotenv
2
+ module Heroku
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dotenv-heroku
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Philipp Fehre
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-27 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.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
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: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Tasks to manage your heroku environment with dotenv
42
+ email:
43
+ - philipp.fehre@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - dotenv-heroku.gemspec
54
+ - lib/dotenv-heroku.rb
55
+ - lib/dotenv-heroku/tasks.rb
56
+ - lib/dotenv-heroku/version.rb
57
+ homepage: https://github.com/sideshowcoder/dotenv-heroku
58
+ licenses:
59
+ - MIT
60
+ metadata: {}
61
+ post_install_message:
62
+ rdoc_options: []
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ requirements: []
76
+ rubyforge_project:
77
+ rubygems_version: 2.2.2
78
+ signing_key:
79
+ specification_version: 4
80
+ summary: Manage your heroku environment with dotenv
81
+ test_files: []