heroku_hatchet 4.0.8 → 4.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +4 -0
- data/lib/hatchet/app.rb +7 -3
- data/lib/hatchet/version.rb +1 -1
- data/test/hatchet/app_test.rb +10 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: aa8c793ec7b05a43ab97534009134ad65766e064affb0627879cfb87b0888171
|
4
|
+
data.tar.gz: f9daf304c274174ed187428db840a3db58d59576463f05f29739a8b134316d4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85f82bb542f17d5af0630cb598edbeebf2f421de5d05f2226ddcfa90bfea94e274f9511e84cc4bcc6e8622bddd536b3dd981ab1fc4792882b5c085a88a0033ac
|
7
|
+
data.tar.gz: bd85ea35febfcc92381bf1c6570a82f58ba89d86b256c3092198ddf462e76c839e99f6aee81b19ea6ac4a99d826b8eb08f66eab9c02ae4847be31195d507fd31
|
data/CHANGELOG.md
CHANGED
data/lib/hatchet/app.rb
CHANGED
@@ -21,6 +21,8 @@ module Hatchet
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
+
SkipDefaultOption = Object.new
|
25
|
+
|
24
26
|
def initialize(repo_name,
|
25
27
|
stack: "",
|
26
28
|
name: default_name,
|
@@ -108,12 +110,14 @@ module Hatchet
|
|
108
110
|
# but programatically and with more control
|
109
111
|
def run(cmd_type, command = nil, options = {}, &block)
|
110
112
|
command = cmd_type.to_s if command.nil?
|
111
|
-
|
113
|
+
default_options = { "app" => name, "exit-code" => nil }
|
114
|
+
heroku_options = (default_options.merge(options.delete(:heroku) || {})).map do |k,v|
|
115
|
+
next if v == Hatchet::App::SkipDefaultOption # for forcefully removing e.g. --exit-code, a user can pass this
|
112
116
|
arg = "--#{k.to_s.shellescape}"
|
113
|
-
arg << "=#{v.to_s.shellescape}" unless v.nil?
|
117
|
+
arg << "=#{v.to_s.shellescape}" unless v.nil? # nil means we include the option without an argument
|
114
118
|
arg
|
115
119
|
end.join(" ")
|
116
|
-
heroku_command = "heroku run
|
120
|
+
heroku_command = "heroku run #{heroku_options} -- #{command}"
|
117
121
|
bundle_exec do
|
118
122
|
if block_given?
|
119
123
|
ReplRunner.new(cmd_type, heroku_command, options).run(&block)
|
data/lib/hatchet/version.rb
CHANGED
data/test/hatchet/app_test.rb
CHANGED
@@ -68,6 +68,16 @@ class AppTest < Minitest::Test
|
|
68
68
|
app.deploy do
|
69
69
|
assert_match /ls: cannot access 'foo bar #baz': No such file or directory\s+Gemfile/, app.run("ls -a Gemfile 'foo bar #baz'")
|
70
70
|
assert (0 != $?.exitstatus) # $? is from the app.run use of backticks
|
71
|
+
sleep(3)
|
72
|
+
app.run("ls erpderp", nil, { :heroku => { "exit-code" => Hatchet::App::SkipDefaultOption } } )
|
73
|
+
assert (0 == $?.exitstatus) # $? is from the app.run use of backticks, but we asked the CLI not to return the program exit status by skipping the default "exit-code" option
|
74
|
+
sleep(3)
|
75
|
+
app.run("ls erpderp", nil, { :heroku => { "no-tty" => nil } } )
|
76
|
+
assert (0 != $?.exitstatus) # $? is from the app.run use of backticks
|
77
|
+
sleep(3)
|
78
|
+
assert_match /ohai world/, app.run('echo \$HELLO \$NAME', nil, { :heroku => { "env" => "HELLO=ohai;NAME=world" } } )
|
79
|
+
sleep(3)
|
80
|
+
refute_match /ohai world/, app.run('echo \$HELLO \$NAME', nil, { :heroku => { "env" => "" } } )
|
71
81
|
end
|
72
82
|
end
|
73
83
|
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: 4.0.
|
4
|
+
version: 4.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Schneeman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: platform-api
|
@@ -247,8 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
247
247
|
- !ruby/object:Gem::Version
|
248
248
|
version: '0'
|
249
249
|
requirements: []
|
250
|
-
|
251
|
-
rubygems_version: 2.6.14
|
250
|
+
rubygems_version: 3.0.3
|
252
251
|
signing_key:
|
253
252
|
specification_version: 4
|
254
253
|
summary: Hatchet is a an integration testing library for developing Heroku buildpacks.
|