Commit graph

70 commits

Author SHA1 Message Date
Nate Smith
14a5e00c4a
Merge pull request #2034 from cristiand391/check-gist-ownership
Check gist ownership before editing
2020-10-05 16:20:34 -05:00
Nate Smith
d63b5a9297
Merge pull request #1763 from Matt-Gleich/trunk
♻️ Refactor gist list to use graphQL
2020-10-05 16:15:39 -05:00
Mislav Marohnić
cd2adfeba0 Port listing gists to githubv4 GraphQL client
- Fetching more than 100 gists is now supported
- The GraphQL query name is now `GistList` instead of `ListGists` for
  consistency with other queries
- Avoid fetching unnecessary Files fields
- Gists are now rendered in the order that the API returned them in
- The gist timestamp for machine-readable output is now rendered in
  RFC3339 format instead of in `time.Time.String()` format which is only
  meant for debugging and is not considered stable
- Ensure newlines in gist description are rendered as spaces
2020-10-05 20:33:31 +02:00
Mislav Marohnić
1859728f7e Fix parsing gist list --public/--secret flags
It's not sufficient to use `Changed("public")` to test if a boolean flag
was activated, since the user might have passed `--public=false`.
Instead, check the true value of the flag.

The `--public` and `--secret` flags should be mutually exclusive, so now
if both are activated, `--secret` takes precedence.
2020-10-05 20:27:05 +02:00
Matthew Gleich
f124370154
♻️ Refactor to only pass time in once for test
Signed-off-by: Matthew Gleich <email@mattglei.ch>
2020-10-04 15:02:13 -04:00
Matthew Gleich
d8ef8b836e
🐛 Fix stubs
Signed-off-by: Matthew Gleich <email@mattglei.ch>
2020-10-04 01:57:36 -04:00
Cristian Dominguez
c6b9e8454f Update gist edit tests 2020-09-30 12:35:22 -03:00
Cristian Dominguez
67c0a1a409 Check gist ownership before editing 2020-09-30 12:35:04 -03:00
Nate Smith
e24035681d
Merge pull request #2003 from cristiand391/refactor-gist-create
Refactor gist create to reuse existing structs
2020-09-29 15:27:31 -05:00
Cristian Dominguez
b71e6494ab Update gist create tests 2020-09-28 02:37:41 -03:00
Cristian Dominguez
ef8f61c61d Refactor gist create 2020-09-28 02:36:01 -03:00
Sam Coe
f0d4fbf84f
Address PR comments around style and naming 2020-09-24 19:27:29 +02:00
Sam Coe
ed4075517c
Check for terminal background color before starting pager 2020-09-24 13:06:28 +02:00
Nate Smith
060ccd1eda
Merge pull request #1781 from cristiand391/fix-gist-id-extraction
Fix gist ID extraction from url
2020-09-22 12:04:04 -05:00
Cristian Dominguez
a7a90b3a4b Move gist URL tests to its own file 2020-09-21 21:35:07 -03:00
Cristian Dominguez
55a8f3d8ca Make gh gist view and edit commands reuse logic for id extraction 2020-09-21 21:28:04 -03:00
Cristian Dominguez
d685d666b2 Set gist ID by default on all tests 2020-09-21 12:11:08 -03:00
Cristian Dominguez
ef9b75e1f6 Add tests for gist URL check 2020-09-19 18:50:07 -03:00
Cristian Dominguez
2af136cc78 Return error if it's an invalid URL 2020-09-19 18:48:00 -03:00
yuuji.yaginuma
943dcef478 Don't send a request when the contents haven't changed
By doing this, the command will finish faster if the user canceled
the editing.
2020-09-19 15:25:07 +09:00
yuuji.yaginuma
4f3d0e5f7b Fix short description of gist
The `gist` command allows doing other operations than
`create`(like `edit`, `view`, etc).  So I think that `manage`
is more appropriate to the description.
2020-09-18 14:21:02 +09:00
Cristian Dominguez
0b8c964a41 Fix gist ID extraction from url 2020-09-17 23:48:25 -03:00
Matthew Gleich
89e1ee3217
♻️ Refactor gist list to use graphQL
Signed-off-by: Matthew Gleich <matthewgleich@gmail.com>
2020-09-17 16:27:23 -04:00
vilmibm
7c986c0454 help typo 2020-09-16 11:23:14 -05:00
vilmibm
2b70e8266a better time stub 2020-09-16 10:57:20 -05:00
vilmibm
0d45dd82f3 finish edit tests 2020-09-15 17:29:54 -05:00
vilmibm
15cf786c5a wip tests 2020-09-15 17:20:36 -05:00
vilmibm
a9ab2a98fc move Edit to opts for testing 2020-09-15 17:04:43 -05:00
vilmibm
62f54f0f02 start on edit tests 2020-09-15 16:18:26 -05:00
vilmibm
ada2c56606 test gist view 2020-09-15 16:05:30 -05:00
vilmibm
4a467864d5 linter appeasement 2020-09-15 15:22:28 -05:00
vilmibm
f124b426fe tweak gist view; support --filename 2020-09-15 14:56:13 -05:00
vilmibm
a61c897e4c show filename if no description 2020-09-15 14:55:55 -05:00
vilmibm
ba5b639be4 finish list tests 2020-09-15 14:33:14 -05:00
vilmibm
9fd87faadc wip tests 2020-09-15 14:15:44 -05:00
vilmibm
425f707c7d fix tests 2020-09-15 13:36:32 -05:00
vilmibm
1887fc07c9 working on list tests, need to debug 2020-09-15 09:39:30 -05:00
vilmibm
b3266d9454 linter appeasement 2020-09-14 11:10:17 -05:00
vilmibm
41382a558b better err 2020-09-14 11:09:50 -05:00
vilmibm
190d76abc5 linter appeasement 2020-09-14 11:08:32 -05:00
vilmibm
ecfbaaa31c linter appeasement 2020-09-14 11:07:33 -05:00
vilmibm
e7ab1b753e linter appeasement 2020-09-14 11:05:26 -05:00
vilmibm
2df6a6eb8c s/private/secret/ 2020-09-14 11:04:37 -05:00
vilmibm
415c2ac482 put gist in core commands 2020-09-14 10:43:34 -05:00
vilmibm
1edff18ad4 s/private/secret 2020-09-14 10:38:35 -05:00
vilmibm
269adab75a improve list output 2020-09-14 10:33:29 -05:00
vilmibm
02d94d6f93 hmm 2020-09-14 10:33:29 -05:00
vilmibm
dc345a9f73 support --web for gist view 2020-09-14 10:33:29 -05:00
vilmibm
0d3056d9a7 gh gist edit 2020-09-14 10:33:29 -05:00
vilmibm
39b6ec8aec share gist getting 2020-09-14 10:33:29 -05:00