hiiro 0.1.25 → 0.1.27

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5855f3252099301231f987ede7f80a670e1684b5173b196f2578626dca25de1
4
- data.tar.gz: a4a4809a5448317290336b03f5f49786cc10d402e85529a15c34913419f07cdb
3
+ metadata.gz: 50b6c4372984b628ce714e2a29249f93f8f869af5298752b5983bc9d18edebcf
4
+ data.tar.gz: 9477252f59c4afcd35dca01b6b576a233c7352c6f40d640b5f019609287655f7
5
5
  SHA512:
6
- metadata.gz: 4b061b0524532726d82d09652d700e09bbdf72b9bded349907b1da7a4990f63edf827bd55ed6288de9aa7bac1af1cdc5d023bc14ea386d0514107885921f5bfe
7
- data.tar.gz: d611d34f3cceda9ab8a16b70dc1921fbc4575214b531af702bc0ab20eb6c3c6b5dac6cfe29bd272bbddd8c9ea670f48ddfc2402f63619caa9299c065383c81e4
6
+ metadata.gz: bc6efdae4f2a2b948436dc7551c8acd89098c21a42e53c53b5bb5034a10679dc34f680fb5cc0e6361226efce00ed4bafd95a9776eeda3582147d1c41ac8c7c82
7
+ data.tar.gz: 542dcc0dbf7a72c8b063c38bc02cf629a60522549a71dbdb44c20bca9c6de20a40d294c4fa417140436403fa5a6bb0fb40330399e8e8e45249dd5343a03aef83
data/bin/h-task CHANGED
@@ -5,7 +5,6 @@ require "fileutils"
5
5
  require "yaml"
6
6
  require "pathname"
7
7
 
8
- Hiiro.load_env
9
8
  hiiro = Hiiro.init(*ARGV, plugins: [Tmux])
10
9
 
11
10
  class TaskManager
@@ -392,8 +391,12 @@ class TaskManager
392
391
  puts printable_apps.keys.sort.map{|k| format("%#{longest_app_name}s => %s", k, printable_apps[k]) }
393
392
  exit 1
394
393
  when 1
395
- pwd_to_root = Pathname.new(tree_root).relative_path_from(Pathname.pwd)
396
- print File.join(pwd_to_root, apps_config[matching_apps.first])
394
+ if Pathname.pwd.ascend.any? { |parent| parent.equal?(tree_root) }
395
+ pwd_to_root = Pathname.new(tree_root).relative_path_from(Pathname.pwd)
396
+ print File.join(pwd_to_root, apps_config[matching_apps.first])
397
+ else
398
+ print File.join(tree_root, apps_config[matching_apps.first])
399
+ end
397
400
  exit 0
398
401
  else
399
402
  puts "Multiple matches found:"
@@ -402,8 +405,6 @@ class TaskManager
402
405
  end
403
406
  end
404
407
 
405
- private
406
-
407
408
  def printable_apps
408
409
  apps_config.transform_keys(&:to_s)
409
410
  end
@@ -562,6 +563,12 @@ class TaskManager
562
563
  { task: task_name, tree: tree, session: session }
563
564
  end
564
565
 
566
+ def task_name
567
+ task = current_task
568
+
569
+ (task || {})[:task]
570
+ end
571
+
565
572
  def switch_to_task(task_name, tree, app: nil)
566
573
  session = session_name_for(task_name)
567
574
  base_path = tree_path(tree)
@@ -698,14 +705,13 @@ hiiro.add_subcmd(:ls) { tasks.list_trees }
698
705
  hiiro.add_subcmd(:start) { |task_name, app=nil| tasks.start_task(task_name, app: app) }
699
706
  hiiro.add_subcmd(:switch) { |task_name=nil| tasks.switch_task(task_name) }
700
707
  hiiro.add_subcmd(:app) { |app_name| tasks.open_app(app_name) }
701
- hiiro.add_subcmd(:path) { |app_name=nil, task=nil| tasks.app_path(app_name, task: task) }
708
+ hiiro.add_subcmd(:path) { |app_name=nil, task=nil| tasks.app_path(app_name, task: task || tasks.task_name) }
702
709
  hiiro.add_subcmd(:cd) { |*args| tasks.cd_app(*args) }
703
710
  hiiro.add_subcmd(:apps) { tasks.list_configured_apps }
704
711
  hiiro.add_subcmd(:status) { tasks.status }
705
712
  hiiro.add_subcmd(:st) { tasks.status }
706
713
  hiiro.add_subcmd(:save) { tasks.save_current }
707
714
  hiiro.add_subcmd(:stop) { |task_name=nil| task_name ? tasks.stop_task(task_name) : tasks.stop_current }
708
-
709
- hiiro.add_default { tasks.help }
715
+ hiiro.add_subcmd(:current) { print tasks.task_name }
710
716
 
711
717
  hiiro.run
data/lib/hiiro/history.rb CHANGED
@@ -176,7 +176,6 @@ class Hiiro
176
176
  source: 'manual',
177
177
  cmd: hiiro.full_command,
178
178
  )
179
- puts "Added history entry: #{description}"
180
179
  true
181
180
  end
182
181
 
data/lib/hiiro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.25"
2
+ VERSION = "0.1.27"
3
3
  end
data/script/sync CHANGED
@@ -8,7 +8,7 @@ set -e
8
8
  REPO_DIR="$(cd "$(dirname "$0")/.." && pwd)"
9
9
  cd "$REPO_DIR"
10
10
 
11
- OTHER_DIR="$REPO_DIR/../home/"
11
+ OTHER_DIR="$HOME"
12
12
 
13
13
  echo "Comparing directories with $OTHER_DIR"
14
14
  echo "Repository: $REPO_DIR ($0)"
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.25
4
+ version: 0.1.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota