hu 1.5.11 → 1.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/hu/deploy.rb +1 -1
- data/lib/hu/scale.rb +26 -8
- data/lib/hu/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6784b1a6805d7d76cfa5367ab4d1fb41a05b3588
|
4
|
+
data.tar.gz: 0ef6a1e859a94512001d10012d1d320367cf009c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e810751a2550feddab6651943df6d41adb964cfe317575ed3309f86c3f0913dc08baad0b4d8cd7e936618f66df23af4ec90ab1f4a6d912e582c3cc6a6b457f66
|
7
|
+
data.tar.gz: 7e3643ff96514523fa621727df32f27957f9a57f3815b6ad3e2fab1a08e49512f83a37b353c9164fa435b93798f858e8ecec44b1ce652f89009362822f9d2af2
|
data/lib/hu/deploy.rb
CHANGED
@@ -789,7 +789,7 @@ module Hu
|
|
789
789
|
puts
|
790
790
|
puts 'develop is at ' + revs[:develop].bright + ", release/#{release_tag} is at " + revs[:release].bright + '.'
|
791
791
|
puts
|
792
|
-
puts 'This usually means the release branch is old and does
|
792
|
+
puts 'This usually means the release branch is old and does'
|
793
793
|
puts 'not reflect what you actually want to deploy right now.'
|
794
794
|
puts
|
795
795
|
choice = prompt.select('What shall we do?') do |menu|
|
data/lib/hu/scale.rb
CHANGED
@@ -12,7 +12,9 @@ module Hu
|
|
12
12
|
ram: 512,
|
13
13
|
cpu: 1,
|
14
14
|
dedicated: false,
|
15
|
-
usd: 0
|
15
|
+
usd: 0,
|
16
|
+
letter: 'f',
|
17
|
+
color: "\e[0;32;1m",
|
16
18
|
},
|
17
19
|
{
|
18
20
|
id: 'hobby',
|
@@ -21,7 +23,9 @@ module Hu
|
|
21
23
|
ram: 512,
|
22
24
|
cpu: 1,
|
23
25
|
dedicated: false,
|
24
|
-
usd: 7
|
26
|
+
usd: 7,
|
27
|
+
letter: 'H',
|
28
|
+
color: "\e[0;32m",
|
25
29
|
},
|
26
30
|
{
|
27
31
|
id: 'standard-1x',
|
@@ -30,7 +34,9 @@ module Hu
|
|
30
34
|
ram: 512,
|
31
35
|
cpu: 1,
|
32
36
|
dedicated: false,
|
33
|
-
usd: 25
|
37
|
+
usd: 25,
|
38
|
+
letter: '1',
|
39
|
+
color: "\e[0;33m",
|
34
40
|
},
|
35
41
|
{
|
36
42
|
id: 'standard-2x',
|
@@ -39,7 +45,9 @@ module Hu
|
|
39
45
|
ram: 1024,
|
40
46
|
cpu: 4,
|
41
47
|
dedicated: false,
|
42
|
-
usd: 50
|
48
|
+
usd: 50,
|
49
|
+
letter: '2',
|
50
|
+
color: "\e[0;33;1m",
|
43
51
|
},
|
44
52
|
{
|
45
53
|
id: 'performance-m',
|
@@ -48,7 +56,9 @@ module Hu
|
|
48
56
|
ram: 2560,
|
49
57
|
cpu: 11,
|
50
58
|
dedicated: true,
|
51
|
-
usd: 250
|
59
|
+
usd: 250,
|
60
|
+
letter: 'M',
|
61
|
+
color: "\e[0;31;1m",
|
52
62
|
},
|
53
63
|
{
|
54
64
|
id: 'performance-l',
|
@@ -57,7 +67,9 @@ module Hu
|
|
57
67
|
ram: 14_336,
|
58
68
|
cpu: 46,
|
59
69
|
dedicated: true,
|
60
|
-
usd: 500
|
70
|
+
usd: 500,
|
71
|
+
letter: 'L',
|
72
|
+
color: "\e[0;35;1m",
|
61
73
|
}
|
62
74
|
].freeze
|
63
75
|
|
@@ -108,7 +120,7 @@ module Hu
|
|
108
120
|
max_app_name_len = state.keys.reduce(0) { |a, e| [a, e.length].max }
|
109
121
|
state.sort.each do |app_name, dyno_types|
|
110
122
|
next if ignored_app?(app_name)
|
111
|
-
row = { 'app' => app_name, 'fH12ML' => '......', 'formation' => "
|
123
|
+
row = { 'app' => app_name, 'fH12ML' => '......', 'formation' => "\e[0mheroku ps:scale -a #{app_name.ljust(max_app_name_len).color(:green).bright}" }
|
112
124
|
cost = 0
|
113
125
|
dyno_types.each do |dyno_type, dynos|
|
114
126
|
dynos.each do |dyno|
|
@@ -121,12 +133,18 @@ module Hu
|
|
121
133
|
else
|
122
134
|
dyno_type_str = dyno_type_str.color(:yellow)
|
123
135
|
quant_colon_type = quant_colon_type.color(:yellow)
|
124
|
-
|
136
|
+
idx = DYNO_TYPES.find { |e| e[:id] == dyno_type }[:index]
|
137
|
+
row['fH12ML'][idx] = 'fH12ML'[idx]
|
125
138
|
end
|
126
139
|
row['formation'] += " #{dyno_type_str}" + '='.color(:black).bright + quant_colon_type.to_s
|
127
140
|
cost += DYNO_TYPES.find { |e| e[:id] == dyno_type }[:usd] * dyno[:quantity]
|
128
141
|
end
|
129
142
|
end
|
143
|
+
new_row = ''.dup
|
144
|
+
row['fH12ML'].each_char do |l|
|
145
|
+
new_row << (DYNO_TYPES.find {|dt| dt[:letter] == l}[:color] + l + "\e[0;30;1m" rescue '.')
|
146
|
+
end
|
147
|
+
row['fH12ML'] = "\e[0;30;1m"+new_row
|
130
148
|
total_cost += cost
|
131
149
|
row['$/mo'] = format '%4d', cost
|
132
150
|
rows << row
|
data/lib/hu/version.rb
CHANGED