gitee-cli 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +8 -6
- data/lib/gitee/cli.rb +9 -3
- data/lib/gitee/gitee4cli.rb +0 -1
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: deb17c89cad566a3524baffb93d5b95aee4d10b9a3efa5f164e47ab5bc7579f0
|
4
|
+
data.tar.gz: d1a6233fa18d18fd20858bae20f9fdeb8d7e2d5a153e2d25ef517410460349ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46e9992d9e89944e88d9c646157262c2572ec34237cc1783c19fdf23188aba193ab48ba44a03cbbec3f9fd3972964a73a517ae5ac107c8c8c39673f82c803079
|
7
|
+
data.tar.gz: 031e2f6f5605eb2fc4db9dd344538a54fb042cc0743cee287c1a697eed4c7cacfb18fb8ec051de9c22dd11d3b155f0018f802b6f8d9de194371ddcfd3e2086b9
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,13 @@
|
|
1
|
-
|
1
|
+
<div align="center">
|
2
|
+
|
3
|
+
# Gitee CLI
|
2
4
|
|
3
5
|
![Banner](./images/banner.jpg)
|
4
6
|
|
5
7
|
Work with [Gitee](https://gitee.com/) from the command line.
|
6
8
|
|
9
|
+
</div>
|
10
|
+
|
7
11
|
## Install
|
8
12
|
|
9
13
|
```bash
|
@@ -12,10 +16,6 @@ $ gem install gitee-cli
|
|
12
16
|
|
13
17
|
## Usage
|
14
18
|
|
15
|
-
开发/维护文档: https://rubydoc.info/gems/gitee-cli
|
16
|
-
|
17
|
-
<br>
|
18
|
-
|
19
19
|
使用`gitee-cli`需要`Gitee Access Token`,我们可以通过以下两种方式实现:
|
20
20
|
|
21
21
|
### 方式1(推荐)
|
@@ -72,7 +72,9 @@ $ gitee repo:branches[ccmywish, gitee-cli] GITEE_TOKEN=xxx
|
|
72
72
|
## 命令行
|
73
73
|
|
74
74
|
```bash
|
75
|
-
gitee -
|
75
|
+
gitee -h # 快速帮助
|
76
|
+
|
77
|
+
gitee help [pattern] # 显示可执行命令,可以使用pattern来搜索相关命令
|
76
78
|
|
77
79
|
gitee auth:apply[id,secret] # Apply for an access token using Gitee app
|
78
80
|
gitee auth:temp_apply # Apply for an access token temporarily
|
data/lib/gitee/cli.rb
CHANGED
@@ -10,6 +10,7 @@
|
|
10
10
|
# ---------------------------------------------------------------
|
11
11
|
|
12
12
|
require 'rake'
|
13
|
+
require 'standard_path'
|
13
14
|
|
14
15
|
# Add method for Rake application
|
15
16
|
#
|
@@ -31,9 +32,9 @@ module Gitee
|
|
31
32
|
module CLI
|
32
33
|
|
33
34
|
# gitee-cli version
|
34
|
-
VERSION = "0.2.
|
35
|
+
VERSION = "0.2.2"
|
35
36
|
|
36
|
-
DEFAULT_TOKEN_DIR =
|
37
|
+
DEFAULT_TOKEN_DIR = StandardPath.app_data "Gitee CLI in Ruby"
|
37
38
|
DEFAULT_TOKEN_FILE = File.join DEFAULT_TOKEN_DIR, "sec.json"
|
38
39
|
|
39
40
|
# Read token from local or environment variable
|
@@ -82,7 +83,7 @@ module Gitee
|
|
82
83
|
def self.run
|
83
84
|
argv = ARGV.dup
|
84
85
|
|
85
|
-
help_opts = ['-h', '-H', '--help'
|
86
|
+
help_opts = ['-h', '-H', '--help']
|
86
87
|
version_opts = ['-v', '-V', '--version']
|
87
88
|
|
88
89
|
if argv.empty?
|
@@ -92,6 +93,11 @@ module Gitee
|
|
92
93
|
argv -= help_opts
|
93
94
|
puts help_banner
|
94
95
|
argv << '-T'
|
96
|
+
elsif argv[0] == 'help'
|
97
|
+
help_what = argv[1]
|
98
|
+
argv.clear
|
99
|
+
argv << '-D'
|
100
|
+
argv << help_what if not help_what.nil?
|
95
101
|
elsif argv.intersect? version_opts
|
96
102
|
argv -= version_opts
|
97
103
|
puts version_banner
|
data/lib/gitee/gitee4cli.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitee-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aoran Zeng
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0.7'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: standard_path
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.1.0
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.1.0
|
69
83
|
description: 'Work with Gitee from the command line.
|
70
84
|
|
71
85
|
'
|