heroku_hatchet 1.1.0 → 1.1.1

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: b3de8693165cadd85b33f59521ea5c1a7d5bf7a5
4
- data.tar.gz: fe8f0f5783ceb61174f907cd19039760789aa248
3
+ metadata.gz: 5315711673cc47ca589aa39f28e02f0b2d2b56b6
4
+ data.tar.gz: 5678646d4511dd25e033a8107344bb871db55fac
5
5
  SHA512:
6
- metadata.gz: a3075c645dd0ecbfa932e610f0522746945b33c6fd12749a9a6b37dfd51f016b528f0e1f1a97320a7f1550b1e5b19bd6d9eb201479d1d97bcacd314e46e980bd
7
- data.tar.gz: 526de86c2aaf5e1e4b8bb0d5ddafa35d35f33f38dcbdbddf2506bbeb47f21344d29e568364510b5cbfd476fee4332882098809221dbf2629085c644da82c809a
6
+ metadata.gz: 3401c9359d44dec14f649ceede85815b482a31544aa11c00406f1353cbc8ec125bb76a9a18f9d7b3e46673705749f0febb751d3b550df25a7689596a5e232260
7
+ data.tar.gz: 47cba782fcb59d14ae0919e215ee350629b89314f2f6cce1fa256e98b0cd83e91eee95eb9771b3926b2dc981bfe9479b1855bc29d6acf093803a404970ea8d62
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## HEAD
2
2
 
3
+ ## 1.1.1
4
+
5
+ - Ensure external commands run inside of `bundle_exec` block are run with propper environment variables set.
6
+
3
7
  ## 1.1.0
4
8
 
5
9
  - Added `Hatchet::Runner` which can dynamically swap the backend (anvil/git) depending on the value of ENV['HATCHET_DEPLOY_STRATEGY'] you can use 'anvil' or 'git'.
data/lib/hatchet/app.rb CHANGED
@@ -40,9 +40,13 @@ module Hatchet
40
40
  # but programatically and with more control
41
41
  def run(command, timeout = nil, &block)
42
42
  heroku_command = "heroku run #{command} -a #{name}"
43
- return `#{heroku_command}` if block.blank?
43
+ bundle_exec do
44
+ return `#{heroku_command}` if block.blank?
45
+ end
44
46
 
45
- ReplRunner.new(command, heroku_command, startup_timeout: timeout).run(&block)
47
+ bundle_exec do
48
+ ReplRunner.new(command, heroku_command, startup_timeout: timeout).run(&block)
49
+ end
46
50
  end
47
51
 
48
52
  # set debug: true when creating app if you don't want it to be
@@ -119,12 +123,24 @@ module Hatchet
119
123
  end
120
124
 
121
125
  def api_key
122
- @api_key ||= ENV['HEROKU_API_KEY'] || `heroku auth:token`.chomp
126
+ @api_key ||= ENV['HEROKU_API_KEY'] || bundle_exec {`heroku auth:token`.chomp }
123
127
  end
124
128
 
125
129
  def heroku
126
130
  @heroku ||= Heroku::API.new(api_key: api_key)
127
131
  end
132
+
133
+ private
134
+ # if someone uses bundle exec
135
+ def bundle_exec
136
+ if defined?(Bundler)
137
+ Bundler.with_clean_env do
138
+ yield
139
+ end
140
+ else
141
+ yield
142
+ end
143
+ end
128
144
  end
129
145
  end
130
146
 
@@ -1,3 +1,3 @@
1
1
  module Hatchet
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroku_hatchet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Schneeman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-23 00:00:00.000000000 Z
11
+ date: 2013-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: heroku-api