hiiro 0.1.168 → 0.1.169

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
  SHA256:
3
- metadata.gz: 41432e7100436ebac58392a007d0b2e9713c6f3ca38cce2053f47ac8dc0e8f28
4
- data.tar.gz: c7fcaf6a66c147f7b6205c4517eac3efb12079a372a0272316c85d91fa4dab72
3
+ metadata.gz: d9a90de4bbf5f17d90890078b14a3b5ce6eccd4aed9a7c4a7c7b5fc3b7da4f97
4
+ data.tar.gz: 43f9ef18fd88cfdc7a1535dad5c88c6df56c264ff2fcd659d79e0180730e52b7
5
5
  SHA512:
6
- metadata.gz: ad998519fef38fd1c177bf491aa246392a6ebb0f13ece51defb0a3db9b58e85e0158b3806769ed8d7bd07c00bee8a31b3e87b3a936d84e88bb9f57fbc71e1a8f
7
- data.tar.gz: f6e23ba22315ddf84dcf743459f8781dc925bd0ec5a939466f08d570dad9e2b6bb744f21055c6952f3cf252a104fc51e149cf74ff9460bf4f001fa8822278e5e
6
+ metadata.gz: c69d5f1c2a0eacad95e7e8aefd985c31bcbf8ddc3ab29357806706d5da52dc207eeab9010535d1d8aa9191b485d6dc96a7bc81ac4af416e76d50150e5e9fd441
7
+ data.tar.gz: 0fb174d064742171d5592a79c554582856989b6bbfcba5631ddcf7f8526a8789bd26a1a5b1bffab01d53804cb082319935583a475b43661fc155c06bad60ed17
data/bin/h-misc CHANGED
@@ -9,6 +9,7 @@ Hiiro.run {
9
9
  option(:root, short: :r, desc: 'root path')
10
10
  end
11
11
 
12
+ repo_root = Pathname.new(opts.root || git.root)
12
13
  pwd = Hiiro::Paths.new(Dir.pwd)
13
14
  outside = Hash.new { |h,k| h[k] = [] }
14
15
 
@@ -20,9 +21,10 @@ Hiiro.run {
20
21
 
21
22
  outside.each do |base, links|
22
23
  puts "# symlinks outside of => #{base}"
23
- dest_width = links.map{|l| l.dest.to_s.length }.max
24
+ dest_width = links.map{|l| l.dest_relative_to(repo_root).to_s.length }.max
24
25
  links.each do |link|
25
- printf("%-*s # => %s\n", dest_width, link.dest, link.path)
26
+ rel_dest = link.dest_relative_to(repo_root)
27
+ printf("%-*s # => %s\n", dest_width, rel_dest, link.path)
26
28
  end
27
29
  end
28
30
  end
data/lib/hiiro/paths.rb CHANGED
@@ -33,6 +33,11 @@ class Hiiro
33
33
  path.readlink
34
34
  end
35
35
 
36
+ def dest_relative_to(root)
37
+ abs = (path.dirname + dest).cleanpath
38
+ abs.relative_path_from(Pathname.new(root))
39
+ end
40
+
36
41
  def dest_dir
37
42
  path.directory? ? path : path.dirname
38
43
  end
data/lib/hiiro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.168"
2
+ VERSION = "0.1.169"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiiro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.168
4
+ version: 0.1.169
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota