gitcloudcli 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +26 -33
- data/gitcloudcli.gemspec +2 -2
- data/lib/gitcloudcli.rb +16 -16
- data/lib/gitcloudcli/command/config.rb +3 -3
- data/lib/gitcloudcli/command/space.rb +5 -5
- data/lib/gitcloudcli/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2d4b246bb89a0f262e46b5f88de3415fa7a665f8e6eb83ba21effe9b17f2081
|
4
|
+
data.tar.gz: 8d726efe08efb9ab318715fb22bf118417f59ee4e47c8c16239b5f06107d595f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ace6982ed7744e04aeb24fcd1eb58524f282deac5581863fab3d3439b4323e8f522d80c303d2b72a2306fd87b216c65558bc51afda6cb4c3c7bab63afeb5c160
|
7
|
+
data.tar.gz: f6b9d4137cf4d9fcabce420884c47336a61690cf9a4a503e50ae0cbe97cc051e2cc54ba066203b07449ea86919df39d9a15406f11f35d3b71d12df60e4dffde9
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,43 +1,36 @@
|
|
1
1
|
# Gitcloudcli
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Use Gitcloudcli to operate files in git
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
9
|
-
Add this line to your application's Gemfile:
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
gem 'gitcloudcli'
|
13
|
-
```
|
14
|
-
|
15
|
-
And then execute:
|
16
|
-
|
17
|
-
$ bundle
|
18
|
-
|
19
|
-
Or install it yourself as:
|
20
|
-
|
21
7
|
$ gem install gitcloudcli
|
22
8
|
|
23
9
|
## Usage
|
24
10
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
40
|
-
|
41
|
-
## Code of Conduct
|
11
|
+
First. Create access token for command line
|
12
|
+
##### Github
|
13
|
+
[click here](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/)
|
14
|
+
##### Gitee(oschina)
|
15
|
+
gitcloudcli will support
|
16
|
+
in future
|
17
|
+
##### Gitlab
|
18
|
+
gitcloudcli will support
|
19
|
+
in future
|
20
|
+
|
21
|
+
Second. Add token, repo and spacename to gitcloud
|
22
|
+
```cassandraql
|
23
|
+
gitcloud space add Github *****.git ****c958
|
24
|
+
```
|
42
25
|
|
43
|
-
|
26
|
+
Third. Use gitcloud to use this tool
|
27
|
+
```cassandraql
|
28
|
+
Commands:
|
29
|
+
gitcloud --version, -v # print the version
|
30
|
+
gitcloud delete PATH # 删除远端文件
|
31
|
+
gitcloud help [COMMAND] # Describe available commands or one specific command
|
32
|
+
gitcloud info PATH # 展示远端文件信息
|
33
|
+
gitcloud list # 展示远端根目录所有文件信息
|
34
|
+
gitcloud space [COMMAND] # 增加,删除,列出当前可操作的Git空间
|
35
|
+
gitcloud upload LOCALPATH # 上传本地文件
|
36
|
+
```
|
data/gitcloudcli.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["zhangheng"]
|
10
10
|
spec.email = ["onethousandpiece@126.com"]
|
11
11
|
|
12
|
-
spec.summary = "
|
13
|
-
spec.description = "
|
12
|
+
spec.summary = "git repo's cli"
|
13
|
+
spec.description = "git repo's cli that can create, delete files and other operations"
|
14
14
|
spec.homepage = "https://github.com/monkeyheng/GitCloudCLI"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
data/lib/gitcloudcli.rb
CHANGED
@@ -7,39 +7,39 @@ require "thor"
|
|
7
7
|
module Gitcloudcli
|
8
8
|
# 命令行入口
|
9
9
|
class Cli < Thor
|
10
|
-
desc "list", "
|
11
|
-
option :space, :desc=>"
|
12
|
-
option :dir, :desc=>"
|
13
|
-
option :infos, :desc=>"
|
10
|
+
desc "list", "show all files in the remote"
|
11
|
+
option :space, :desc=>"git space name"
|
12
|
+
option :dir, :desc=>"the dir of files that need show"
|
13
|
+
option :infos, :desc=>"the key of this file infos that printed", :type=>:array
|
14
14
|
def list()
|
15
15
|
Gitcloudcli.gitadapter(options[:space]) do |git|
|
16
16
|
git.list(options[:dir], options[:infos])
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
-
desc "info PATH", "
|
21
|
-
option :space, :desc=>"
|
22
|
-
option :infos, :desc=>"
|
20
|
+
desc "info PATH", "get the remote file infos"
|
21
|
+
option :space, :desc=>"git space name"
|
22
|
+
option :infos, :desc=>"the key of this file infos that printed", :type=>:array
|
23
23
|
def info(path)
|
24
24
|
Gitcloudcli.gitadapter(options[:space]) do |git|
|
25
25
|
git.info(path, options[:infos])
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
desc "upload LOCALPATH", "
|
30
|
-
option :space, :desc=>"
|
31
|
-
option :path, :desc=>"
|
32
|
-
option :message, :desc=>"
|
33
|
-
option :infos, :desc=>"
|
29
|
+
desc "upload LOCALPATH", "upload local file"
|
30
|
+
option :space, :desc=>"git space name"
|
31
|
+
option :path, :desc=>"upload path. example:dirname/filename or filename"
|
32
|
+
option :message, :desc=>"commit info for this operation"
|
33
|
+
option :infos, :desc=>"the key of this file infos that printed", :type=>:array
|
34
34
|
def upload(local_path)
|
35
35
|
Gitcloudcli.gitadapter(options[:space]) do |git|
|
36
36
|
git.upload(local_path, options[:path], options[:message], options[:infos])
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
desc "delete PATH", "
|
41
|
-
option :space, :desc=>"
|
42
|
-
option :message, :desc=>"
|
40
|
+
desc "delete PATH", "delete file"
|
41
|
+
option :space, :desc=>"git space name"
|
42
|
+
option :message, :desc=>"commit info for this operation"
|
43
43
|
def delete(path)
|
44
44
|
Gitcloudcli.gitadapter(options[:space]) do |git|
|
45
45
|
git.delete(path, options[:message])
|
@@ -52,7 +52,7 @@ module Gitcloudcli
|
|
52
52
|
puts Gitcloudcli::VERSION
|
53
53
|
end
|
54
54
|
|
55
|
-
desc "space [COMMAND]", "
|
55
|
+
desc "space [COMMAND]", "manage git space"
|
56
56
|
subcommand "space", Gitcloudcli::CloudSpace
|
57
57
|
end
|
58
58
|
end
|
@@ -43,7 +43,7 @@ module Gitcloudcli
|
|
43
43
|
break
|
44
44
|
end
|
45
45
|
else
|
46
|
-
puts "
|
46
|
+
puts "SPACE is null,use default #{key}"
|
47
47
|
remote = value["remote"]
|
48
48
|
token = value["token"]
|
49
49
|
break
|
@@ -54,10 +54,10 @@ module Gitcloudcli
|
|
54
54
|
if remote.to_s.include? "github.com"
|
55
55
|
yield Gitcloudcli::Github.new(remote, token)
|
56
56
|
else
|
57
|
-
puts "#{space} #{remote}
|
57
|
+
puts "#{space} #{remote} not supported"
|
58
58
|
end
|
59
59
|
else
|
60
|
-
puts "
|
60
|
+
puts "git space is empty"
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
@@ -4,7 +4,7 @@ require "gitcloudcli/command/config"
|
|
4
4
|
module Gitcloudcli
|
5
5
|
# 空间操作
|
6
6
|
class CloudSpace < Thor
|
7
|
-
desc "list", "
|
7
|
+
desc "list", "show current git spaces"
|
8
8
|
def list
|
9
9
|
configs = Gitcloudcli.configHash
|
10
10
|
configs.each do |key|
|
@@ -12,11 +12,11 @@ module Gitcloudcli
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
desc "add NAME URL TOKEN", "
|
15
|
+
desc "add NAME URL TOKEN", "add git space"
|
16
16
|
def add(name, url, token)
|
17
17
|
configs = Gitcloudcli.configHash
|
18
18
|
if configs[name]
|
19
|
-
puts "#{name}
|
19
|
+
puts "#{name} existed"
|
20
20
|
return
|
21
21
|
end
|
22
22
|
configs[name] = {
|
@@ -26,11 +26,11 @@ module Gitcloudcli
|
|
26
26
|
Gitcloudcli.configCover(configs)
|
27
27
|
end
|
28
28
|
|
29
|
-
desc "remove NAME", "
|
29
|
+
desc "remove NAME", "delete git space"
|
30
30
|
def remove(name)
|
31
31
|
configs = Gitcloudcli.configHash
|
32
32
|
if !configs[name]
|
33
|
-
puts "#{name}
|
33
|
+
puts "#{name} does not exist"
|
34
34
|
return
|
35
35
|
end
|
36
36
|
configs.delete(name)
|
data/lib/gitcloudcli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitcloudcli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zhangheng
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
description:
|
55
|
+
description: git repo's cli that can create, delete files and other operations
|
56
56
|
email:
|
57
57
|
- onethousandpiece@126.com
|
58
58
|
executables:
|
@@ -102,5 +102,5 @@ rubyforge_project:
|
|
102
102
|
rubygems_version: 2.7.8
|
103
103
|
signing_key:
|
104
104
|
specification_version: 4
|
105
|
-
summary:
|
105
|
+
summary: git repo's cli
|
106
106
|
test_files: []
|