hiiro 0.1.319 → 0.1.321
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/CHANGELOG.md +14 -0
- data/bin/h-config +10 -15
- data/exe/h +3 -2
- data/lib/hiiro/config.rb +7 -0
- data/lib/hiiro/tmux/session.rb +4 -0
- data/lib/hiiro/version.rb +1 -1
- data/lib/hiiro.rb +4 -0
- data/plugins/project.rb +18 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 155f21221068bb182837aa80c7b920edfb592d46003cc697761441fca7e104d4
|
|
4
|
+
data.tar.gz: c911e69d3f63924790edd1103f299450ee19bbf70587f54ab205817a0ed9956b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e7f3f13b81a41a625160d27c7e90a093f20678cd835f5ef1eadc95999fa00c17b41eaac793135389573746e233120b41f94363f87e59bbffac1357c9a573db47
|
|
7
|
+
data.tar.gz: 195f053e63a71b2975b4fb29addb85893e91012b1482e08547169e762d4651d9397c0a228b9e29735b3e16928d37f2cee906281ed0e674155366806590e7bdaa
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.321] - 2026-04-01
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
- Extract `open_config` to `Hiiro::Config.open` singleton method; simplify parameter order from `dir:, file:` to positional `file, dir: nil`
|
|
7
|
+
- Update all config subcommands to use new `Hiiro::Config.open` interface
|
|
8
|
+
|
|
9
|
+
## [0.1.320] - 2026-04-01
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- Extract `open_config` helper to Hiiro instance method for reuse across config subcommands
|
|
13
|
+
- Refactor `h version --all` to use `Hiiro::Rbenv.capture` with clearer output formatting
|
|
14
|
+
- Add `to_s` method to `Hiiro::Tmux::Session` for string representation; rename existing `display` method for consistency
|
|
15
|
+
- Extract `project_dirs` and `projects_from_config` to singleton methods in Project plugin for testability
|
|
16
|
+
|
|
3
17
|
## [0.1.319] - 2026-04-01
|
|
4
18
|
|
|
5
19
|
### Added
|
data/bin/h-config
CHANGED
|
@@ -3,51 +3,46 @@
|
|
|
3
3
|
require 'hiiro'
|
|
4
4
|
|
|
5
5
|
Hiiro.run(*ARGV) {
|
|
6
|
-
open_config = ->(dir:, file:) {
|
|
7
|
-
full_path = File.expand_path(File.join(dir, file))
|
|
8
|
-
Dir.chdir(File.expand_path(dir))
|
|
9
|
-
edit_files(full_path)
|
|
10
|
-
}
|
|
11
6
|
add_subcmd(:vim) {
|
|
12
7
|
dir = '~/.config/nvim'
|
|
13
8
|
file = File.exist?(File.expand_path('~/.config/nvim/init.lua')) ? 'init.lua' : 'init.vim'
|
|
14
|
-
open_config
|
|
9
|
+
open_config(file, dir: dir)
|
|
15
10
|
}
|
|
16
11
|
|
|
17
12
|
add_subcmd(:git) {
|
|
18
13
|
make_child(subcmd, *args) {
|
|
19
14
|
add_subcmd(:global) {
|
|
20
|
-
open_config
|
|
15
|
+
open_config('.gitconfig', dir: '~')
|
|
21
16
|
}
|
|
22
17
|
|
|
23
18
|
add_subcmd(:ignore) {
|
|
24
|
-
open_config
|
|
19
|
+
open_config('ignore', dir: '~/.config/git')
|
|
25
20
|
}
|
|
26
21
|
|
|
27
22
|
add_subcmd(:local) {
|
|
28
|
-
root = `git rev-parse --show-toplevel`.chomp
|
|
29
|
-
open_config
|
|
23
|
+
root = `git rev-parse --show-toplevel`.chomp
|
|
24
|
+
open_config('.git/config', dir: root)
|
|
30
25
|
}
|
|
31
26
|
}.run
|
|
32
27
|
}
|
|
33
28
|
|
|
34
29
|
add_subcmd(:tmux) {
|
|
35
|
-
open_config
|
|
30
|
+
open_config('.tmux.conf', dir: '~')
|
|
36
31
|
}
|
|
37
32
|
|
|
38
33
|
add_subcmd(:zsh) {
|
|
39
|
-
open_config
|
|
34
|
+
open_config('.zshrc', dir: '~')
|
|
40
35
|
}
|
|
41
36
|
|
|
42
37
|
add_subcmd(:profile) {
|
|
43
|
-
open_config
|
|
38
|
+
open_config('.zprofile', dir: '~')
|
|
44
39
|
}
|
|
45
40
|
|
|
46
41
|
add_subcmd(:starship) {
|
|
47
|
-
open_config
|
|
42
|
+
open_config('starship.toml', dir: '~/.config/starship')
|
|
48
43
|
}
|
|
49
44
|
|
|
50
45
|
add_subcmd(:claude) {
|
|
51
|
-
open_config
|
|
46
|
+
open_config('settings.json', dir: '~/.claude')
|
|
52
47
|
}
|
|
53
48
|
}
|
data/exe/h
CHANGED
|
@@ -17,8 +17,9 @@ Hiiro.run(*ARGV, cwd: Dir.pwd, tasks: true) do
|
|
|
17
17
|
|
|
18
18
|
add_cmd(:version, opts: %i[all]) { |*args|
|
|
19
19
|
if @opts.all
|
|
20
|
-
Hiiro::Rbenv.
|
|
21
|
-
|
|
20
|
+
Hiiro::Rbenv.versions.each do |ver|
|
|
21
|
+
output = Hiiro::Rbenv.capture('h', 'version', version: ver).strip
|
|
22
|
+
puts "ruby v#{ver} => #{output}"
|
|
22
23
|
end
|
|
23
24
|
else
|
|
24
25
|
puts Hiiro::VERSION
|
data/lib/hiiro/config.rb
CHANGED
|
@@ -4,6 +4,13 @@ class Hiiro
|
|
|
4
4
|
DATA_DIR = File.join(Dir.home, '.local/share/hiiro')
|
|
5
5
|
|
|
6
6
|
class << self
|
|
7
|
+
def open(file, dir: nil)
|
|
8
|
+
dir_path = File.expand_path(dir || '~')
|
|
9
|
+
full_path = File.expand_path(file, dir_path)
|
|
10
|
+
Dir.chdir(dir_path)
|
|
11
|
+
system(ENV['EDITOR'] || 'vim', full_path)
|
|
12
|
+
end
|
|
13
|
+
|
|
7
14
|
def path(relpath='')
|
|
8
15
|
File.join(BASE_DIR, relpath)
|
|
9
16
|
end
|
data/lib/hiiro/tmux/session.rb
CHANGED
data/lib/hiiro/version.rb
CHANGED
data/lib/hiiro.rb
CHANGED
data/plugins/project.rb
CHANGED
|
@@ -2,9 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
module Project
|
|
4
4
|
def self.load(hiiro)
|
|
5
|
+
attach_methods(hiiro)
|
|
5
6
|
add_subcommands(hiiro)
|
|
6
7
|
end
|
|
7
8
|
|
|
9
|
+
def self.attach_methods(hiiro)
|
|
10
|
+
hiiro.define_singleton_method(:project_dirs) do
|
|
11
|
+
proj = File.join(Dir.home, 'proj')
|
|
12
|
+
return {} unless Dir.exist?(proj)
|
|
13
|
+
Dir.children(proj)
|
|
14
|
+
.select { |name| File.directory?(File.join(proj, name)) }
|
|
15
|
+
.each_with_object({}) { |name, h| h[name] = File.join(proj, name) }
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
hiiro.define_singleton_method(:projects_from_config) do
|
|
19
|
+
path = File.join(Dir.home, '.config', 'hiiro', 'projects.yml')
|
|
20
|
+
return {} unless File.exist?(path)
|
|
21
|
+
require 'yaml'
|
|
22
|
+
YAML.safe_load_file(path) || {}
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
8
26
|
def self.add_subcommands(hiiro)
|
|
9
27
|
hiiro.add_subcmd(:project) do |project_name|
|
|
10
28
|
projects = Hiiro::Projects.new
|