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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3152b7535b6e704388456ee6d86f841afa554e54722141e8b7dff4e6b17b9d51
4
- data.tar.gz: a3c514a46ad51ceae1c315c74154a3ac51c56160e133612da4895d0d24ab4b65
3
+ metadata.gz: deb17c89cad566a3524baffb93d5b95aee4d10b9a3efa5f164e47ab5bc7579f0
4
+ data.tar.gz: d1a6233fa18d18fd20858bae20f9fdeb8d7e2d5a153e2d25ef517410460349ba
5
5
  SHA512:
6
- metadata.gz: ecc8fa0820605bedb7af26f7a9227e2a91a654d2a0a01ad342793dfbd761cb975dbef826e1e749ab6eed3d66d39fe37f98079dfefaddae67d0131a30e197718c
7
- data.tar.gz: ed461d6cac655cf23daad68b271b53b36d2818103d25e93cc1f63aec598cfd042b23dbaa69efb78c00eaedad96e4486a2b2ec0b098c24d18c7b1f6d41ff50197
6
+ metadata.gz: 46e9992d9e89944e88d9c646157262c2572ec34237cc1783c19fdf23188aba193ab48ba44a03cbbec3f9fd3972964a73a517ae5ac107c8c8c39673f82c803079
7
+ data.tar.gz: 031e2f6f5605eb2fc4db9dd344538a54fb042cc0743cee287c1a697eed4c7cacfb18fb8ec051de9c22dd11d3b155f0018f802b6f8d9de194371ddcfd3e2086b9
data/CHANGELOG.md CHANGED
@@ -4,6 +4,15 @@
4
4
 
5
5
  <br>
6
6
 
7
+ ## [v0.2.2](#) (2023-05-19)
8
+
9
+ ### Enhancements:
10
+
11
+ - Distinguish `gitee help` from `gitee -h`
12
+ - Use `standard_path` to make corss-platform path
13
+
14
+ <br>
15
+
7
16
  ## [v0.2.1](#) (2023-05-19)
8
17
 
9
18
  ### Enhancements:
data/README.md CHANGED
@@ -1,9 +1,13 @@
1
- # Gitee CLI in Ruby
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 -T [pattern] # 显示可执行命令,可以使用pattern来搜索相关命令
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.1"
35
+ VERSION = "0.2.2"
35
36
 
36
- DEFAULT_TOKEN_DIR = File.join ENV['AppData'], "Gitee CLI in Ruby"
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', '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
@@ -7,7 +7,6 @@
7
7
  # gitee4cli:
8
8
  #
9
9
  # Third party Gitee modules for Ruby
10
- #
11
10
  # ---------------------------------------------------------------
12
11
 
13
12
  module Gitee
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.1
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
  '