hu 1.5.11 → 1.5.12

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: 96baaa904903f82d9d5f2d4cc918746044c9ba08
4
- data.tar.gz: c6cabff7673f6b19fc6e3c0fff0716afc2dd2c0b
3
+ metadata.gz: 6784b1a6805d7d76cfa5367ab4d1fb41a05b3588
4
+ data.tar.gz: 0ef6a1e859a94512001d10012d1d320367cf009c
5
5
  SHA512:
6
- metadata.gz: ccef6f36d02ef9fa6029cd4438e705970415c987bb744815ce76194243f2fc973d67b109b1cc5bfb70e92bc409ffd8299ed98eef590ff89d645d08441355eb61
7
- data.tar.gz: 2f9db5a1f8486253870d6c3efcfc9f28c869df5432f59a49bd2ef01fbe095c90092990da94b07dab5d44102d0e0cf063b0a991b629dc989b477d7b0f664638ad
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 not'
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' => "heroku ps:scale -a #{app_name.ljust(max_app_name_len).color(:green).bright}" }
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
- row['fH12ML'][DYNO_TYPES.find { |e| e[:id] == dyno_type }[:index]] = '*'
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
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Hu
3
- VERSION = '1.5.11'
3
+ VERSION = '1.5.12'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.11
4
+ version: 1.5.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - moe