hiiro 0.1.97 → 0.1.99
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-branch +2 -8
- data/exe/h +36 -5
- data/exe/hiiro +86 -0
- data/lib/hiiro/version.rb +1 -1
- data/lib/hiiro.rb +4 -0
- data/plugins/notify.rb +1 -1
- data/plugins/project.rb +1 -1
- data/plugins/tasks.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b479873293dbb050b59b4b48fb44c0c8025ab9eacd30b18c23ac1603adc02b57
|
|
4
|
+
data.tar.gz: 24a2e55806f6005e77b404f673ea734c95079769f7bbb67dce11b6979a45a6da
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d56e0b230283bd5f20dfc9954d81522ae54978aef4d34e338565dd1d85bf7d6ac45b16fce11973fdbeb3647687a0dba5be014c2a147274e2b29635ff25648934
|
|
7
|
+
data.tar.gz: a45fb54fdd7de933aadd8bbae81afe8769f077c83cc7c14c625206177a957034973ee4f6bc75f418467c9239f63bc2ebcd5676dda668c2bf40a27b4ffcc4cb30
|
data/bin/h-branch
CHANGED
|
@@ -143,7 +143,7 @@ Hiiro.run(*ARGV, plugins: [Tasks]) do
|
|
|
143
143
|
end
|
|
144
144
|
end
|
|
145
145
|
|
|
146
|
-
|
|
146
|
+
add_subcmd(:co, :checkout) { |branch = nil, *checkout_args|
|
|
147
147
|
unless branch
|
|
148
148
|
# Use sk to select a branch
|
|
149
149
|
branches = git.branches(sort_by: 'authordate', ignore_case: true)
|
|
@@ -159,10 +159,7 @@ Hiiro.run(*ARGV, plugins: [Tasks]) do
|
|
|
159
159
|
system('git', 'checkout', branch, *checkout_args)
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
add_subcmd(:
|
|
163
|
-
add_subcmd(:co, &checkout_branch)
|
|
164
|
-
|
|
165
|
-
remove_branch = lambda { |branch = nil, *remove_args|
|
|
162
|
+
add_subcmd(:rm, :remove) { |branch = nil, *remove_args|
|
|
166
163
|
unless branch
|
|
167
164
|
# Use sk to select a branch
|
|
168
165
|
branches = git.branches(sort_by: 'authordate', ignore_case: true)
|
|
@@ -178,9 +175,6 @@ Hiiro.run(*ARGV, plugins: [Tasks]) do
|
|
|
178
175
|
system('git', 'branch', '-d', branch, *remove_args)
|
|
179
176
|
}
|
|
180
177
|
|
|
181
|
-
add_subcmd(:remove, &remove_branch)
|
|
182
|
-
add_subcmd(:rm, &remove_branch)
|
|
183
|
-
|
|
184
178
|
add_subcmd(:duplicate) { |new_name = nil, source = nil|
|
|
185
179
|
unless new_name
|
|
186
180
|
puts "Usage: h branch duplicate <new_name> [source_branch]"
|
data/exe/h
CHANGED
|
@@ -13,6 +13,10 @@ Hiiro.run(*ARGV, cwd: Dir.pwd, plugins: [Tasks]) do
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
add_subcmd(:setup) do |*args|
|
|
16
|
+
# Detect how the command was invoked to determine prefix
|
|
17
|
+
invoked_as = File.basename($0)
|
|
18
|
+
prefix = invoked_as.split("-").first # handles "h", "hiiro", or custom names
|
|
19
|
+
|
|
16
20
|
gem_root = File.expand_path("../..", __FILE__)
|
|
17
21
|
source_plugins = File.join(gem_root, "plugins")
|
|
18
22
|
source_bins = File.join(gem_root, "bin")
|
|
@@ -34,19 +38,46 @@ Hiiro.run(*ARGV, cwd: Dir.pwd, plugins: [Tasks]) do
|
|
|
34
38
|
|
|
35
39
|
puts
|
|
36
40
|
|
|
37
|
-
# Copy bin scripts
|
|
41
|
+
# Copy bin scripts, renaming from h-* to #{prefix}-*
|
|
38
42
|
bin_files = Dir["#{source_bins}/h-*"]
|
|
39
43
|
if bin_files.any?
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
bin_files.each do |src|
|
|
45
|
+
old_name = File.basename(src)
|
|
46
|
+
new_name = old_name.sub(/^h-/, "#{prefix}-")
|
|
47
|
+
dest_path = File.join(dest_bin, new_name)
|
|
48
|
+
FileUtils.cp(src, dest_path)
|
|
49
|
+
FileUtils.chmod(0755, dest_path)
|
|
50
|
+
end
|
|
42
51
|
puts "Installed #{bin_files.size} subcommands to #{dest_bin}"
|
|
43
|
-
bin_files.each
|
|
52
|
+
bin_files.each do |f|
|
|
53
|
+
old_name = File.basename(f)
|
|
54
|
+
new_name = old_name.sub(/^h-/, "#{prefix}-")
|
|
55
|
+
puts " - #{new_name}"
|
|
56
|
+
end
|
|
44
57
|
else
|
|
45
58
|
puts "No subcmds found in #{source_bins}"
|
|
46
59
|
end
|
|
47
60
|
|
|
48
61
|
puts
|
|
49
|
-
|
|
62
|
+
|
|
63
|
+
# Check if ~/bin is in PATH
|
|
64
|
+
home_bin = File.expand_path("~/bin")
|
|
65
|
+
path_dirs = ENV["PATH"].to_s.split(File::PATH_SEPARATOR)
|
|
66
|
+
if path_dirs.any? { |dir| File.expand_path(dir) == home_bin }
|
|
67
|
+
puts "Setup complete! ~/bin is already in your PATH."
|
|
68
|
+
else
|
|
69
|
+
puts "Setup complete!"
|
|
70
|
+
puts
|
|
71
|
+
puts "\e[33mWarning:\e[0m ~/bin is not in your PATH."
|
|
72
|
+
puts
|
|
73
|
+
puts "Add this to your shell config (~/.bashrc, ~/.zshrc, etc.):"
|
|
74
|
+
puts
|
|
75
|
+
puts " export PATH=\"$HOME/bin:$PATH\""
|
|
76
|
+
puts
|
|
77
|
+
puts "Then reload your shell or run:"
|
|
78
|
+
puts
|
|
79
|
+
puts " source ~/.bashrc # or ~/.zshrc"
|
|
80
|
+
end
|
|
50
81
|
end
|
|
51
82
|
|
|
52
83
|
add_subcmd(:alert) do |*args|
|
data/exe/hiiro
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require "hiiro"
|
|
4
|
+
require "fileutils"
|
|
5
|
+
|
|
6
|
+
Hiiro.run(*ARGV, cwd: Dir.pwd, plugins: [Tasks]) do
|
|
7
|
+
add_subcmd(:version) { |*args|
|
|
8
|
+
puts Hiiro::VERSION
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
add_subcmd(:ping) { |*args|
|
|
12
|
+
puts "pong"
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
add_subcmd(:setup) do |*args|
|
|
16
|
+
# Detect how the command was invoked to determine prefix
|
|
17
|
+
invoked_as = File.basename($0)
|
|
18
|
+
prefix = invoked_as.split("-").first # handles "h", "hiiro", or custom names
|
|
19
|
+
|
|
20
|
+
gem_root = File.expand_path("../..", __FILE__)
|
|
21
|
+
source_plugins = File.join(gem_root, "plugins")
|
|
22
|
+
source_bins = File.join(gem_root, "bin")
|
|
23
|
+
dest_plugins = File.expand_path("~/.config/hiiro/plugins")
|
|
24
|
+
dest_bin = File.expand_path("~/bin")
|
|
25
|
+
|
|
26
|
+
FileUtils.mkdir_p(dest_plugins)
|
|
27
|
+
FileUtils.mkdir_p(dest_bin)
|
|
28
|
+
|
|
29
|
+
# Copy plugins
|
|
30
|
+
plugin_files = Dir["#{source_plugins}/*.rb"]
|
|
31
|
+
if plugin_files.any?
|
|
32
|
+
FileUtils.cp(plugin_files, dest_plugins)
|
|
33
|
+
puts "Installed #{plugin_files.size} plugins to #{dest_plugins}"
|
|
34
|
+
plugin_files.each { |f| puts " - #{File.basename(f)}" }
|
|
35
|
+
else
|
|
36
|
+
puts "No plugins found in #{source_plugins}"
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
puts
|
|
40
|
+
|
|
41
|
+
# Copy bin scripts, renaming from h-* to #{prefix}-*
|
|
42
|
+
bin_files = Dir["#{source_bins}/h-*"]
|
|
43
|
+
if bin_files.any?
|
|
44
|
+
bin_files.each do |src|
|
|
45
|
+
old_name = File.basename(src)
|
|
46
|
+
new_name = old_name.sub(/^h-/, "#{prefix}-")
|
|
47
|
+
dest_path = File.join(dest_bin, new_name)
|
|
48
|
+
FileUtils.cp(src, dest_path)
|
|
49
|
+
FileUtils.chmod(0755, dest_path)
|
|
50
|
+
end
|
|
51
|
+
puts "Installed #{bin_files.size} subcommands to #{dest_bin}"
|
|
52
|
+
bin_files.each do |f|
|
|
53
|
+
old_name = File.basename(f)
|
|
54
|
+
new_name = old_name.sub(/^h-/, "#{prefix}-")
|
|
55
|
+
puts " - #{new_name}"
|
|
56
|
+
end
|
|
57
|
+
else
|
|
58
|
+
puts "No subcmds found in #{source_bins}"
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
puts
|
|
62
|
+
|
|
63
|
+
# Check if ~/bin is in PATH
|
|
64
|
+
home_bin = File.expand_path("~/bin")
|
|
65
|
+
path_dirs = ENV["PATH"].to_s.split(File::PATH_SEPARATOR)
|
|
66
|
+
if path_dirs.any? { |dir| File.expand_path(dir) == home_bin }
|
|
67
|
+
puts "Setup complete! ~/bin is already in your PATH."
|
|
68
|
+
else
|
|
69
|
+
puts "Setup complete!"
|
|
70
|
+
puts
|
|
71
|
+
puts "\e[33mWarning:\e[0m ~/bin is not in your PATH."
|
|
72
|
+
puts
|
|
73
|
+
puts "Add this to your shell config (~/.bashrc, ~/.zshrc, etc.):"
|
|
74
|
+
puts
|
|
75
|
+
puts " export PATH=\"$HOME/bin:$PATH\""
|
|
76
|
+
puts
|
|
77
|
+
puts "Then reload your shell or run:"
|
|
78
|
+
puts
|
|
79
|
+
puts " source ~/.bashrc # or ~/.zshrc"
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
add_subcmd(:alert) do |*args|
|
|
84
|
+
Hiiro::Notification.show(self)
|
|
85
|
+
end
|
|
86
|
+
end
|
data/lib/hiiro/version.rb
CHANGED
data/lib/hiiro.rb
CHANGED
data/plugins/notify.rb
CHANGED
data/plugins/project.rb
CHANGED
data/plugins/tasks.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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.99
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joshua Toyota
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-02-
|
|
11
|
+
date: 2026-02-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: pry
|
|
@@ -58,6 +58,7 @@ email:
|
|
|
58
58
|
- jearsh+rubygems@gmail.com
|
|
59
59
|
executables:
|
|
60
60
|
- h
|
|
61
|
+
- hiiro
|
|
61
62
|
extensions: []
|
|
62
63
|
extra_rdoc_files: []
|
|
63
64
|
files:
|
|
@@ -93,6 +94,7 @@ files:
|
|
|
93
94
|
- docs/h-window.md
|
|
94
95
|
- editboth
|
|
95
96
|
- exe/h
|
|
97
|
+
- exe/hiiro
|
|
96
98
|
- hiiro.gemspec
|
|
97
99
|
- lib/hiiro.rb
|
|
98
100
|
- lib/hiiro/fuzzyfind.rb
|