hiiro 0.1.33.pre.2 → 0.1.34
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/g-pr +2 -1
- data/bin/h-branch +2 -1
- data/bin/h-buffer +1 -1
- data/bin/h-link +1 -1
- data/bin/h-osubtask +2 -1
- data/bin/h-otask +1 -1
- data/bin/h-pane +1 -1
- data/bin/h-plugin +1 -1
- data/bin/h-pr +2 -1
- data/bin/h-session +1 -1
- data/bin/h-sha +1 -1
- data/bin/h-vim +1 -1
- data/bin/h-window +1 -1
- data/exe/h +1 -1
- data/lib/hiiro/version.rb +1 -1
- data/lib/hiiro.rb +26 -20
- data/plugins/notify.rb +1 -1
- data/plugins/old_task.rb +1 -1
- data/plugins/project.rb +1 -1
- data/plugins/tasks.rb +1 -1
- data/script/publish +3 -18
- metadata +3 -4
- data/lib/hiiro/plugins.rb +0 -64
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8746a15f85121b84a7fcebefcbd7b1b63e5f289190d8bb75a230c27df3ce0279
|
|
4
|
+
data.tar.gz: fc0faa4d8bf9dde3de151b1a2d59e536010f31cd44e8ec6a18a062a735f4c49f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ffde10d22c1385fb63333a0679d911c0a062e15a74d4979980c7b2946060add058570db64c52bfeae385b47d488e2b36dbc0bff1604751750d8b1a26a7bd4730
|
|
7
|
+
data.tar.gz: 77d81a271282525001a763fe7ee88e3a92b1fd6804a92ca59ff77a07dce08fb9a9f50b1fa7703f717ea4378bd9c679f7472ec07113529de6771f753ecfada4ce
|
data/bin/g-pr
CHANGED
data/bin/h-branch
CHANGED
data/bin/h-buffer
CHANGED
data/bin/h-link
CHANGED
|
@@ -193,7 +193,7 @@ class LinkManager
|
|
|
193
193
|
end
|
|
194
194
|
|
|
195
195
|
lm = LinkManager.new
|
|
196
|
-
o = Hiiro.init(*ARGV, plugins: [
|
|
196
|
+
o = Hiiro.init(*ARGV, plugins: [Tmux, Pins], links_file: lm.links_file)
|
|
197
197
|
|
|
198
198
|
o.add_subcmd(:add) do |*args|
|
|
199
199
|
links = lm.load_links
|
data/bin/h-osubtask
CHANGED
data/bin/h-otask
CHANGED
data/bin/h-pane
CHANGED
data/bin/h-plugin
CHANGED
|
@@ -5,7 +5,7 @@ require 'json'
|
|
|
5
5
|
require 'hiiro'
|
|
6
6
|
|
|
7
7
|
BASE_DIR = File.join(Dir.home, '.config/hiiro/plugins')
|
|
8
|
-
o = Hiiro.init(*ARGV, plugins: [
|
|
8
|
+
o = Hiiro.init(*ARGV, plugins: [Tmux, Pins], dir: BASE_DIR)
|
|
9
9
|
|
|
10
10
|
def plugin_files
|
|
11
11
|
Dir.glob(File.join(BASE_DIR, '**/*'))
|
data/bin/h-pr
CHANGED
data/bin/h-session
CHANGED
|
@@ -22,7 +22,7 @@ require 'rspec'
|
|
|
22
22
|
# has (subcommand) /Users/unixsuperhero/bin/h-session:139
|
|
23
23
|
# info (subcommand) /Users/unixsuperhero/bin/h-session:143
|
|
24
24
|
|
|
25
|
-
o = Hiiro.init(*ARGV, plugins: [
|
|
25
|
+
o = Hiiro.init(*ARGV, plugins: [Pins])
|
|
26
26
|
|
|
27
27
|
o.add_subcmd(:ls) { |*args|
|
|
28
28
|
system('tmux', 'list-sessions', *args)
|
data/bin/h-sha
CHANGED
data/bin/h-vim
CHANGED
|
@@ -5,7 +5,7 @@ require 'hiiro'
|
|
|
5
5
|
BASE_DIR = CONFIG_DIR = File.join(Dir.home, '.config/nvim')
|
|
6
6
|
TMUX_SESSION_NAME = 'vim'
|
|
7
7
|
|
|
8
|
-
o = Hiiro.init(*ARGV, plugins: [
|
|
8
|
+
o = Hiiro.init(*ARGV, plugins: [Tmux, Pins, Project])
|
|
9
9
|
|
|
10
10
|
o.add_subcmd(:edit) { |*args|
|
|
11
11
|
nvim = ENV['EDITOR']
|
data/bin/h-window
CHANGED
data/exe/h
CHANGED
data/lib/hiiro/version.rb
CHANGED
data/lib/hiiro.rb
CHANGED
|
@@ -4,7 +4,6 @@ require "shellwords"
|
|
|
4
4
|
|
|
5
5
|
require_relative "hiiro/version"
|
|
6
6
|
require_relative "hiiro/history"
|
|
7
|
-
require_relative "hiiro/plugins"
|
|
8
7
|
|
|
9
8
|
class String
|
|
10
9
|
def underscore(camel_cased_word=self)
|
|
@@ -21,12 +20,12 @@ end
|
|
|
21
20
|
|
|
22
21
|
class Hiiro
|
|
23
22
|
def self.init(*args, plugins: [], logging: false, **values, &block)
|
|
24
|
-
|
|
23
|
+
load_env
|
|
25
24
|
args = ARGV if args.empty?
|
|
26
25
|
|
|
27
26
|
new($0, *args, logging: logging, **values).tap do |hiiro|
|
|
28
27
|
History.load(hiiro)
|
|
29
|
-
hiiro.
|
|
28
|
+
hiiro.load_plugins(*plugins)
|
|
30
29
|
|
|
31
30
|
hiiro.add_subcmd(:edit, **values) { |*args|
|
|
32
31
|
system(ENV['EDITOR'] || 'nvim', hiiro.bin)
|
|
@@ -42,10 +41,12 @@ class Hiiro
|
|
|
42
41
|
hiiro.run
|
|
43
42
|
end
|
|
44
43
|
|
|
45
|
-
def self.
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
def self.load_env
|
|
45
|
+
Config.plugin_files.each do |plugin_file|
|
|
46
|
+
require plugin_file
|
|
48
47
|
end
|
|
48
|
+
|
|
49
|
+
self
|
|
49
50
|
end
|
|
50
51
|
|
|
51
52
|
attr_reader :bin, :bin_name, :all_args, :full_command
|
|
@@ -131,24 +132,11 @@ class Hiiro
|
|
|
131
132
|
|
|
132
133
|
def pins = @pins ||= Pin.new(self)
|
|
133
134
|
|
|
134
|
-
def init_plugins(*names)
|
|
135
|
-
names.flatten.each do |name|
|
|
136
|
-
plugin_const = Hiiro::Plugins.const_get(name.to_s) rescue nil
|
|
137
|
-
next unless plugin_const
|
|
138
|
-
load_plugin(plugin_const)
|
|
139
|
-
end
|
|
140
|
-
end
|
|
141
|
-
|
|
142
135
|
def load_plugins(*plugins)
|
|
143
136
|
plugins.flatten.each { |plugin| load_plugin(plugin) }
|
|
144
137
|
end
|
|
145
138
|
|
|
146
|
-
def load_plugin(
|
|
147
|
-
plugin_const = case plugin
|
|
148
|
-
when Module then plugin
|
|
149
|
-
when String, Symbol then Hiiro::Plugins.load_plugin(plugin.to_s)
|
|
150
|
-
end
|
|
151
|
-
return unless plugin_const
|
|
139
|
+
def load_plugin(plugin_const)
|
|
152
140
|
return if @loaded_plugins.include?(plugin_const)
|
|
153
141
|
|
|
154
142
|
plugin_const.load(self)
|
|
@@ -205,6 +193,22 @@ class Hiiro
|
|
|
205
193
|
|
|
206
194
|
class Config
|
|
207
195
|
class << self
|
|
196
|
+
def plugin_files
|
|
197
|
+
user_files = Dir.glob(File.join(plugin_dir, '*.rb'))
|
|
198
|
+
user_basenames = user_files.map { |f| File.basename(f) }
|
|
199
|
+
|
|
200
|
+
gem_plugin_dir = File.join(File.expand_path('../..', __FILE__), 'plugins')
|
|
201
|
+
gem_files = Dir.exist?(gem_plugin_dir) ? Dir.glob(File.join(gem_plugin_dir, '*.rb')) : []
|
|
202
|
+
|
|
203
|
+
fallback_files = gem_files.reject { |f| user_basenames.include?(File.basename(f)) }
|
|
204
|
+
|
|
205
|
+
user_files + fallback_files
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
def plugin_dir
|
|
209
|
+
config_dir('plugins')
|
|
210
|
+
end
|
|
211
|
+
|
|
208
212
|
def config_dir(subdir=nil)
|
|
209
213
|
File.join(Dir.home, '.config/hiiro', *[subdir].compact).tap do |config_path|
|
|
210
214
|
FileUtils.mkdir_p(config_path) unless Dir.exist?(config_path)
|
|
@@ -454,4 +458,6 @@ class Hiiro
|
|
|
454
458
|
end
|
|
455
459
|
end
|
|
456
460
|
end
|
|
461
|
+
|
|
462
|
+
load_env
|
|
457
463
|
end
|
data/plugins/notify.rb
CHANGED
data/plugins/old_task.rb
CHANGED
data/plugins/project.rb
CHANGED
data/plugins/tasks.rb
CHANGED
data/script/publish
CHANGED
|
@@ -2,24 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
require "hiiro"
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if parts.length == 5 && parts[3] == "pre"
|
|
9
|
-
major, minor, patch, _, pre_num = parts
|
|
10
|
-
if pre_release
|
|
11
|
-
new_version = [major, minor, patch, "pre", pre_num.to_i + 1].join(?.)
|
|
12
|
-
else
|
|
13
|
-
new_version = [major, minor, patch].join(?.)
|
|
14
|
-
end
|
|
15
|
-
else
|
|
16
|
-
major, minor, patch = parts
|
|
17
|
-
if pre_release
|
|
18
|
-
new_version = [major, minor, patch.to_i + 1, "pre", 1].join(?.)
|
|
19
|
-
else
|
|
20
|
-
new_version = [major, minor, patch.to_i + 1].join(?.)
|
|
21
|
-
end
|
|
22
|
-
end
|
|
5
|
+
major, minor, patch = Hiiro::VERSION.split(?.)
|
|
6
|
+
|
|
7
|
+
new_version = [major, minor, patch.to_i + 1].join(?.)
|
|
23
8
|
|
|
24
9
|
File.open('lib/hiiro/version.rb', 'w+') do |f|
|
|
25
10
|
f.puts 'class Hiiro'
|
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.34
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joshua Toyota
|
|
@@ -77,7 +77,6 @@ files:
|
|
|
77
77
|
- hiiro.gemspec
|
|
78
78
|
- lib/hiiro.rb
|
|
79
79
|
- lib/hiiro/history.rb
|
|
80
|
-
- lib/hiiro/plugins.rb
|
|
81
80
|
- lib/hiiro/version.rb
|
|
82
81
|
- links.backup.yml
|
|
83
82
|
- notes
|
|
@@ -109,9 +108,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
109
108
|
version: 2.7.0
|
|
110
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
110
|
requirements:
|
|
112
|
-
- - "
|
|
111
|
+
- - ">="
|
|
113
112
|
- !ruby/object:Gem::Version
|
|
114
|
-
version:
|
|
113
|
+
version: '0'
|
|
115
114
|
requirements: []
|
|
116
115
|
rubygems_version: 3.3.7
|
|
117
116
|
signing_key:
|
data/lib/hiiro/plugins.rb
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
class Hiiro
|
|
2
|
-
class Plugins
|
|
3
|
-
class << self
|
|
4
|
-
def load_plugin(name)
|
|
5
|
-
name_str = name.to_s
|
|
6
|
-
return const_get(name_str) if plugin_loaded?(name_str)
|
|
7
|
-
|
|
8
|
-
path = plugin_path(name_str)
|
|
9
|
-
unless path
|
|
10
|
-
warn "[hiiro] plugin not found: #{name_str}"
|
|
11
|
-
return nil
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
module_eval(File.read(path), path, 1)
|
|
15
|
-
|
|
16
|
-
unless const_defined?(name_str, false)
|
|
17
|
-
warn "[hiiro] plugin #{name_str} did not define expected constant"
|
|
18
|
-
return nil
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
@loaded_plugins ||= []
|
|
22
|
-
@loaded_plugins << name_str
|
|
23
|
-
const_get(name_str)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def plugin_loaded?(name_str)
|
|
27
|
-
(@loaded_plugins || []).include?(name_str.to_s)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def plugin_path(name_str)
|
|
31
|
-
plugin_filename = name_str.underscore + '.rb'
|
|
32
|
-
|
|
33
|
-
paths_to_check = [
|
|
34
|
-
File.join(Dir.home, '.config/hiiro/plugins'),
|
|
35
|
-
File.join(File.expand_path('../..', __FILE__), 'plugins'),
|
|
36
|
-
]
|
|
37
|
-
|
|
38
|
-
paths_to_check.each do |dir|
|
|
39
|
-
full_path = File.join(dir, plugin_filename)
|
|
40
|
-
return full_path if File.exist?(full_path)
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
nil
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def load_all
|
|
47
|
-
user_dir = File.join(Dir.home, '.config/hiiro/plugins')
|
|
48
|
-
gem_dir = File.join(File.expand_path('../..', __FILE__), 'plugins')
|
|
49
|
-
|
|
50
|
-
FileUtils.mkdir_p(user_dir) unless Dir.exist?(user_dir)
|
|
51
|
-
|
|
52
|
-
user_files = Dir.glob(File.join(user_dir, '*.rb'))
|
|
53
|
-
user_basenames = user_files.map { |f| File.basename(f) }
|
|
54
|
-
|
|
55
|
-
gem_files = Dir.exist?(gem_dir) ? Dir.glob(File.join(gem_dir, '*.rb')) : []
|
|
56
|
-
fallback_files = gem_files.reject { |f| user_basenames.include?(File.basename(f)) }
|
|
57
|
-
|
|
58
|
-
(user_files + fallback_files).each do |path|
|
|
59
|
-
module_eval(File.read(path), path, 1)
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
end
|
|
64
|
-
end
|