heroku-env 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b36ac2535c255cbde68f7d3748f7eb90bd99440
4
- data.tar.gz: ba93cb44537b0ab9498e5a9b78b81add53e88c43
3
+ metadata.gz: aa122904c9efffa4a6203563cf19f7adeab9f122
4
+ data.tar.gz: 82b3a4658cc13ed5c22d226b3a443f25b60c9f7e
5
5
  SHA512:
6
- metadata.gz: 2bd0101624c4d2a1a210b4a9ce25726e0d40320a5188fa520be388890de585477f347aa0f58db06bc8d5bf0f6a83247b6a0f7d62080ce1e5c3002d1afac2f2b5
7
- data.tar.gz: ddc464c2e1a7f32675bf14ed265a03aed10b6c769594ebbb9261eef5e3d69698be90e339ac8ca734e2b3c048ed4ba7e4729f81f666ec41f870b622a6e2765c10
6
+ metadata.gz: 9feea723fe84a1ecd9eebe34307cbfc7191a3a6e50477a468470a1b839ec163aff134bd2fe50b136c45d836c0ff35afe7ffcf34326a1c4957b2fdb904b1d40dd
7
+ data.tar.gz: 50e76f22d0cf3c9b1551b9c0637c14a488c9c36d9eea2147de600296d14392ba297d2fa7675d4434e43c4cfd9833407642459582191ab5128a222841b9531cd1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- heroku-env (0.0.2)
4
+ heroku-env (0.0.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/heroku-env.gemspec CHANGED
@@ -8,13 +8,13 @@ Gem::Specification.new do |s|
8
8
  s.email = ["stefan@stefansundin.com"]
9
9
  s.homepage = "https://github.com/stefansundin/heroku-env"
10
10
  s.summary = "Don't worry about the environment."
11
- s.description = "This gem automatically promotes Heroku addons' environment settings."
11
+ s.description = "This gem automatically promotes Heroku addons' environment settings. See the GitHub page for usage."
12
12
 
13
13
  s.required_rubygems_version = ">= 1.3.6"
14
14
 
15
15
  s.add_development_dependency "rake", "10.4.2"
16
16
 
17
- s.files = `git ls-files`.split("\n")
17
+ s.files = `git ls-files`.split("\n") - %w(.gitignore README.md Rakefile)
18
18
  s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
19
19
  s.require_path = 'lib'
20
20
  end
data/lib/heroku-env.rb CHANGED
@@ -4,6 +4,23 @@ module HerokuEnv
4
4
  # Redis
5
5
  ENV["REDIS_URL"] ||= ENV["REDISCLOUD_URL"] || ENV["REDISTOGO_URL"]
6
6
 
7
+ # Memcache
8
+ ENV["MEMCACHE_SERVERS"] ||= ENV["MEMCACHIER_SERVERS"] || ENV["MEMCACHEDCLOUD_SERVERS"]
9
+ ENV["MEMCACHE_USERNAME"] ||= ENV["MEMCACHIER_USERNAME"] || ENV["MEMCACHEDCLOUD_USERNAME"]
10
+ ENV["MEMCACHE_PASSWORD"] ||= ENV["MEMCACHIER_PASSWORD"] || ENV["MEMCACHEDCLOUD_PASSWORD"]
11
+
12
+ # Mongo
13
+ ENV["MONGO_URL"] ||= ENV["MONGOLAB_URI"] || ENV["MONGOSOUP_URL"]
14
+
15
+ # MySQL
16
+ ENV["MYSQL_URL"] ||= ENV["CLEARDB_DATABASE_URL"]
17
+
18
+ # Neo4j
19
+ ENV["NEO4J_URL"] ||= ENV["GRAPHSTORY_URL"] || ENV["GRAPHENEDB_URL"]
20
+
21
+ # Elasticsearch
22
+ ENV["ELASTICSEARCH_URL"] ||= ENV["BONSAI_URL"] || ENV["SEARCHBOX_SSL_URL"]
23
+
7
24
  # SMTP
8
25
  ENV["MANDRILL_SMTP_SERVER"] ||= "smtp.mandrillapp.com" if ENV["MANDRILL_USERNAME"]
9
26
  ENV["SENDGRID_SMTP_SERVER"] ||= "smtp.sendgrid.net" if ENV["SENDGRID_USERNAME"]
@@ -15,5 +32,13 @@ module HerokuEnv
15
32
 
16
33
  # If you use Postmark, you need to configure MAIL_FROM manually
17
34
  ENV["MAIL_FROM"] ||= ENV["MANDRILL_USERNAME"] || ENV["SENDGRID_USERNAME"] || ENV["MAILGUN_SMTP_LOGIN"]
35
+
36
+ # Airbrake
37
+ ENV["RAYGUN_HOST"] ||= "api.raygun.io" if ENV["RAYGUN_APIKEY"]
38
+ ENV["ROLLBAR_HOST"] ||= "api.rollbar.com" if ENV["ROLLBAR_ACCESS_TOKEN"]
39
+ ENV["APPENLIGHT_HOST"] ||= "api.appenlight.com" if ENV["APPENLIGHT_APIKEY"]
40
+
41
+ ENV["AIRBRAKE_HOST"] ||= ENV["RAYGUN_HOST"] || ENV["ROLLBAR_HOST"] || ENV["APPENLIGHT_HOST"]
42
+ ENV["AIRBRAKE_KEY"] ||= ENV["RAYGUN_APIKEY"] || ENV["ROLLBAR_ACCESS_TOKEN"] || ENV["APPENLIGHT_APIKEY"]
18
43
  end
19
44
  end
@@ -1,3 +1,3 @@
1
1
  module HerokuEnv
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroku-env
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Sundin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-30 00:00:00.000000000 Z
11
+ date: 2015-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -25,17 +25,15 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: 10.4.2
27
27
  description: This gem automatically promotes Heroku addons' environment settings.
28
+ See the GitHub page for usage.
28
29
  email:
29
30
  - stefan@stefansundin.com
30
31
  executables: []
31
32
  extensions: []
32
33
  extra_rdoc_files: []
33
34
  files:
34
- - ".gitignore"
35
35
  - Gemfile
36
36
  - Gemfile.lock
37
- - README.md
38
- - Rakefile
39
37
  - heroku-env.gemspec
40
38
  - lib/heroku-env.rb
41
39
  - lib/heroku-env/version.rb
data/.gitignore DELETED
@@ -1,5 +0,0 @@
1
- /pkg
2
- *.gem
3
- Thumbs.db
4
- .DS_Store
5
- *.swp
data/README.md DELETED
@@ -1,77 +0,0 @@
1
- # heroku-env
2
-
3
- > Don't worry about the environment.
4
-
5
- This simple gem makes it easier for you to use different Heroku addons in a plug-and-play fashion. Normally, if you decide to add a Redis provider, you have to customize your code to use that addon's environment variables. The problem with this, however, is that if you want to switch provider, you have to update your code.
6
-
7
- What I usually ended up doing was:
8
-
9
- ```ruby
10
- ENV["REDIS_URL"] ||= ENV["REDISCLOUD_URL"] || ENV["REDISTOGO_URL"]
11
- $redis = Redis.new
12
- ```
13
-
14
- Doing this in every project started to become a little annoying, so I decided to make a gem. The goal is to handle all kinds of addons, but for now it only handles Redis and SMTP. Suggest more types by filing an issue.
15
-
16
- I only add addons that I can test myself, so this gem will only support addons with a free plan. The order that the addons are selected depends on how stable and easy I perceive them to be. So if you are deciding what provider you want to use, a good choice if probably the first one on the lists of supported addons I list below.
17
-
18
- The gem uses `||=` in all the assignments, so you can easily override any variable by manually setting it.
19
-
20
-
21
- ## Installing
22
-
23
- Add to your Gemfile:
24
-
25
- ```ruby
26
- gem "heroku-env"
27
- ```
28
-
29
- Then run:
30
-
31
- ```ruby
32
- HerokuEnv.run
33
- ```
34
-
35
-
36
- ### Redis
37
-
38
- Supports [Redis Cloud](https://addons.heroku.com/rediscloud) and [Redis To Go](https://addons.heroku.com/redistogo).
39
-
40
- ```ruby
41
- $redis = Redis.new
42
- ```
43
-
44
-
45
- ### SMTP
46
-
47
- Supports [Mandrill](https://addons.heroku.com/mandrill), [SendGrid](https://addons.heroku.com/sendgrid), [Mailgun](https://addons.heroku.com/mailgun) and [Postmark](https://addons.heroku.com/postmark).
48
-
49
- ```ruby
50
- Mail.defaults do
51
- delivery_method :smtp,
52
- address: ENV["SMTP_HOST"],
53
- port: ENV["SMTP_PORT"],
54
- user_name: ENV["SMTP_USERNAME"],
55
- password: ENV["SMTP_PASSWORD"],
56
- authentication: "plain",
57
- enable_starttls_auto: true
58
- end
59
- ```
60
-
61
- Then send an email with:
62
-
63
- ```ruby
64
- Mail.deliver do
65
- from "Sender <#{ENV["MAIL_FROM"]}>"
66
- to "receiver@example.com"
67
- subject "Test email"
68
- body "Just testing heroku-env"
69
- end
70
- ```
71
-
72
- If you use Postmark, you have to manually set `MAIL_FROM`.
73
-
74
-
75
- ## Misc notes
76
-
77
- - Postmark sends you some unwanted emails if you add the addon.
data/Rakefile DELETED
@@ -1,3 +0,0 @@
1
- require "rubygems"
2
- require "bundler"
3
- Bundler::GemHelper.install_tasks