obst 0.1.3 → 0.1.4

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
  SHA256:
3
- metadata.gz: 98098746bf391bc2ef384eb8fd5f5a16ed462ecb2392aedafa4ad817a173afb6
4
- data.tar.gz: a96c73fed2dcf4f6a14c695f8da6e08fb8f62e6e93d579d867971453b40b6dd5
3
+ metadata.gz: c1ea9ec553aec1048f197a4313bb6f5bdb82767e78fe793764127e1b798ee5b7
4
+ data.tar.gz: 8cfa17989074c75b146f5979cd30e33ea05a062cc3e1347efb1677dd6c4c2a44
5
5
  SHA512:
6
- metadata.gz: 2a168e81dc31da12781806ebd4ab199ef5554d9293b39d3d7578085fc9bd3b5f1dcb7a0a8cacca5f2af655ba8111e1b4299690c14c7a7573e0ef0413a6468061
7
- data.tar.gz: 5bd90a681ea26bf5b8f599465ab6a47b3a8b51baf913df9211b26792418122294228f7aff8848ed1f25d109e4242409f3aa779e9f08b199c6ab0eebc07f246fe
6
+ metadata.gz: 13b20ea98bc4cedacfee5a11b267f3f2a263fbcadd9d7a3de83061c17af55257701801dca6cabb687236b2c193bd2accfd99d53a9a8ed121471486e6484473c8
7
+ data.tar.gz: a2cda68907af8dd8c15f1f31d00afb977e297e3461bf5bbafc7adbccfc9c06801407dd7a68c0898b19a6585e0c8d6ffa86e598e7be2961e09d5a40cb8d1f8df6
@@ -49,10 +49,23 @@ module Obst
49
49
  end
50
50
 
51
51
  def list_files(record)
52
- record.statuses.each_pair do |name, status|
53
- entry = status.final == :a ? "\t- [[#{name}]] *new !*" : "\t- [[#{name}]]"
54
- @buffer << entry
52
+ group_by_final_status = Hash.new{ |h, k| h[k] = [] }
53
+ record.statuses.each_pair{ |name, status| group_by_final_status[status.final] << name }
54
+
55
+ [
56
+ [:new, :a, '#2db7b5'],
57
+ [:mod, :m, '#d3be03'],
58
+ [:del, :d, '#c71585']
59
+ ].each do |long, short, color|
60
+ files = group_by_final_status[short]
61
+ next if files.empty?
62
+ inline_str = inline(files)
63
+ @buffer << "\t- <font color='#{color}'>#{long} #{files.count}:</font> #{inline_str}"
55
64
  end
56
65
  end
66
+
67
+ def inline(files)
68
+ files.sort!.map{ |name| "[[#{name}]]" }.join(' / ')
69
+ end
57
70
  end
58
71
  end
data/lib/obst/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Obst
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: obst
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - ken
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-25 00:00:00.000000000 Z
11
+ date: 2022-11-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: