ghcurl 0.8.1 → 0.9.0

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 (10) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/Gemfile +6 -6
  4. data/LICENSE +22 -22
  5. data/README.md +100 -103
  6. data/Rakefile +3 -3
  7. data/bin/ghcurl +584 -525
  8. data/ghcurl.gemspec +40 -0
  9. data/lib/ghcurl.rb +78 -71
  10. metadata +10 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c0e61752e6dd439bf1d0f6f08dc55bf4c2e956df4ec8b07330fa19d75b463cc
4
- data.tar.gz: 5ac05c87788fac6b3574f843cf4a3f7652e3146d9302cf3a56b1ae87347eb093
3
+ metadata.gz: edbcc9cb12f78e6ee6c9ca4e5c169394d023f186e0264cf4fbdca25451e6c4d9
4
+ data.tar.gz: 2d9995452fdb4ba0d9571167575e9883019f5b53472fb966555d8fabef6b7aaf
5
5
  SHA512:
6
- metadata.gz: 274ee82a30fe217f1b4654188145f0587c9165ff56e808a101152e957964a73159ab1b8eb995eb9324ef31901a1ebcd450a580d90a43966466979559a08beceb
7
- data.tar.gz: 930fd4563cf8fa781ce8e0e0c5403e9f5dac769920b41d7a927bb5d7f76ffcea4ef68ea308be12c57165dfdc0a2ffb707c2ab6b11e45101dd7b023bee42c58dd
6
+ metadata.gz: 826db033d57b63ef28aacfdf58309ba582b8781236c337b377232b4202e9e600d8cb2d5a07f01c2e1319299ebee14998b90c0ef105e560ff7968252ac04cbdc9
7
+ data.tar.gz: a34e89d3930fa6840d71ccb2207704d9cef375d1339b1d6b9850863ff23bcdad91f07fc793a352a5fc57e6162aa62d37198e6cc9ee51521e509f25643388e684
data/CHANGELOG.md ADDED
@@ -0,0 +1,21 @@
1
+ # Changelog
2
+
3
+ ## [Unreleased](#) (2022-11-13)
4
+
5
+ ### Enhancements:
6
+
7
+ - Update gem 'octokit' from 4.22 to 6.0
8
+ - Add Windows support
9
+
10
+ <br>
11
+
12
+ ## [Initialize](#) (2022-04-12)
13
+
14
+ Initialize the project.
15
+
16
+ <br>
17
+
18
+ <hr>
19
+
20
+ This Changelog is maintained with [chlog](https://github.com/ccmywish/chlog)
21
+
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- # Specify your gem's dependencies in ghcurl.gemspec
6
- gemspec
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in ghcurl.gemspec
6
+ gemspec
data/LICENSE CHANGED
@@ -1,22 +1,22 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 ccmywish
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2022 ccmywish
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,103 +1,100 @@
1
- <div align="center">
2
-
3
- # ghcurl
4
-
5
- [![Gem Version](https://badge.fury.io/rb/ghcurl.svg)](https://rubygems.org/gems/ghcurl)
6
-
7
-
8
- Download files and install from Github releases.
9
-
10
- ```bash
11
- gem install ghcurl
12
- ```
13
-
14
- </div>
15
-
16
- `ghcurl` can recognize your OS and arch, give you the proper option to download. You can search by regular expression, specify a version, and install it to a path or according to the environment variable `GHCURL_BIN_PATH` or just `/usr/local/bin`. It will automatically extract a tar/zip file to make the installation process better.
17
-
18
- Note it doesn't work on Windows.
19
-
20
- <br>
21
-
22
- ## Usage
23
-
24
- ```bash
25
- $ ghcurl [user/]repo [regexp] [options]
26
- ```
27
-
28
- **-o**
29
-
30
- This is optional, download will default to `~/.cache/ghcurl`
31
- 1. `-o path` Download into path
32
- 2. `-o path/name` Download as path/name
33
-
34
- **-v**
35
- 1. `-v 1.0.0` Download tag version 1.0.0
36
- 2. `-v3.1.4` This is also OK to download tag version 3.1.4
37
-
38
- **-i**
39
- 1. `-i` Install to `/usr/local/bin` or `GHCURL_BIN_PATH`
40
- 2. `-i path` Install to path
41
-
42
- **-r**
43
- 1. `-r name` Install the binary as name
44
-
45
- <br>
46
-
47
- ## Example
48
-
49
- Things can be easier. We consider these as popular binaries: https://github.com/ibraheemdev/modern-unix
50
-
51
- Notice: `-i` means to install.
52
-
53
- ```bash
54
- # It knows that's sharkdp/fd
55
- ghcurl fd -i
56
-
57
- # It's cli/cli !
58
- ghcurl gh -i
59
-
60
- # Much easier to install rbspy!
61
- ghcurl rbspy -i
62
- ```
63
-
64
- Download latest deb/rpm package and install, notice the argument `deb` / `rpm` are just regular expressions.
65
- ```bash
66
- ghcurl cli/cli deb -i
67
- ghcurl cli/cli rpm -i
68
- ```
69
-
70
- Normal download
71
- ```bash
72
- # The easiest way to download
73
- ghcurl gh
74
-
75
- # Download to /tmp
76
- ghcurl gh -o /tmp
77
-
78
- # Download latest rbspy-x86_64-unknown-linux-gnu.tar.gz to ~/.cache/ghcurl
79
- ghcurl rbspy/rbspy 'x86_64.*linux'
80
-
81
- # Download rbspy version 0.11.1
82
- ghcurl rbspy/rbspy 'x86_64.*linux' -v0.11.1
83
- ```
84
-
85
- Download a binary and install it to anywhere
86
- ```bash
87
- # Install to /usr/local/bin
88
- ghcurl starship linux-gnu -i
89
-
90
- # Install to ~/tmp/bin
91
- ghcurl BetaPictoris/timeleft -i ~/tmp/bin
92
-
93
- # Download as /tmp/github-cli and install
94
- ghcurl gh -o /tmp/github-cli -i
95
-
96
- # Install and rename it to, here, 'gd' in /usr/local/bin
97
- ghcurl dlvhdr/gh-dash linux-amd64 -i -r 'gd'
98
-
99
- # or, like this
100
- ghcurl dlvhdr/gh-dash linux-amd64 -i ~/tmp/bin/gd
101
- ```
102
-
103
- <br>
1
+ <div align="center">
2
+
3
+ # ghcurl
4
+
5
+ [![Gem Version](https://badge.fury.io/rb/ghcurl.svg)](https://rubygems.org/gems/ghcurl)
6
+
7
+ Download files and install from Github releases. It works on Linux, Windows, macOS and maybe Other OSes.
8
+
9
+ ```bash
10
+ gem install ghcurl
11
+ ```
12
+
13
+ </div>
14
+
15
+ `ghcurl` can recognize your OS and arch, give you the proper option to download. You can search by regular expression, specify a version, and install it to a path or according to the environment variable `GHCURL_BIN_PATH` or just `/usr/local/bin`. It will automatically extract a tar/zip file to make the installation process better.
16
+
17
+ <br>
18
+
19
+ ## Usage
20
+
21
+ ```bash
22
+ $ ghcurl [user/]repo [regexp] [options]
23
+ ```
24
+
25
+ **-o**
26
+
27
+ This is optional, download will default to `~/.cache/ghcurl`
28
+ 1. `-o path` Download into path
29
+ 2. `-o path/name` Download as path/name
30
+
31
+ **-v**
32
+ 1. `-v 1.0.0` Download tag version 1.0.0
33
+ 2. `-v3.1.4` This is also OK to download tag version 3.1.4
34
+
35
+ **-i**
36
+ 1. `-i` Install to `/usr/local/bin` or `GHCURL_BIN_PATH`
37
+ 2. `-i path` Install to path
38
+
39
+ **-r**
40
+ 1. `-r name` Install the binary as name
41
+
42
+ <br>
43
+
44
+ ## Example
45
+
46
+ Things can be easier. We consider these as popular binaries: https://github.com/ibraheemdev/modern-unix
47
+
48
+ Notice: `-i` means to install.
49
+
50
+ ```bash
51
+ # It knows that's sharkdp/fd
52
+ ghcurl fd -i
53
+
54
+ # It's cli/cli !
55
+ ghcurl gh -i
56
+
57
+ # Much easier to install rbspy!
58
+ ghcurl rbspy -i
59
+ ```
60
+
61
+ Download latest deb/rpm package and install, notice the argument `deb` / `rpm` are just regular expressions.
62
+ ```bash
63
+ ghcurl cli/cli deb -i
64
+ ghcurl cli/cli rpm -i
65
+ ```
66
+
67
+ Normal download
68
+ ```bash
69
+ # The easiest way to download
70
+ ghcurl gh
71
+
72
+ # Download to /tmp
73
+ ghcurl gh -o /tmp
74
+
75
+ # Download latest rbspy-x86_64-unknown-linux-gnu.tar.gz to ~/.cache/ghcurl
76
+ ghcurl rbspy/rbspy 'x86_64.*linux'
77
+
78
+ # Download rbspy version 0.11.1
79
+ ghcurl rbspy/rbspy 'x86_64.*linux' -v0.11.1
80
+ ```
81
+
82
+ Download a binary and install it to anywhere
83
+ ```bash
84
+ # Install to /usr/local/bin
85
+ ghcurl starship linux-gnu -i
86
+
87
+ # Install to ~/tmp/bin
88
+ ghcurl BetaPictoris/timeleft -i ~/tmp/bin
89
+
90
+ # Download as /tmp/github-cli and install
91
+ ghcurl gh -o /tmp/github-cli -i
92
+
93
+ # Install and rename it to, here, 'tldr' in /usr/local/bin
94
+ ghcurl dbrgn/tealdeer x86_64 -i -r 'tldr'
95
+
96
+ # or, like this
97
+ ghcurl dlvhdr/gh-dash linux-amd64 -i ~/tmp/bin/gd
98
+ ```
99
+
100
+ <br>
data/Rakefile CHANGED
@@ -1,3 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
- task default: %i[]
1
+ # frozen_string_literal: true
2
+
3
+ task default: %i[]