mmtop 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/term_printer.rb +12 -3
  2. metadata +19 -5
@@ -58,10 +58,19 @@ module MMTop
58
58
  def sep_fill
59
59
  fill * sep.size
60
60
  end
61
+
62
+ def column_value_with_fill(index, str, fill, align)
63
+ fill_str = fill * (table_header_columns[index].size - str.size)
64
+ if align == :left
65
+ str + fill_str
66
+ else
67
+ fill_str + str
68
+ end
69
+ end
61
70
 
62
- def column_value(index, str, fill=" ")
71
+ def column_value(index, str, fill=" ", align=:left)
63
72
  if str.size < table_header_columns[index].size
64
- str + (fill * (table_header_columns[index].size - str.size))
73
+ column_value_with_fill(index, str, fill, align)
65
74
  else
66
75
  str[0..table_header_columns[index].size - 1]
67
76
  end
@@ -121,7 +130,7 @@ module MMTop
121
130
 
122
131
  def print_process(p)
123
132
  return if p.status.nil? || p.status.empty?
124
- str = pipe + " " + column_value(0, " " + p.client)
133
+ str = pipe + " " + column_value(0, p.client, ' ', :right)
125
134
  str += info_sep + column_value(1, p.id ? p.id.to_s : '')
126
135
  str += info_sep + column_value(2, format_time(p.time))
127
136
  str += info_sep
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mmtop
3
3
  version: !ruby/object:Gem::Version
4
- hash: 59
4
+ hash: 57
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 0
10
- version: 0.9.0
9
+ - 1
10
+ version: 0.9.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ben Osheroff
@@ -33,7 +33,7 @@ dependencies:
33
33
  type: :runtime
34
34
  version_requirements: *id001
35
35
  - !ruby/object:Gem::Dependency
36
- name: ruby-debug
36
+ name: getopt-declare
37
37
  prerelease: false
38
38
  requirement: &id002 !ruby/object:Gem::Requirement
39
39
  none: false
@@ -44,8 +44,22 @@ dependencies:
44
44
  segments:
45
45
  - 0
46
46
  version: "0"
47
- type: :development
47
+ type: :runtime
48
48
  version_requirements: *id002
49
+ - !ruby/object:Gem::Dependency
50
+ name: ruby-debug
51
+ prerelease: false
52
+ requirement: &id003 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ hash: 3
58
+ segments:
59
+ - 0
60
+ version: "0"
61
+ type: :development
62
+ version_requirements: *id003
49
63
  description:
50
64
  email:
51
65
  - ben@gimbo.net