hiiro 0.1.128 → 0.1.130
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 +4 -4
- data/bin/h-misc +28 -0
- data/bin/testlink +1 -0
- data/lib/hiiro/glob.rb +7 -0
- data/lib/hiiro/paths.rb +44 -0
- data/lib/hiiro/version.rb +1 -1
- metadata +5 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9ee15221ef5fd0d6dd334387e083049fc53cec41df755c270451f1329e63804a
|
|
4
|
+
data.tar.gz: 89df78fc18b86391dced6ec9e7f1dbb597f6f6549a3c627cc5b2898c2dd23b94
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6e043a980f853c53b429500047fc872092e21488a45ad9bfd1cdf64b4fab56d1513423cfe7af061988c468cb10272935cca9ceadad059d972c03c1ba51c152d0
|
|
7
|
+
data.tar.gz: 3abc9a1acfd9ff38060b6d8c01accae3efa5cea58113b8f0b1378b1270054b0e95543797400b9c89a5ed941c40679ab51299b447e86ccdf676189f561fb8dae6
|
data/bin/h-misc
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require 'hiiro'
|
|
4
|
+
|
|
5
|
+
Hiiro.run {
|
|
6
|
+
add_subcmd(:symlinks) do |*args|
|
|
7
|
+
opts = Hiiro::Options.parse(args) do
|
|
8
|
+
option(:root, short: :r, desc: 'root path')
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
pwd = Hiiro::Paths.new(Dir.pwd)
|
|
12
|
+
outside_basedir = opts.args.inject({}) do |h,basedir|
|
|
13
|
+
symlinks = pwd.symlinks_in(basedir)
|
|
14
|
+
|
|
15
|
+
outside_dir = symlinks
|
|
16
|
+
.reject{|l| l.dest_in_dir?(basedir) }
|
|
17
|
+
.tap do |outside|
|
|
18
|
+
outside.each do |link,dest|
|
|
19
|
+
puts
|
|
20
|
+
puts "LINK: #{link}"
|
|
21
|
+
puts "DEST: #{dest}"
|
|
22
|
+
puts "is outside => #{real_base}"
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
}
|
|
28
|
+
|
data/bin/testlink
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
../exe/h
|
data/lib/hiiro/glob.rb
ADDED
data/lib/hiiro/paths.rb
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require "hiiro"
|
|
4
|
+
require "delegate"
|
|
5
|
+
|
|
6
|
+
class Hiiro
|
|
7
|
+
class Paths
|
|
8
|
+
attr_reader :base
|
|
9
|
+
|
|
10
|
+
def initialize(base=Dir.pwd)
|
|
11
|
+
@base = Pathname.new base
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def from_base(file)
|
|
15
|
+
path = Pathname.new(file)
|
|
16
|
+
path.relative_path_from(base)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def symlinks_in(path)
|
|
20
|
+
subdir = Pathname.new(path)
|
|
21
|
+
|
|
22
|
+
subdir.find
|
|
23
|
+
.select(&:symlink?)
|
|
24
|
+
.map { |link| Symlink.new(link) }
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
class Symlink < SimpleDelegator
|
|
28
|
+
def path
|
|
29
|
+
@path ||= Pathname.new(__getobj__)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def dest
|
|
33
|
+
path.readlink
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def dest_in_dir?(dir)
|
|
37
|
+
dir = Pathname.new(dir)
|
|
38
|
+
|
|
39
|
+
relpath = dest.relative_path_from(dir)
|
|
40
|
+
relpath.descend.first.to_s != '..'
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
data/lib/hiiro/version.rb
CHANGED
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.
|
|
4
|
+
version: 0.1.130
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joshua Toyota
|
|
@@ -91,6 +91,7 @@ files:
|
|
|
91
91
|
- bin/h-commit
|
|
92
92
|
- bin/h-config
|
|
93
93
|
- bin/h-link
|
|
94
|
+
- bin/h-misc
|
|
94
95
|
- bin/h-pane
|
|
95
96
|
- bin/h-plugin
|
|
96
97
|
- bin/h-pr
|
|
@@ -100,6 +101,7 @@ files:
|
|
|
100
101
|
- bin/h-todo
|
|
101
102
|
- bin/h-window
|
|
102
103
|
- bin/h-wtree
|
|
104
|
+
- bin/testlink
|
|
103
105
|
- docs/README.md
|
|
104
106
|
- docs/docker-testing-guide.md
|
|
105
107
|
- docs/h-buffer.md
|
|
@@ -121,9 +123,11 @@ files:
|
|
|
121
123
|
- lib/hiiro/git/remote.rb
|
|
122
124
|
- lib/hiiro/git/worktree.rb
|
|
123
125
|
- lib/hiiro/git/worktrees.rb
|
|
126
|
+
- lib/hiiro/glob.rb
|
|
124
127
|
- lib/hiiro/matcher.rb
|
|
125
128
|
- lib/hiiro/notification.rb
|
|
126
129
|
- lib/hiiro/options.rb
|
|
130
|
+
- lib/hiiro/paths.rb
|
|
127
131
|
- lib/hiiro/queue.rb
|
|
128
132
|
- lib/hiiro/shell.rb
|
|
129
133
|
- lib/hiiro/tasks.rb
|