termcity 0.4.1 → 0.5.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6e1c39c41f6dbc54340c207b937d7356de7a1e07
4
- data.tar.gz: c5c362e06caad468490f03b7da10ed61d457b37d
3
+ metadata.gz: f1fe6111612429630e0d33e5812ca88f64a64277
4
+ data.tar.gz: 2ddf23d6ed8c78cc5f0430a7cd8f1e3bb45d6613
5
5
  SHA512:
6
- metadata.gz: e1272d632e21ddd22b65e74c1b1a9fca30aeb12dfba7a09d975c62c010ee0f9f5be5df51d077e2fe36a98d9624af6d1eec98c5b8d6f349e5b71be8c1516a7a78
7
- data.tar.gz: a0abf764f1fb442eedc087aeb497e3bd2713f357320c60296f1ac748cb0a28e26b6194ba4a4f93e8750cec21d6292095afee33bccfd9173660595d6ae7e898f4
6
+ metadata.gz: 3e427dd57a1a013ee9b51654b05ad08e5ba64c7291e4e6eb65aa93bf2f148f1808eafa7730bb64a08fc3352e7ae1b9d54efe3c78add9042fa598ca8afd98ce53
7
+ data.tar.gz: 4bb7a19d404fc7a2a1d5f84e31b951f5a33b83f285cbba8dd9ec6a2b97792cb0aae3a322902f19a2073505b7c682590c5832ce010abc6877bf27a6866b7f0488
@@ -13,8 +13,12 @@ module Termcity
13
13
  def format(summary)
14
14
  rows = summary.builds.map do |raw:, status:|
15
15
  cols = []
16
- cols << simple_formatter.status_string(status)
17
- cols << linkify(raw.fetch("web_url"))
16
+
17
+ text = simple_formatter.status_string(status) { |t|
18
+ "#{linkify(t, raw.fetch("web_url"))}#{" "*(10-t.length)}"
19
+ }
20
+
21
+ cols << linkify(text, raw.fetch("web_url"))
18
22
  cols << raw.fetch("build_type")
19
23
  cols.join(" ")
20
24
  end
@@ -22,8 +26,8 @@ module Termcity
22
26
  @io.puts(simple_formatter.summarize(summary, rows))
23
27
  end
24
28
 
25
- def linkify(url)
26
- "\e]8;;#{url}\aLink\e]8;;\a"
29
+ def linkify(text, url)
30
+ "\e]8;;#{url}\a#{text}\e]8;;\a"
27
31
  end
28
32
  end
29
33
  end
@@ -46,7 +46,13 @@ module Termcity
46
46
  name = "#{name},q" if re_enqueued
47
47
  color = COLORS[type]
48
48
 
49
- colorize(name.ljust(10), color)
49
+ text =
50
+ if block_given?
51
+ yield(name)
52
+ else
53
+ name.ljust(10)
54
+ end
55
+ colorize(text, color)
50
56
  end
51
57
 
52
58
  def summarize(summary, rows)
@@ -1,3 +1,3 @@
1
1
  module Termcity
2
- VERSION = "0.4.1"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: termcity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Kinnecom
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-24 00:00:00.000000000 Z
11
+ date: 2018-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler