manageheroku 0.0.4 → 0.0.5

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: a2b7e0c6e489cca7b8565cae44c9a3c3149d2a9d
4
- data.tar.gz: f2cd5ab4739b3854ff62b4a30b7bbb503a4b10fe
3
+ metadata.gz: 09e7cc0523270cae6cdec9bcba89f698d7964c09
4
+ data.tar.gz: 4110ae0b1270f9c2e4537362afbad97aebb251a6
5
5
  SHA512:
6
- metadata.gz: 283d3963c2f5244d3c567d8c5cc24048a8125996dcfcd60f6e34bb97fa8e25d6366b47ceb68058edd9619182a2632026744fef7b47fc7c610ba04d6108a9f363
7
- data.tar.gz: 4473152d94246b52b250d23185f5af453f720bab81f8f340e5507a8e6f0bb88860722149ff2eb493932750afe3c932b87fdec76bb4c05d0cd4e9ba620c46803d
6
+ metadata.gz: f5e82e5b8a699e17a4fedbee6d7732d0ca02d3d588d4569ceee6097a1fa6e7e3b2645e2104eefe61328f48996747dbc344f1bcb6a55cb6ff9c692932d0a2a77b
7
+ data.tar.gz: f4717d4ec0bf6a67ffd733b1d9ad2a7386f2e51bdac1ee4e5c5fd11f7c12229d73942f5db2b6083432700f12b5b9441248498c9a75c5e35e28a1b047a6b60d96
@@ -13,11 +13,13 @@ module Manageheroku
13
13
 
14
14
  def formations
15
15
  formation_objects = @conf_data["formations"]
16
+ return [] unless formation_objects
16
17
  formation_objects.map{|formation_object| Manageheroku::Formation.new(formation_object["name"], formation_object["procs"]) }
17
18
  end
18
19
 
19
20
  def apps
20
21
  app_objects = @conf_data["apps"]
22
+ return [] unless app_objects
21
23
  app_objects.map{|app_object| Manageheroku::App.new(app_object["name"], app_object)}
22
24
  end
23
25
  end
@@ -1,3 +1,3 @@
1
1
  module Manageheroku
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -19,6 +19,18 @@ class ConfTest < MiniTest::Test
19
19
  conf.apps.last.name.must_equal "myapp-staging"
20
20
  end
21
21
 
22
+ it "loads fine if there are no apps" do
23
+ conf = Manageheroku::Conf.new(File.join(File.dirname(__FILE__), 'sample_conf_no_apps.yml'))
24
+ conf.formations.first.name.must_equal "myapp-development"
25
+ conf.formations.last.name.must_equal "myapp-performance"
26
+ end
27
+
28
+ it "loads fine if there are no formations" do
29
+ conf = Manageheroku::Conf.new(File.join(File.dirname(__FILE__), 'sample_conf_no_formations.yml'))
30
+ conf.apps.first.name.must_equal "myapp-development"
31
+ conf.apps.last.name.must_equal "myapp-staging"
32
+ end
33
+
22
34
  it "supports ERB magic in the config file" do
23
35
  ENV["TEST_VAL"] = "erb_is_great"
24
36
  conf = Manageheroku::Conf.new(File.join(File.dirname(__FILE__), 'sample_conf.yml'))
@@ -0,0 +1,28 @@
1
+ oauth-token: <%= ENV["TEST_VAL"] || "the-magic-oauth-token" %>
2
+
3
+ apps:
4
+ - name: "myapp-development"
5
+ maintenance: true
6
+ - name: "myapp-staging"
7
+ maintenance: true
8
+
9
+ formations:
10
+ - name: "myapp-development"
11
+ procs:
12
+ - process: "web"
13
+ quantity: 0
14
+ - process: "resque-low"
15
+ quantity: 0
16
+ - name: "myapp-staging"
17
+ procs:
18
+ - process: "web"
19
+ quantity: 0
20
+ - process: "resque-low"
21
+ quantity: 0
22
+ - name: "myapp-performance"
23
+ procs:
24
+ - process: "web"
25
+ quantity: 0
26
+ size: "2X"
27
+ - process: "resque-low"
28
+ quantity: 0
@@ -0,0 +1,7 @@
1
+ oauth-token: <%= ENV["TEST_VAL"] || "the-magic-oauth-token" %>
2
+
3
+ apps:
4
+ - name: "myapp-development"
5
+ maintenance: true
6
+ - name: "myapp-staging"
7
+ maintenance: true
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manageheroku
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Cronemeyer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-12 00:00:00.000000000 Z
11
+ date: 2016-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: platform-api
@@ -74,6 +74,8 @@ files:
74
74
  - test/conf_test.rb
75
75
  - test/heroku_test.rb
76
76
  - test/sample_conf.yml
77
+ - test/sample_conf_no_apps.yml
78
+ - test/sample_conf_no_formations.yml
77
79
  - test/test_helper.rb
78
80
  homepage: ''
79
81
  licenses:
@@ -95,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
97
  version: '0'
96
98
  requirements: []
97
99
  rubyforge_project:
98
- rubygems_version: 2.5.1
100
+ rubygems_version: 2.2.2
99
101
  signing_key:
100
102
  specification_version: 4
101
103
  summary: Manage Heroku Apps from config files
@@ -103,4 +105,6 @@ test_files:
103
105
  - test/conf_test.rb
104
106
  - test/heroku_test.rb
105
107
  - test/sample_conf.yml
108
+ - test/sample_conf_no_apps.yml
109
+ - test/sample_conf_no_formations.yml
106
110
  - test/test_helper.rb