hiiro 0.1.0 → 0.1.1

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: a553e1c19ac099d93b9232da28a1953a83b7c2a379c8ddb05475a43aa58e31fb
4
- data.tar.gz: 33d06064609e82b1d1da5e7ec83ecfcd90d49cac93cc6a7b8cd3930ab4e48a57
3
+ metadata.gz: 36381caf75c969c5a2050fa3995d1f167b04721071389f2e486900e40bf2371e
4
+ data.tar.gz: 58c5a9c65e3c87233d66ea0dcc0de117518fbb36140eee628ba3842659904a11
5
5
  SHA512:
6
- metadata.gz: 4418cdbaa9056006099e9ec9e82eccc85c625ff380d4e92f93f1db6e4bc1b48a0b5617566c3c8d36c308b7db1c6f9caac4e9f596ac56663d5499be05bac1ce4b
7
- data.tar.gz: bf153421fbf79ad299203ba871b9907521dd2674f554efb34619a90c84dfb4ab2b0c56c2d3b32cdab2820cd35efa94e5e5b0baa2d24dbf7619cd7181e98323bd
6
+ metadata.gz: 4b07f611698ed7db8a500b2d65c7c8316098b296182e927b2f88b8e973e113d47b9acc5912e8c57799af8367a4be208c572f7731b429474a109e1a29437bdae8
7
+ data.tar.gz: 2842c4b0add5d28d091ab8cc64467e81e7cab87d466be835d0eaef3b962d56a6147212027777021166df326b9325cd3c28cb93169cd73af80f108b2ffea15de3
data/README.md CHANGED
@@ -13,6 +13,23 @@ See [docs/](docs/) for detailed documentation on all subcommands.
13
13
 
14
14
  ## Installation
15
15
 
16
+ ### Via RubyGems
17
+
18
+ ```sh
19
+ gem install hiiro
20
+
21
+ # Install plugins and subcommands
22
+ hiiro setup
23
+ ```
24
+
25
+ This installs:
26
+ - Plugins to `~/.config/hiiro/plugins/`
27
+ - Subcommands (`h-video`, `h-buffer`, etc.) to `~/bin/`
28
+
29
+ Ensure `~/bin` is in your `$PATH`.
30
+
31
+ ### Manual Installation
32
+
16
33
  ```sh
17
34
  # Copy the main script
18
35
  cp bin/h ~/bin/h
@@ -26,12 +43,9 @@ mkdir -p ~/.config/hiiro/plugins
26
43
  cp plugins/*.rb ~/.config/hiiro/plugins/
27
44
  ```
28
45
 
29
- Ensure `~/bin` is in your `$PATH`.
30
-
31
46
  ### Dependencies
32
47
 
33
48
  ```sh
34
- gem install pry
35
49
  # For notify plugin (macOS)
36
50
  brew install terminal-notifier
37
51
  ```
data/exe/h ADDED
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "hiiro"
4
+ require "fileutils"
5
+
6
+ Hiiro.load_env
7
+
8
+ hiiro = Hiiro.init(*ARGV, cwd: Dir.pwd)
9
+
10
+ hiiro.add_subcommand(:ping) { |*args|
11
+ puts "pong"
12
+ }
13
+
14
+ hiiro.add_subcommand(:setup) do |*args|
15
+ gem_root = File.expand_path("../..", __FILE__)
16
+ source_plugins = File.join(gem_root, "plugins")
17
+ source_bins = File.join(gem_root, "bin")
18
+ dest_plugins = File.expand_path("~/.config/hiiro/plugins")
19
+ dest_bin = File.expand_path("~/bin")
20
+
21
+ FileUtils.mkdir_p(dest_plugins)
22
+ FileUtils.mkdir_p(dest_bin)
23
+
24
+ # Copy plugins
25
+ plugin_files = Dir["#{source_plugins}/*.rb"]
26
+ if plugin_files.any?
27
+ FileUtils.cp(plugin_files, dest_plugins)
28
+ puts "Installed #{plugin_files.size} plugins to #{dest_plugins}"
29
+ plugin_files.each { |f| puts " - #{File.basename(f)}" }
30
+ else
31
+ puts "No plugins found in #{source_plugins}"
32
+ end
33
+
34
+ puts
35
+
36
+ # Copy bin scripts
37
+ bin_files = Dir["#{source_bins}/h-*"]
38
+ if bin_files.any?
39
+ FileUtils.cp(bin_files, dest_bin)
40
+ bin_files.each { |f| FileUtils.chmod(0755, File.join(dest_bin, File.basename(f))) }
41
+ puts "Installed #{bin_files.size} subcommands to #{dest_bin}"
42
+ bin_files.each { |f| puts " - #{File.basename(f)}" }
43
+ else
44
+ puts "No subcommands found in #{source_bins}"
45
+ end
46
+
47
+ puts
48
+ puts "Setup complete! Make sure ~/bin is in your PATH."
49
+ end
50
+
51
+ hiiro.run
data/lib/hiiro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/script/publish ADDED
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "hiiro"
4
+
5
+ major, minor, patch = Hiiro::VERSION.split(?.)
6
+
7
+ new_version = [major, minor, patch.to_i + 1].join(?.)
8
+
9
+ File.open('lib/hiiro/version.rb', 'w+') do |f|
10
+ f.puts 'class Hiiro'
11
+ f.puts " VERSION = #{new_version.inspect}"
12
+ f.puts 'end'
13
+ end
14
+
15
+ built = system('gem', 'build', 'hiiro.gemspec')
16
+
17
+ puts "\nERROR: unable to build gem\n" unless built
18
+
19
+ pushed = system('gem', 'push', "hiiro-#{new_version}.gem")
20
+
21
+ puts "\nERROR: unable to push\n" unless pushed
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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota
@@ -29,7 +29,7 @@ description: Build multi-command CLI tools with subcommand dispatch, abbreviatio
29
29
  email:
30
30
  - jearsh+rubygems@gmail.com
31
31
  executables:
32
- - hiiro
32
+ - h
33
33
  extensions: []
34
34
  extra_rdoc_files: []
35
35
  files:
@@ -52,7 +52,7 @@ files:
52
52
  - docs/h-session.md
53
53
  - docs/h-video.md
54
54
  - docs/h-window.md
55
- - exe/hiiro
55
+ - exe/h
56
56
  - hiiro.gemspec
57
57
  - lib/hiiro.rb
58
58
  - lib/hiiro/version.rb
@@ -63,6 +63,7 @@ files:
63
63
  - plugins/tmux.rb
64
64
  - script/compare
65
65
  - script/install
66
+ - script/publish
66
67
  homepage: https://github.com/unixsuperhero/hiiro
67
68
  licenses:
68
69
  - MIT
data/exe/hiiro DELETED
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "hiiro"
4
-
5
- Hiiro.load_env
6
-
7
- hiiro = Hiiro.init(*ARGV, cwd: Dir.pwd)
8
-
9
- hiiro.add_subcommand(:ping) { |*args|
10
- puts "pong"
11
- }
12
-
13
- hiiro.run