hiiro 0.1.74 → 0.1.75

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: f9ec3be1c7128ee0d6d0cba6f86bce495c7c35cfa0229848b6f051745503063c
4
- data.tar.gz: 70ca7ac8444f6909ecd0ec42763202206243cc18c68f34c4ee9c2d3db028ad62
3
+ metadata.gz: 34700bd923f6f8f4cc3eff309a5829ab3e5c2b9987bbe76c25a75a7110a59f3a
4
+ data.tar.gz: 160e694e2e1dc9cf6bd178f529a951961e788ee8f689963d581ecbfd5a5e4f9a
5
5
  SHA512:
6
- metadata.gz: a4c2a786aefec401aaba049722064562b9d7d3a3550d72bd4d981e66443cee7dacfd5d3730114e881bdcfd5937dfdbb222998059b0c7c9c662925581cbe3e327
7
- data.tar.gz: 0a4d8bd981fbbb6124cf0d4cf228143aed01a13df1930309ebce66f4f0ecbe325049f5ce6c374bea39ac4f5e37bcabcb53234b26fdb84975724db7b5616ae6fd
6
+ metadata.gz: 429e255974c440edd3daf5285d7aff195622527f26297ae43c1348af8f5f8a1f552e4625f3c8406b3998e154aba7736d6eca17f717a0adbed9af6d3aeb062763
7
+ data.tar.gz: e60d8aef2c3bcfd6fea0763de46a4e102f812dfb560b39b1b117aaac1de9341b7032d5fd623dee425bb2eae04aa7a478d7e30818962197b5ca267f76f2d963f3
data/exe/h CHANGED
@@ -4,15 +4,15 @@ require "hiiro"
4
4
  require "fileutils"
5
5
 
6
6
  Hiiro.run(*ARGV, cwd: Dir.pwd, plugins: [Tasks]) do
7
- add_subcommand(:version) { |*args|
7
+ add_subcmd(:version) { |*args|
8
8
  puts Hiiro::VERSION
9
9
  }
10
10
 
11
- add_subcommand(:ping) { |*args|
11
+ add_subcmd(:ping) { |*args|
12
12
  puts "pong"
13
13
  }
14
14
 
15
- add_subcommand(:setup) do |*args|
15
+ add_subcmd(:setup) do |*args|
16
16
  gem_root = File.expand_path("../..", __FILE__)
17
17
  source_plugins = File.join(gem_root, "plugins")
18
18
  source_bins = File.join(gem_root, "bin")
@@ -42,10 +42,14 @@ Hiiro.run(*ARGV, cwd: Dir.pwd, plugins: [Tasks]) do
42
42
  puts "Installed #{bin_files.size} subcommands to #{dest_bin}"
43
43
  bin_files.each { |f| puts " - #{File.basename(f)}" }
44
44
  else
45
- puts "No subcommands found in #{source_bins}"
45
+ puts "No subcmds found in #{source_bins}"
46
46
  end
47
47
 
48
48
  puts
49
49
  puts "Setup complete! Make sure ~/bin is in your PATH."
50
50
  end
51
+
52
+ add_subcmd(:alert) do |*args|
53
+ puts Notification.new(self).sounds
54
+ end
51
55
  end
@@ -0,0 +1,30 @@
1
+ class Hiiro
2
+ class Notification
3
+ def self.send(hiiro)
4
+ new(hiiro).send
5
+ end
6
+
7
+ attr_reader :hiiro, :original_args
8
+
9
+ def initialize(hiiro)
10
+ @hiiro = hiiro
11
+ @original_args = hiiro.args.dup
12
+ end
13
+
14
+ def args
15
+ @args ||= hiiro.args
16
+ end
17
+
18
+ def sounds
19
+ system = Dir.glob('/System/Library/Sounds/*')
20
+ custom = Dir.glob(File.join(Dir.home, '.config/hiiro/sounds/*'))
21
+
22
+ all_sounds = system + custom
23
+ all_sounds.each_with_object({}) do |fn, h|
24
+ basename = File.basename(fn, File.extname(fn))
25
+ puts basename: basename
26
+ end
27
+ end
28
+ end
29
+ end
30
+
data/lib/hiiro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.74"
2
+ VERSION = "0.1.75"
3
3
  end
data/lib/hiiro.rb CHANGED
@@ -8,6 +8,7 @@ require_relative "hiiro/prefix_matcher"
8
8
  require_relative "hiiro/git"
9
9
  require_relative "hiiro/history"
10
10
  require_relative "hiiro/options"
11
+ require_relative "hiiro/notification"
11
12
  require_relative "hiiro/sk"
12
13
  require_relative "hiiro/todo"
13
14
 
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.74
4
+ version: 0.1.75
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota
@@ -109,6 +109,7 @@ files:
109
109
  - lib/hiiro/git/worktrees.rb
110
110
  - lib/hiiro/history.rb
111
111
  - lib/hiiro/history/entry.rb
112
+ - lib/hiiro/notification.rb
112
113
  - lib/hiiro/options.rb
113
114
  - lib/hiiro/prefix_matcher.rb
114
115
  - lib/hiiro/sk.rb