github_cli 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +14 -3
- data/CHANGELOG.md +15 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +41 -44
- data/README.md +77 -14
- data/Rakefile +4 -2
- data/features/assignee.feature +1 -0
- data/features/blob.feature +1 -0
- data/features/collaborator.feature +1 -0
- data/features/commit.feature +2 -1
- data/features/config.feature +27 -28
- data/features/event.feature +1 -0
- data/features/init.feature +20 -23
- data/features/key.feature +5 -5
- data/features/milestone.feature +3 -2
- data/features/reference.feature +3 -2
- data/features/starring.feature +1 -0
- data/features/support/hooks.rb +1 -1
- data/features/tag.feature +2 -1
- data/features/tree.feature +17 -0
- data/features/watching.feature +1 -0
- data/fixtures/simple_config +3 -5
- data/github_cli.gemspec +1 -1
- data/lib/github_cli/api.rb +11 -6
- data/lib/github_cli/apis/event.rb +8 -8
- data/lib/github_cli/apis/label.rb +0 -12
- data/lib/github_cli/apis/starring.rb +5 -5
- data/lib/github_cli/apis/watching.rb +5 -5
- data/lib/github_cli/cli.rb +21 -30
- data/lib/github_cli/command.rb +1 -1
- data/lib/github_cli/commands/authorizations.rb +28 -2
- data/lib/github_cli/commands/collaborators.rb +12 -12
- data/lib/github_cli/commands/commits.rb +18 -2
- data/lib/github_cli/commands/events.rb +6 -8
- data/lib/github_cli/commands/followers.rb +1 -1
- data/lib/github_cli/commands/labels.rb +22 -20
- data/lib/github_cli/commands/milestones.rb +43 -13
- data/lib/github_cli/commands/references.rb +21 -6
- data/lib/github_cli/commands/starring.rb +3 -2
- data/lib/github_cli/commands/tags.rb +16 -1
- data/lib/github_cli/commands/trees.rb +11 -5
- data/lib/github_cli/commands/watching.rb +3 -2
- data/lib/github_cli/config.rb +15 -6
- data/lib/github_cli/dsl.rb +2 -2
- data/lib/github_cli/formatter.rb +2 -3
- data/lib/github_cli/formatters/csv.rb +29 -14
- data/lib/github_cli/formatters/table.rb +2 -3
- data/lib/github_cli/man/gcli-config.1 +17 -13
- data/lib/github_cli/man/gcli-config.1.txt +23 -21
- data/lib/github_cli/vendor/thor/actions/create_link.rb +3 -0
- data/lib/github_cli/vendor/thor/actions/directory.rb +29 -10
- data/lib/github_cli/vendor/thor/actions/file_manipulation.rb +9 -3
- data/lib/github_cli/vendor/thor/actions.rb +18 -18
- data/lib/github_cli/vendor/thor/base.rb +97 -89
- data/lib/github_cli/vendor/thor/{task.rb → command.rb} +16 -12
- data/lib/github_cli/vendor/thor/core_ext/hash_with_indifferent_access.rb +5 -0
- data/lib/github_cli/vendor/thor/core_ext/io_binary_read.rb +12 -0
- data/lib/github_cli/vendor/thor/error.rb +4 -7
- data/lib/github_cli/vendor/thor/group.rb +34 -32
- data/lib/github_cli/vendor/thor/invocation.rb +28 -26
- data/lib/github_cli/vendor/thor/parser/options.rb +66 -26
- data/lib/github_cli/vendor/thor/rake_compat.rb +3 -2
- data/lib/github_cli/vendor/thor/runner.rb +21 -20
- data/lib/github_cli/vendor/thor/shell/basic.rb +20 -16
- data/lib/github_cli/vendor/thor/shell/color.rb +13 -9
- data/lib/github_cli/vendor/thor/shell/html.rb +13 -9
- data/lib/github_cli/vendor/thor/util.rb +214 -210
- data/lib/github_cli/vendor/thor/version.rb +1 -1
- data/lib/github_cli/vendor/thor.rb +232 -153
- data/lib/github_cli/version.rb +1 -1
- data/man/gcli-config.1.ronn +14 -11
- data/spec/github_cli/commands/assignees_spec.rb +20 -0
- data/spec/github_cli/commands/blobs_spec.rb +21 -0
- data/spec/github_cli/commands/collaborators_spec.rb +31 -0
- data/spec/github_cli/commands/commits_spec.rb +26 -0
- data/spec/github_cli/commands/emails_spec.rb +24 -0
- data/spec/github_cli/commands/events_spec.rb +56 -0
- data/spec/github_cli/commands/followers_spec.rb +44 -0
- data/spec/github_cli/commands/keys_spec.rb +36 -0
- data/spec/github_cli/commands/labels_spec.rb +61 -0
- data/spec/github_cli/commands/milestones_spec.rb +47 -0
- data/spec/github_cli/commands/references_spec.rb +42 -0
- data/spec/github_cli/commands/starring_spec.rb +40 -0
- data/spec/github_cli/commands/tags_spec.rb +26 -0
- data/spec/github_cli/commands/trees_spec.rb +32 -0
- data/spec/github_cli/commands/watching_spec.rb +40 -0
- data/spec/github_cli/config_spec.rb +109 -116
- data/spec/github_cli/util/convert_value_spec.rb +19 -0
- data/spec/github_cli/util/convert_values_spec.rb +14 -0
- data/spec/github_cli/util_spec.rb +0 -29
- metadata +51 -19
- data/lib/github_cli/vendor/thor/core_ext/dir_escape.rb +0 -0
- data/lib/github_cli/vendor/thor/core_ext/file_binary_read.rb +0 -9
- data/lib/github_cli/vendor/thor/empty.txt +0 -0
data/.travis.yml
CHANGED
@@ -1,11 +1,22 @@
|
|
1
|
+
language: ruby
|
1
2
|
before_install:
|
2
3
|
- gem install bundler
|
3
|
-
matrix:
|
4
|
-
allow_failures:
|
5
|
-
- rvm: ruby-head
|
6
4
|
rvm:
|
7
5
|
- 1.9.2
|
8
6
|
- 1.9.3
|
7
|
+
- 2.0.0
|
8
|
+
- ruby-head
|
9
|
+
- jruby-18mode
|
10
|
+
- jruby-19mode
|
11
|
+
- rbx-18mode
|
12
|
+
- rbx-19mode
|
13
|
+
- jruby-head
|
14
|
+
matrix:
|
15
|
+
allow_failures:
|
16
|
+
- rvm: ruby-head
|
17
|
+
- rvm: jruby-head
|
18
|
+
- rvm: jruby-18mode
|
19
|
+
- rvm: jruby-19mode
|
9
20
|
branches:
|
10
21
|
only: master
|
11
22
|
notifications:
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
0.5.4 (March 23, 2013)
|
2
|
+
|
3
|
+
* Update vendor dependency
|
4
|
+
* Update github_api dependency
|
5
|
+
* Change Labels commands to merge milestones and issues listing into list command
|
6
|
+
* Change Tags create to take specific options and add tests
|
7
|
+
* Change References create to take specific options and add tests
|
8
|
+
* Chnage Tree create to take specific options and add tests
|
9
|
+
* Change Commit create to take specific options and add tests
|
10
|
+
* Change Milestone commands to take specific options
|
11
|
+
* Change table and csv formatters to work with new 'github_api'
|
12
|
+
* Change init command to be global by default and accept filename
|
13
|
+
* Add filename to config class to allow for easy parametrization
|
14
|
+
* Change config command to be global by default and add feature tests
|
15
|
+
|
1
16
|
0.5.3 (September 29, 2012)
|
2
17
|
|
3
18
|
* Fix bug with starring api starred command.[Issue #6]
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,78 +1,75 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
github_cli (0.5.
|
5
|
-
github_api (~> 0.
|
4
|
+
github_cli (0.5.4)
|
5
|
+
github_api (~> 0.9)
|
6
6
|
|
7
|
-
|
8
|
-
remote:
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
+
aruba (0.5.1)
|
11
|
+
childprocess (~> 0.3.6)
|
12
|
+
cucumber (>= 1.1.1)
|
13
|
+
rspec-expectations (>= 2.7.0)
|
14
|
+
builder (3.1.4)
|
15
|
+
childprocess (0.3.7)
|
16
|
+
ffi (~> 1.0, >= 1.0.6)
|
10
17
|
communist (0.3.0)
|
11
18
|
json
|
12
19
|
rack
|
13
20
|
sinatra
|
14
|
-
|
15
|
-
GEM
|
16
|
-
remote: https://rubygems.org/
|
17
|
-
specs:
|
18
|
-
aruba (0.4.11)
|
19
|
-
childprocess (>= 0.2.3)
|
20
|
-
cucumber (>= 1.1.1)
|
21
|
-
ffi (>= 1.0.11)
|
22
|
-
rspec (>= 2.7.0)
|
23
|
-
builder (3.0.0)
|
24
|
-
childprocess (0.3.2)
|
25
|
-
ffi (~> 1.0.6)
|
26
21
|
cucumber (1.2.1)
|
27
22
|
builder (>= 2.1.2)
|
28
23
|
diff-lcs (>= 1.1.3)
|
29
24
|
gherkin (~> 2.11.0)
|
30
25
|
json (>= 1.4.6)
|
31
|
-
diff-lcs (1.1
|
32
|
-
faraday (0.8.
|
26
|
+
diff-lcs (1.2.1)
|
27
|
+
faraday (0.8.6)
|
33
28
|
multipart-post (~> 1.1)
|
34
|
-
ffi (1.
|
35
|
-
gherkin (2.11.
|
36
|
-
json (>= 1.
|
37
|
-
github_api (0.
|
29
|
+
ffi (1.3.1)
|
30
|
+
gherkin (2.11.6)
|
31
|
+
json (>= 1.7.6)
|
32
|
+
github_api (0.9.3)
|
38
33
|
faraday (~> 0.8.1)
|
39
|
-
hashie (~>
|
40
|
-
multi_json (~> 1.
|
34
|
+
hashie (~> 2.0)
|
35
|
+
multi_json (~> 1.4)
|
41
36
|
nokogiri (~> 1.5.2)
|
42
37
|
oauth2
|
43
|
-
hashie (
|
38
|
+
hashie (2.0.2)
|
44
39
|
hpricot (0.8.6)
|
45
|
-
httpauth (0.
|
46
|
-
json (1.7.
|
47
|
-
jwt (0.1.
|
48
|
-
multi_json (>= 1.
|
49
|
-
multi_json (1.
|
50
|
-
|
40
|
+
httpauth (0.2.0)
|
41
|
+
json (1.7.6)
|
42
|
+
jwt (0.1.7)
|
43
|
+
multi_json (>= 1.5)
|
44
|
+
multi_json (1.6.1)
|
45
|
+
multi_xml (0.5.3)
|
46
|
+
multipart-post (1.2.0)
|
51
47
|
mustache (0.99.4)
|
52
|
-
nokogiri (1.5.
|
53
|
-
oauth2 (0.
|
48
|
+
nokogiri (1.5.6)
|
49
|
+
oauth2 (0.9.1)
|
54
50
|
faraday (~> 0.8)
|
55
51
|
httpauth (~> 0.1)
|
56
52
|
jwt (~> 0.1.4)
|
57
53
|
multi_json (~> 1.0)
|
54
|
+
multi_xml (~> 0.5)
|
58
55
|
rack (~> 1.2)
|
59
|
-
rack (1.
|
56
|
+
rack (1.5.2)
|
60
57
|
rack-protection (1.2.0)
|
61
58
|
rack
|
62
|
-
rake (0.
|
59
|
+
rake (10.0.3)
|
63
60
|
rdiscount (1.6.8)
|
64
61
|
ronn (0.7.3)
|
65
62
|
hpricot (>= 0.8.2)
|
66
63
|
mustache (>= 0.7.0)
|
67
64
|
rdiscount (>= 1.5.8)
|
68
|
-
rspec (2.
|
69
|
-
rspec-core (~> 2.
|
70
|
-
rspec-expectations (~> 2.
|
71
|
-
rspec-mocks (~> 2.
|
72
|
-
rspec-core (2.
|
73
|
-
rspec-expectations (2.
|
74
|
-
diff-lcs (
|
75
|
-
rspec-mocks (2.
|
65
|
+
rspec (2.13.0)
|
66
|
+
rspec-core (~> 2.13.0)
|
67
|
+
rspec-expectations (~> 2.13.0)
|
68
|
+
rspec-mocks (~> 2.13.0)
|
69
|
+
rspec-core (2.13.0)
|
70
|
+
rspec-expectations (2.13.0)
|
71
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
72
|
+
rspec-mocks (2.13.0)
|
76
73
|
sinatra (1.3.2)
|
77
74
|
rack (~> 1.3, >= 1.3.6)
|
78
75
|
rack-protection (~> 1.2)
|
@@ -84,7 +81,7 @@ PLATFORMS
|
|
84
81
|
|
85
82
|
DEPENDENCIES
|
86
83
|
aruba
|
87
|
-
communist
|
84
|
+
communist
|
88
85
|
github_cli!
|
89
86
|
rake
|
90
87
|
ronn
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# GithubCLI
|
2
|
-
[![Build Status](https://secure.travis-ci.org/peter-murach/github_cli.png?branch=master)][travis] [![Dependency Status](https://gemnasium.com/peter-murach/github_cli.png?travis)][gemnasium] [![Code Climate](https://codeclimate.com/badge.png)][codeclimate]
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/github_cli.png)](http://badge.fury.io/rb/github_cli) [![Build Status](https://secure.travis-ci.org/peter-murach/github_cli.png?branch=master)][travis] [![Dependency Status](https://gemnasium.com/peter-murach/github_cli.png?travis)][gemnasium] [![Code Climate](https://codeclimate.com/badge.png)][codeclimate]
|
3
3
|
|
4
4
|
[travis]: http://travis-ci.org/peter-murach/github_cli
|
5
5
|
[gemnasium]: https://gemnasium.com/peter-murach/github_cli
|
@@ -7,6 +7,8 @@
|
|
7
7
|
|
8
8
|
CLI-based access to GitHub API v3 that works hand-in-hand with `github_api` gem.
|
9
9
|
|
10
|
+
Important!: This library is currently being updated to include all Github API requests and undergoes rapid development cycles. A feature roadmap will be added shortly.
|
11
|
+
|
10
12
|
![Interface](https://github.com/peter-murach/github_cli/raw/master/screenshots/interface.png)
|
11
13
|
|
12
14
|
## Installation
|
@@ -36,31 +38,85 @@ $ gcli
|
|
36
38
|
The first step is to create a configuration file, either global in home directory or local inside the project:
|
37
39
|
|
38
40
|
```shell
|
39
|
-
$ gcli init [--
|
41
|
+
$ gcli init [--local] [filename]
|
40
42
|
```
|
41
43
|
|
42
|
-
|
43
|
-
with all the global settings.
|
44
|
-
|
44
|
+
Without any options this command will setup a `.githubrc` configuration file in
|
45
|
+
your home/project directory with all the global settings. By passing `--local` option the config file will be created locally in the execution directory. Further, by default `.githubrc` name is used which can be changed by passing the `filename`.
|
46
|
+
|
47
|
+
Main configuration options are:
|
48
|
+
|
49
|
+
```
|
50
|
+
user.token # Authentication token
|
51
|
+
user.login # User login
|
52
|
+
user.password # User password
|
53
|
+
user.name # Default user name
|
54
|
+
user.repo # Default repo name
|
55
|
+
user.org # Default organization name
|
56
|
+
core.editor # Editor to be opened
|
57
|
+
core.pager # Pager to be used, by default less
|
58
|
+
core.format # Output formating
|
59
|
+
core.auto_pagination # Switch on default results pagination, default false
|
60
|
+
```
|
45
61
|
|
46
62
|
Moreover, `gcli config` command allows you to set/get any configuration option such as output format, editor or oauth token.
|
47
63
|
|
48
|
-
For instance, to check value for your `token` do
|
64
|
+
For instance, to check value for your `authentication token` do
|
49
65
|
|
50
66
|
```shell
|
51
|
-
$ gcli config [--
|
67
|
+
$ gcli config [--local] user.token
|
52
68
|
```
|
53
69
|
|
54
70
|
and to set the value do
|
55
71
|
|
56
72
|
```shell
|
57
|
-
$ gcli config [--
|
73
|
+
$ gcli config [--local] user.token lh23l4kj234....
|
58
74
|
```
|
59
75
|
|
60
76
|
To list specific options
|
61
77
|
|
62
78
|
```shell
|
63
|
-
$ gcli config [--
|
79
|
+
$ gcli config [--local] --list [regex]
|
80
|
+
```
|
81
|
+
|
82
|
+
To edit config in your favourite editor:
|
83
|
+
|
84
|
+
```shell
|
85
|
+
$ gcli config -e
|
86
|
+
```
|
87
|
+
|
88
|
+
Finally, to see a manpage about available configuration options do
|
89
|
+
|
90
|
+
```shell
|
91
|
+
$ gcli help config
|
92
|
+
```
|
93
|
+
|
94
|
+
### Authorization
|
95
|
+
|
96
|
+
To create oauth tokens you need to setup your basic authentication like so
|
97
|
+
|
98
|
+
```shell
|
99
|
+
$ gcli init
|
100
|
+
$ gcli config user.login '...'
|
101
|
+
$ gcli config user.password '...'
|
102
|
+
```
|
103
|
+
|
104
|
+
Then to create your token do
|
105
|
+
|
106
|
+
```shell
|
107
|
+
$ gcli auth create --scopes=repo --note=gihtub_cli --note-url=http://github.com/peter-murach/github_cli
|
108
|
+
```
|
109
|
+
|
110
|
+
To see your current tokens do
|
111
|
+
|
112
|
+
```shell
|
113
|
+
$ gcli auth ls
|
114
|
+
```
|
115
|
+
|
116
|
+
Finally to add the token to your config do
|
117
|
+
|
118
|
+
```shell
|
119
|
+
$ gcli config user.token '...'
|
64
120
|
```
|
65
121
|
|
66
122
|
### Arguments
|
@@ -70,16 +126,16 @@ The required arguments come first as per command description, then are followed
|
|
70
126
|
For instance, one can create repository by supplying parameters in the following way:
|
71
127
|
|
72
128
|
```shell
|
73
|
-
$ gcli repo create
|
129
|
+
$ gcli repo create github_api --desc='Test repo for kitty.'
|
74
130
|
```
|
75
131
|
|
76
132
|
To create repository inside organization:
|
77
133
|
|
78
134
|
```shell
|
79
|
-
$ gcli repo create github/
|
135
|
+
$ gcli repo create github/github_api --desc='Test repo for kitty.'
|
80
136
|
```
|
81
137
|
|
82
|
-
To find out which options are required and which are optional
|
138
|
+
To find out which options are required and which are optional use `help` command:
|
83
139
|
|
84
140
|
```shell
|
85
141
|
$ gcli repo help create
|
@@ -155,7 +211,14 @@ $ gcli download
|
|
155
211
|
$ gcli fork
|
156
212
|
$ gcli hook
|
157
213
|
$ gcli key
|
158
|
-
|
214
|
+
```
|
215
|
+
|
216
|
+
Interact with activities:
|
217
|
+
|
218
|
+
```shell
|
219
|
+
$ gcli star
|
220
|
+
$ gcli watch
|
221
|
+
$ gcli event
|
159
222
|
```
|
160
223
|
|
161
224
|
Interact with gists:
|
@@ -202,4 +265,4 @@ $ gcli search
|
|
202
265
|
|
203
266
|
## Copyright
|
204
267
|
|
205
|
-
Copyright (c) 2012 Piotr Murach. See LICENSE for further details.
|
268
|
+
Copyright (c) 2012-2013 Piotr Murach. See LICENSE for further details.
|
data/Rakefile
CHANGED
@@ -8,12 +8,14 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
|
|
8
8
|
spec.pattern = FileList['spec/**/*_spec.rb']
|
9
9
|
end
|
10
10
|
|
11
|
-
Cucumber::Rake::Task.new(:features)
|
12
|
-
|
13
11
|
task :default => [:spec, :features]
|
14
12
|
|
15
13
|
task :release => ["man:clean", "man:build"]
|
16
14
|
|
15
|
+
task :features do
|
16
|
+
sh 'bundle exec cucumber -f progress -t @ci-run features'
|
17
|
+
end
|
18
|
+
|
17
19
|
begin
|
18
20
|
require 'ronn'
|
19
21
|
|
data/features/assignee.feature
CHANGED
data/features/blob.feature
CHANGED
data/features/commit.feature
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
Feature: gcli commit
|
2
2
|
|
3
|
+
@ci-run
|
3
4
|
Scenario: Available commands
|
4
5
|
|
5
6
|
When I run `gcli commit`
|
@@ -20,5 +21,5 @@ Feature: gcli commit
|
|
20
21
|
"""
|
21
22
|
post('/repos/wycats/thor/git/commits') { status 200 }
|
22
23
|
"""
|
23
|
-
When I run `gcli commit create wycats thor --
|
24
|
+
When I run `gcli commit create wycats thor --message='my commit' --tree=827efc --parents=['7d1b31e']`
|
24
25
|
Then the exit status should be 0
|
data/features/config.feature
CHANGED
@@ -1,55 +1,54 @@
|
|
1
|
+
@ci-run
|
1
2
|
Feature: Configuration file
|
2
3
|
|
3
|
-
Scenario: Config requires scope
|
4
|
-
When I run `gcli config`
|
5
|
-
Then the output should contain:
|
6
|
-
"""
|
7
|
-
Invalid scope given. Please use --local or --global.
|
8
|
-
"""
|
9
|
-
|
10
4
|
Scenario: Missing global file
|
11
|
-
When I run `gcli config
|
5
|
+
When I run `gcli config`
|
12
6
|
Then the output should contain:
|
13
7
|
"""
|
14
|
-
|
8
|
+
Configuration file does not exist. Please use `gcli init` to create one.
|
15
9
|
"""
|
16
10
|
|
17
11
|
Scenario: Missing local file
|
18
12
|
When I run `gcli config --local`
|
19
13
|
Then the output should contain:
|
20
14
|
"""
|
21
|
-
|
15
|
+
Configuration file does not exist. Please use `gcli init` to create one.
|
22
16
|
"""
|
23
17
|
|
24
18
|
Scenario: List global file options
|
25
|
-
Given I run `gcli init
|
26
|
-
|
27
|
-
When I run `gcli config --global`
|
19
|
+
Given I run `gcli init`
|
20
|
+
When I run `gcli config`
|
28
21
|
Then the output should contain:
|
29
22
|
"""
|
30
23
|
Configuration options:
|
31
24
|
"""
|
32
25
|
|
26
|
+
Scenario: Seek local before global configuration
|
27
|
+
Given a directory named "piotr"
|
28
|
+
And I cd to "piotr"
|
29
|
+
And I run `gcli init --local`
|
30
|
+
When I run `gcli config`
|
31
|
+
Then the output should contain:
|
32
|
+
"""
|
33
|
+
Configuration options:
|
34
|
+
"""
|
35
|
+
|
33
36
|
Scenario: Read existing option
|
34
|
-
Given I run `gcli init
|
35
|
-
|
36
|
-
When I successfully run `gcli config --global auth.token`
|
37
|
+
Given I run `gcli init`
|
38
|
+
When I successfully run `gcli config user.token abc123`
|
37
39
|
Then the stdout should contain "abc123"
|
38
40
|
|
39
41
|
Scenario: Read missing option
|
40
|
-
Given I run `gcli init
|
41
|
-
|
42
|
-
When I run `gcli config --global missing.key`
|
42
|
+
Given I run `gcli init`
|
43
|
+
When I run `gcli config missing.key`
|
43
44
|
Then the exit status should be 0
|
44
45
|
|
45
|
-
Scenario: Write
|
46
|
-
Given I run `gcli init
|
47
|
-
|
48
|
-
When I successfully run `gcli config --global auth.token eee555`
|
46
|
+
Scenario: Write custom option
|
47
|
+
Given I run `gcli init`
|
48
|
+
When I successfully run `gcli config core.host eee555`
|
49
49
|
Then the stdout should contain "eee555"
|
50
50
|
|
51
|
-
Scenario:
|
52
|
-
Given I run `gcli init
|
53
|
-
|
54
|
-
|
55
|
-
Then the stdout should contain "eee555"
|
51
|
+
Scenario: Listing all configuration options
|
52
|
+
Given I run `gcli init`
|
53
|
+
When I run `gcli config -l`
|
54
|
+
Then the stdout should contain "user.token"
|
data/features/event.feature
CHANGED
data/features/init.feature
CHANGED
@@ -1,38 +1,29 @@
|
|
1
|
-
@
|
1
|
+
@ci-run
|
2
2
|
Feature: Init command
|
3
3
|
|
4
4
|
As a developer who wants to set global settings for interaction with GitHub API
|
5
|
-
When I use interface provided by
|
5
|
+
When I use interface provided by GCLI
|
6
6
|
I have ability to create configuration file
|
7
7
|
|
8
|
-
Scenario:
|
8
|
+
Scenario: Installs global config file
|
9
9
|
When I run `gcli init`
|
10
10
|
Then the output should contain:
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
When I run `gcli init --global` interactively
|
17
|
-
And I type "token"
|
18
|
-
Then the output should contain:
|
19
|
-
"""
|
20
|
-
Writing new configuration file to /tmp/fakehome/.githubrc
|
21
|
-
"""
|
22
|
-
And a file named "/tmp/fakehome/.githubrc" should exist
|
23
|
-
And the file "/tmp/fakehome/.githubrc" should contain "auth.token: token"
|
11
|
+
"""
|
12
|
+
Writing new configuration file to /tmp/fakehome/.githubrc
|
13
|
+
"""
|
14
|
+
And a file named "/tmp/fakehome/.githubrc" should exist
|
15
|
+
And the file "/tmp/fakehome/.githubrc" should contain "user.token:"
|
24
16
|
|
25
17
|
Scenario: Installs local config file
|
26
18
|
Given a directory named "piotr"
|
27
19
|
When I cd to "piotr"
|
28
|
-
And I run `gcli init --local`
|
29
|
-
And I type "token"
|
20
|
+
And I run `gcli init --local`
|
30
21
|
Then a file named ".githubrc" should exist
|
31
|
-
|
22
|
+
And the file ".githubrc" should contain "user.token:"
|
32
23
|
|
33
24
|
Scenario: Global config file arleady exists
|
34
25
|
Given an empty file named "/tmp/fakehome/.githubrc"
|
35
|
-
When I run `gcli init
|
26
|
+
When I run `gcli init`
|
36
27
|
Then the output should contain:
|
37
28
|
"""
|
38
29
|
Not overwritting existing config file /tmp/fakehome/.githubrc, use --force to override.
|
@@ -40,9 +31,15 @@ Feature: Init command
|
|
40
31
|
|
41
32
|
Scenario: Force global config file override
|
42
33
|
Given an empty file named "/tmp/fakehome/.githubrc"
|
43
|
-
When I run `gcli init --
|
44
|
-
And I type "token"
|
34
|
+
When I run `gcli init --force`
|
45
35
|
Then the output should contain:
|
46
36
|
"""
|
47
|
-
|
37
|
+
Writing new configuration file to /tmp/fakehome/.githubrc
|
48
38
|
"""
|
39
|
+
|
40
|
+
Scenario: Install config file with custom name
|
41
|
+
When I run `gcli init .custom-name`
|
42
|
+
Then the output should contain:
|
43
|
+
"""
|
44
|
+
Writing new configuration file to /tmp/fakehome/.custom-name
|
45
|
+
"""
|
data/features/key.feature
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Feature: gcli key
|
2
2
|
|
3
|
+
@commands
|
3
4
|
Scenario: Available commands
|
4
|
-
|
5
5
|
When I run `gcli key`
|
6
6
|
Then the exit status should be 0
|
7
7
|
And the output should contain "gcli key create"
|
@@ -13,7 +13,7 @@ Feature: gcli key
|
|
13
13
|
Scenario: List keys
|
14
14
|
Given the GitHub API server:
|
15
15
|
"""
|
16
|
-
get('/repos/wycats/thor/keys') {
|
16
|
+
get('/repos/wycats/thor/keys') { json [{:key => "ssh"}] }
|
17
17
|
"""
|
18
18
|
When I run `gcli key ls wycats thor`
|
19
19
|
Then the exit status should be 0
|
@@ -21,7 +21,7 @@ Feature: gcli key
|
|
21
21
|
Scenario: Get key
|
22
22
|
Given the GitHub API server:
|
23
23
|
"""
|
24
|
-
get('/repos/wycats/thor/keys/1') {
|
24
|
+
get('/repos/wycats/thor/keys/1') { json :key => "ssh" }
|
25
25
|
"""
|
26
26
|
When I run `gcli key get wycats thor 1`
|
27
27
|
Then the exit status should be 0
|
@@ -29,7 +29,7 @@ Feature: gcli key
|
|
29
29
|
Scenario: Create key
|
30
30
|
Given the GitHub API server:
|
31
31
|
"""
|
32
|
-
post('/repos/wycats/thor/keys') {
|
32
|
+
post('/repos/wycats/thor/keys') { json :key => "ssh" }
|
33
33
|
"""
|
34
34
|
When I run `gcli key create wycats thor --params=title:octo key:fh34d55`
|
35
35
|
Then the exit status should be 0
|
@@ -37,7 +37,7 @@ Feature: gcli key
|
|
37
37
|
Scenario: Edit key
|
38
38
|
Given the GitHub API server:
|
39
39
|
"""
|
40
|
-
patch('/repos/wycats/thor/keys/1') {
|
40
|
+
patch('/repos/wycats/thor/keys/1') { json :key => "ssh" }
|
41
41
|
"""
|
42
42
|
When I run `gcli key edit wycats thor 1 --params=title:octo key:fh34d55`
|
43
43
|
Then the exit status should be 0
|
data/features/milestone.feature
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
Feature: gcli milestone
|
2
2
|
|
3
|
+
@ci-run
|
3
4
|
Scenario: Available commands
|
4
5
|
|
5
6
|
When I run `gcli milestone`
|
@@ -31,7 +32,7 @@ Feature: gcli milestone
|
|
31
32
|
"""
|
32
33
|
post('/repos/wycats/thor/milestones') { status 200 }
|
33
34
|
"""
|
34
|
-
When I run `gcli milestone create wycats thor --
|
35
|
+
When I run `gcli milestone create wycats thor --title=new`
|
35
36
|
Then the exit status should be 0
|
36
37
|
|
37
38
|
Scenario: Update milestone
|
@@ -39,7 +40,7 @@ Feature: gcli milestone
|
|
39
40
|
"""
|
40
41
|
patch('/repos/wycats/thor/milestones/1') { status 200 }
|
41
42
|
"""
|
42
|
-
When I run `gcli milestone update wycats thor 1 --
|
43
|
+
When I run `gcli milestone update wycats thor 1 --title=new`
|
43
44
|
Then the exit status should be 0
|
44
45
|
|
45
46
|
Scenario: Delete milestone
|
data/features/reference.feature
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
Feature: gcli ref
|
2
2
|
|
3
|
+
@ci-run
|
3
4
|
Scenario: Available commands
|
4
5
|
|
5
6
|
When I run `gcli ref`
|
@@ -39,7 +40,7 @@ Feature: gcli ref
|
|
39
40
|
"""
|
40
41
|
post('/repos/wycats/thor/git/refs') { status 200 }
|
41
42
|
"""
|
42
|
-
When I run `gcli ref create wycats thor --
|
43
|
+
When I run `gcli ref create wycats thor --ref=refs/heads/master --sha=827efc6d5`
|
43
44
|
Then the exit status should be 0
|
44
45
|
|
45
46
|
Scenario: Update reference
|
@@ -47,7 +48,7 @@ Feature: gcli ref
|
|
47
48
|
"""
|
48
49
|
patch('/repos/wycats/thor/git/refs/7d1b31e') { status 200 }
|
49
50
|
"""
|
50
|
-
When I run `gcli ref update wycats thor 7d1b31e --
|
51
|
+
When I run `gcli ref update wycats thor 7d1b31e --force --sha=827efc6d5`
|
51
52
|
Then the exit status should be 0
|
52
53
|
|
53
54
|
Scenario: Delete reference
|
data/features/starring.feature
CHANGED
data/features/support/hooks.rb
CHANGED
data/features/tag.feature
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
Feature: gcli tag
|
2
2
|
|
3
|
+
@ci-run
|
3
4
|
Scenario: Available commands
|
4
5
|
|
5
6
|
When I run `gcli tag`
|
@@ -20,5 +21,5 @@ Feature: gcli tag
|
|
20
21
|
"""
|
21
22
|
post('/repos/wycats/thor/git/tags') { status 200 }
|
22
23
|
"""
|
23
|
-
When I run `gcli tag create wycats thor`
|
24
|
+
When I run `gcli tag create wycats thor --object=234f23rf`
|
24
25
|
Then the exit status should be 0
|