heroku_hatchet 1.1.5 → 1.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Rakefile +1 -1
- data/lib/hatchet/app.rb +17 -6
- data/lib/hatchet/version.rb +1 -1
- data/test/hatchet/heroku_api_test.rb +15 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5858aba476c6665c554f78f1e59ff86620441b05
|
4
|
+
data.tar.gz: b720257ac9ec4fef2df697eb48c36f519cdec43d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc750c15ad6d24155300b83d7015b6b4c906ce5222ac730e9bd4d9ec3fac3cfb2ee2c7108becf53658e823e66491feed7c99fa08eb29146ae658fc41a1ecad01
|
7
|
+
data.tar.gz: 4b67d67bc28e56613d9495f448a69447cff1fd58569b3ec1be4869eba55abc0f18513ea1bce3ad5db8a21679774bbcd114fb8e663913ae751d2c8c53f6b2bf3f
|
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
data/lib/hatchet/app.rb
CHANGED
@@ -27,14 +27,23 @@ module Hatchet
|
|
27
27
|
self.class.config
|
28
28
|
end
|
29
29
|
|
30
|
+
def set_config(options = {})
|
31
|
+
options.each do |key, value|
|
32
|
+
heroku.put_config_vars(name, key => value)
|
33
|
+
end
|
34
|
+
end
|
30
35
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
+
def get_config
|
37
|
+
heroku.get_config_vars(name).body
|
38
|
+
end
|
39
|
+
|
40
|
+
def add_database(db_name = 'heroku-postgresql:dev', match_val = "HEROKU_POSTGRESQL_[A-Z]+_URL")
|
41
|
+
Hatchet::RETRIES.times.retry do
|
42
|
+
heroku.post_addon(name, db_name)
|
43
|
+
_, value = get_config.detect {|k, v| k.match(/#{match_val}/) }
|
44
|
+
set_config('DATABASE_URL' => value)
|
45
|
+
end
|
36
46
|
end
|
37
|
-
end
|
38
47
|
|
39
48
|
# runs a command on heroku similar to `$ heroku run #foo`
|
40
49
|
# but programatically and with more control
|
@@ -68,8 +77,10 @@ module Hatchet
|
|
68
77
|
|
69
78
|
# creates a new heroku app via the API
|
70
79
|
def setup!
|
80
|
+
return self if @app_is_setup
|
71
81
|
heroku.post_app(name: name)
|
72
82
|
@app_is_setup = true
|
83
|
+
self
|
73
84
|
end
|
74
85
|
|
75
86
|
def push!
|
data/lib/hatchet/version.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class HerokuApiTest < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def test_config_vars
|
6
|
+
runner = Hatchet::Runner.new("no_lockfile").setup!
|
7
|
+
expected = {}
|
8
|
+
assert_equal expected, runner.get_config
|
9
|
+
runner.set_config("foo" => "bar")
|
10
|
+
expected = {"foo" => "bar"}
|
11
|
+
assert_equal expected, runner.get_config
|
12
|
+
ensure
|
13
|
+
runner.teardown!
|
14
|
+
end
|
15
|
+
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.
|
4
|
+
version: 1.1.6
|
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-
|
11
|
+
date: 2013-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: heroku-api
|
@@ -216,6 +216,7 @@ files:
|
|
216
216
|
- test/hatchet/anvil_test.rb
|
217
217
|
- test/hatchet/config_test.rb
|
218
218
|
- test/hatchet/git_test.rb
|
219
|
+
- test/hatchet/heroku_api_test.rb
|
219
220
|
- test/hatchet/multi_cmd_runner_test.rb
|
220
221
|
- test/hatchet/runner_test.rb
|
221
222
|
- test/test_helper.rb
|
@@ -285,6 +286,7 @@ test_files:
|
|
285
286
|
- test/hatchet/anvil_test.rb
|
286
287
|
- test/hatchet/config_test.rb
|
287
288
|
- test/hatchet/git_test.rb
|
289
|
+
- test/hatchet/heroku_api_test.rb
|
288
290
|
- test/hatchet/multi_cmd_runner_test.rb
|
289
291
|
- test/hatchet/runner_test.rb
|
290
292
|
- test/test_helper.rb
|