hiiro 0.1.64 → 0.1.65
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/lib/hiiro/version.rb +1 -1
- data/lib/hiiro.rb +4 -0
- data/plugins/tasks.rb +20 -15
- 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: ee0c1414031bed7ec09923ecd3c88bd20b72a5a64bce2bdf31234dbe03b2c2d1
|
|
4
|
+
data.tar.gz: 3b88d057d457e74f3a796874203e6c863b27325a9238b004f88b6aedec57cf22
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a4d11de5d29582076d40150b510b09bf8219f0713c26d59a3205f2f6704b05bffbb84205077d6340cd33c7870a5e4d6c3c83723fd273966c63c1e3ae2badcb29
|
|
7
|
+
data.tar.gz: 5dc971e9c3070edaa1cbf1ae92105929350fa6b4c3eced60183f46215322288ad9df975af6f307724a44cbbae6c16ac5b148e321da7a010501fe7f5be31a5539
|
data/lib/hiiro/version.rb
CHANGED
data/lib/hiiro.rb
CHANGED
data/plugins/tasks.rb
CHANGED
|
@@ -809,33 +809,36 @@ module Tasks
|
|
|
809
809
|
add_subcommands(hiiro)
|
|
810
810
|
end
|
|
811
811
|
|
|
812
|
-
def self.attach_methods(hiiro)
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
812
|
+
def self.attach_methods(hiiro, task_manager=nil)
|
|
813
|
+
environment = Environment.current
|
|
814
|
+
|
|
815
|
+
hiiro.attach_method(:environment) { environment }
|
|
816
|
+
hiiro.attach_method(:env) { environment }
|
|
817
|
+
hiiro.attach_method(:task_manager) { task_manager }
|
|
818
|
+
hiiro.attach_method(:tm) { task_manager }
|
|
819
|
+
|
|
820
|
+
hiiro
|
|
818
821
|
end
|
|
819
822
|
|
|
820
823
|
def self.add_subcommands(hiiro)
|
|
821
824
|
hiiro.add_subcmd(:task) do |*args|
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
task_hiiro.run
|
|
825
|
+
tm = TaskManager.new(hiiro, scope: :task)
|
|
826
|
+
build_hiiro(hiiro, tm).run
|
|
825
827
|
end
|
|
826
828
|
|
|
827
829
|
hiiro.add_subcmd(:subtask) do |*args|
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
task_hiiro.run
|
|
830
|
+
tm = TaskManager.new(hiiro, scope: :subtask)
|
|
831
|
+
build_hiiro(hiiro, tm).run
|
|
831
832
|
end
|
|
832
833
|
end
|
|
833
834
|
|
|
834
|
-
def self.build_hiiro(parent_hiiro,
|
|
835
|
+
def self.build_hiiro(parent_hiiro, task_manager)
|
|
835
836
|
bin_name = [parent_hiiro.bin, parent_hiiro.subcmd || ''].join('-')
|
|
836
837
|
|
|
837
|
-
Hiiro.init(
|
|
838
|
-
|
|
838
|
+
task_hiiro = Hiiro.init(
|
|
839
|
+
bin_name:,
|
|
840
|
+
args: parent_hiiro.args,
|
|
841
|
+
) do |h|
|
|
839
842
|
h.add_subcmd(:list) { tm.list }
|
|
840
843
|
h.add_subcmd(:ls) { tm.list }
|
|
841
844
|
|
|
@@ -893,5 +896,7 @@ module Tasks
|
|
|
893
896
|
system(ENV['EDITOR'] || 'nvim', __FILE__)
|
|
894
897
|
end
|
|
895
898
|
end
|
|
899
|
+
|
|
900
|
+
attach_methods task_hiiro, task_manager
|
|
896
901
|
end
|
|
897
902
|
end
|