trk 0.1.2 → 0.1.4

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trk/cli.rb +34 -1
  3. data/lib/trk/version.rb +1 -1
  4. metadata +5 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd46a8acc59cf493ef72f27108f32ea902754d943d86aff7b1bc6ee96dcc7453
4
- data.tar.gz: aa149d09d6eda868df63ccc6c698cc002d4e73bad80d85c74d8cd75cefba67b6
3
+ metadata.gz: 7c38302d31fd705e553d2596b8c6e878a95f81b4a49d15bb044354a930d1fe2d
4
+ data.tar.gz: 0aae3f6637ac5838c776c590877ad2a67f4581302525ef510612a969a56cd6f0
5
5
  SHA512:
6
- metadata.gz: b523a13bfd29f256750acc592b9b4a00ba008304e80fb2e6d1dc352c3292329145da0a5a7aaf2059dd9eb3cfc29943d679c122acd59fd2523589573ecf59878e
7
- data.tar.gz: ef658fdca2465572c9fb6d69e299527740fee04e42fbf943b4a940335072332380d80c77e465917d2f37c5724dae7d666c98ed2c62c9082d4f5bc05603f24113
6
+ metadata.gz: 44390e4ab9e14328dda5c05645bc1c7e2eb74ee6c32a7a6a962edd06fe1f9c1f6f4c2a28dadc312cbdbb4690173c73529bc84cccdd65e3e20e380bb0d671852d
7
+ data.tar.gz: 0daa1839615e15d522ae3d6c48608d3f5ec24f055ab6c79d89809696c6e6773bbc9fe68891cf9e0f9fe4e583084f3580288aec97edc879cb27fd2ce6f7ed766a
data/lib/trk/cli.rb CHANGED
@@ -1,10 +1,43 @@
1
1
  require "thor"
2
2
  require "open3"
3
+ require "net/http"
4
+ require "uri"
3
5
 
4
6
  module Trk
5
7
  class CLI < Thor
6
- desc "pull", "Pulls Git repositories inside sub-sub directories"
8
+ def self.start(given_args = ARGV, config = {})
9
+ if given_args.include?("--version") || given_args.include?("-v")
10
+ puts "trk version #{VERSION}"
11
+ exit
12
+ end
13
+ super
14
+ end
7
15
 
16
+ def self.help(shell, subcommand = false)
17
+ super
18
+ puts "\n To enable autocomplete, put in .bashrc: 'complete -W \"$(trk completion)\" trk', eg:\n"
19
+ puts "echo '# https://trk.tools/app/trk-readme-source-links\ncomplete -W \"$(trk completion)\" trk' >> ~/.bashrc && source ~/.bashrc"
20
+ end
21
+
22
+ desc "completion", "Outputs available commands for autocompletion"
23
+ def completion
24
+ puts self.class.all_commands.keys.join(" ")
25
+ end
26
+
27
+ desc "add_github_keys USERNAME", "Add Github user public keys to .ssh/authorized_keys"
28
+ def add_github_keys(username)
29
+ uri = URI "https://trk.tools/sh/ssh-tips/-/raw/main/add_github_keys_to_authorized_keys.sh"
30
+ script = Net::HTTP.get uri
31
+ stdout, stderr, status = Open3.capture3 "bash -s -- #{username}", stdin_data: script
32
+ puts stdout
33
+ if status.success?
34
+ puts "#{CHECK_ICON} add_github_keys #{username} done"
35
+ else
36
+ puts "#{UNCHECK_ICON} add_github_keys #{username} failed:\n#{stderr}"
37
+ end
38
+ end
39
+
40
+ desc "pull", "Pulls Git repositories inside sub-sub directories"
8
41
  def pull
9
42
  base_dir = File.expand_path("~/trk.tools")
10
43
  sub_sub_dirs = Dir.glob("#{base_dir}/*/*").select { |d| File.directory?(d) }
data/lib/trk/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Trk
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.4"
5
5
  CHECK_ICON = "✅ "
6
6
  UNCHECK_ICON = "❌ "
7
7
  end
metadata CHANGED
@@ -1,10 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dusan Orlovic
8
+ autorequire:
8
9
  bindir: exe
9
10
  cert_chain: []
10
11
  date: 2025-03-11 00:00:00.000000000 Z
@@ -48,6 +49,7 @@ licenses:
48
49
  metadata:
49
50
  homepage_uri: https://trk.tools
50
51
  source_code_uri: https://trk.tools/app/trk-readme-source-links
52
+ post_install_message:
51
53
  rdoc_options: []
52
54
  require_paths:
53
55
  - lib
@@ -62,7 +64,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
64
  - !ruby/object:Gem::Version
63
65
  version: '0'
64
66
  requirements: []
65
- rubygems_version: 3.6.2
67
+ rubygems_version: 3.5.16
68
+ signing_key:
66
69
  specification_version: 4
67
70
  summary: CLI tools to manipulate https://trk.tools README files and projects.
68
71
  test_files: []