hiiro 0.1.45 → 0.1.46
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-otask +5 -7
- data/lib/hiiro/sk.rb +17 -0
- data/lib/hiiro/version.rb +1 -1
- data/lib/hiiro.rb +5 -0
- data/plugins/old_task.rb +4 -9
- data/plugins/tasks.rb +1 -4
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 38b5114c13aecafc04f977e28b3d1367dbdccaf6820c318cbcabff3fa6adceed
|
|
4
|
+
data.tar.gz: 6d3f7b8b38955698b77fc7d4e6920afc6b1d5630df5e045a6bbce63784a22bb6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3d22cd8016c63f2c62c2d24c3f1f06860c57bd2348d54f33f74130efad5993cf95e6e93de2aeabe778ed063fa006f0e8c905dd4f1a70832f2226e5bf2bcb3d04
|
|
7
|
+
data.tar.gz: c07e1243ee16e2bdcd8abf968669429b6c8fbdd1732f6f009daa4fc7dca6b85b98200882576cea7e918639b8b7ada9a13c146ae434c4fa18578efaea9492a669
|
data/bin/h-otask
CHANGED
|
@@ -229,14 +229,12 @@ class TaskManager
|
|
|
229
229
|
"#{tree_name.ljust(20)} => #{task}"
|
|
230
230
|
end
|
|
231
231
|
|
|
232
|
-
|
|
233
|
-
|
|
232
|
+
selected = Hiiro::Sk.select(lines)
|
|
233
|
+
return nil unless selected
|
|
234
234
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
return $1
|
|
239
|
-
end
|
|
235
|
+
# Parse the selected line to extract the task name
|
|
236
|
+
if selected =~ /=>\s*(\S+)/
|
|
237
|
+
return $1
|
|
240
238
|
end
|
|
241
239
|
|
|
242
240
|
nil
|
data/lib/hiiro/sk.rb
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require 'open3'
|
|
2
|
+
|
|
3
|
+
class Hiiro
|
|
4
|
+
class Sk
|
|
5
|
+
def self.select(lines)
|
|
6
|
+
input = lines.is_a?(Array) ? lines.join("\n") : lines.to_s
|
|
7
|
+
selected, status = Open3.capture2('sk', stdin_data: input)
|
|
8
|
+
|
|
9
|
+
return nil unless status.success?
|
|
10
|
+
|
|
11
|
+
result = selected.strip
|
|
12
|
+
return nil if result.empty?
|
|
13
|
+
|
|
14
|
+
result
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
data/lib/hiiro/version.rb
CHANGED
data/lib/hiiro.rb
CHANGED
|
@@ -5,6 +5,7 @@ require "shellwords"
|
|
|
5
5
|
require_relative "hiiro/version"
|
|
6
6
|
require_relative "hiiro/history"
|
|
7
7
|
require_relative "hiiro/options"
|
|
8
|
+
require_relative "hiiro/sk"
|
|
8
9
|
|
|
9
10
|
class String
|
|
10
11
|
def underscore(camel_cased_word=self)
|
|
@@ -211,6 +212,10 @@ class Hiiro
|
|
|
211
212
|
i = Args.new(*args)
|
|
212
213
|
end
|
|
213
214
|
|
|
215
|
+
def sk(lines)
|
|
216
|
+
Sk.select(lines)
|
|
217
|
+
end
|
|
218
|
+
|
|
214
219
|
def get_value(name)
|
|
215
220
|
runner&.values&.[](name)
|
|
216
221
|
end
|
data/plugins/old_task.rb
CHANGED
|
@@ -661,16 +661,11 @@ module OldTask
|
|
|
661
661
|
return nil
|
|
662
662
|
end
|
|
663
663
|
|
|
664
|
-
|
|
665
|
-
|
|
664
|
+
choice = Hiiro::Sk.select(lines)
|
|
665
|
+
return nil unless choice
|
|
666
|
+
return 'main' if choice == '(main)'
|
|
666
667
|
|
|
667
|
-
|
|
668
|
-
choice = selected.strip
|
|
669
|
-
return 'main' if choice == '(main)'
|
|
670
|
-
return choice
|
|
671
|
-
end
|
|
672
|
-
|
|
673
|
-
nil
|
|
668
|
+
choice
|
|
674
669
|
end
|
|
675
670
|
|
|
676
671
|
# Show status for the current subtask
|
data/plugins/tasks.rb
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
require 'yaml'
|
|
2
2
|
require 'fileutils'
|
|
3
|
-
require 'open3'
|
|
4
3
|
|
|
5
4
|
WORK_DIR = File.join(Dir.home, 'work')
|
|
6
5
|
REPO_PATH = File.join(WORK_DIR, '.bare')
|
|
@@ -757,9 +756,7 @@ class TaskManager
|
|
|
757
756
|
end
|
|
758
757
|
|
|
759
758
|
def sk_select(items)
|
|
760
|
-
|
|
761
|
-
return selected.strip if status.success? && !selected.strip.empty?
|
|
762
|
-
nil
|
|
759
|
+
Hiiro::Sk.select(items)
|
|
763
760
|
end
|
|
764
761
|
end
|
|
765
762
|
|
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.46
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joshua Toyota
|
|
@@ -80,6 +80,7 @@ files:
|
|
|
80
80
|
- lib/hiiro.rb
|
|
81
81
|
- lib/hiiro/history.rb
|
|
82
82
|
- lib/hiiro/options.rb
|
|
83
|
+
- lib/hiiro/sk.rb
|
|
83
84
|
- lib/hiiro/version.rb
|
|
84
85
|
- notes
|
|
85
86
|
- plugins/notify.rb
|