geet 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/{LICENSE.md → LICENSE} +55 -57
- data/README.md +5 -0
- data/bin/geet +2 -0
- data/lib/geet/git/repository.rb +13 -5
- data/lib/geet/git_hub/abstract_issue.rb +30 -0
- data/lib/geet/git_hub/issue.rb +0 -22
- data/lib/geet/git_hub/remote_repository.rb +5 -1
- data/lib/geet/helpers/configuration_helper.rb +5 -0
- data/lib/geet/services/list_prs.rb +15 -0
- data/lib/geet/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c69155e9e97f1f2d9a6c7d2f92a3d6061b1f0d7b
|
4
|
+
data.tar.gz: 1309d96f3a9bee28f08c9b8108259ea801c7360d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9e3604b6756b46c41ddf8da1bcad0f240d03ec08e5b14de00e3ffa577600bcf0504214fa57e6319580d9edf5ccecea2a407d9700f7fb98c0b1fc3ba839da859
|
7
|
+
data.tar.gz: 6a163c13f60584f65177aca5ce7ad92e2932b476c23a48e0fd1ee29090a54af598a7f1d72845d67b10f6730eb425dbf226649dac9a538b866b82641b462f6b57
|
data/{LICENSE.md → LICENSE}
RENAMED
@@ -1,12 +1,12 @@
|
|
1
|
-
GNU GENERAL PUBLIC LICENSE
|
2
|
-
|
3
|
-
Version 3, 29 June 2007
|
4
|
-
==========================
|
1
|
+
GNU GENERAL PUBLIC LICENSE
|
2
|
+
Version 3, 29 June 2007
|
5
3
|
|
6
|
-
|
7
|
-
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
6
|
+
of this license document, but changing it is not allowed.
|
7
|
+
|
8
|
+
Preamble
|
8
9
|
|
9
|
-
# Preamble
|
10
10
|
The GNU General Public License is a free, copyleft license for
|
11
11
|
software and other kinds of works.
|
12
12
|
|
@@ -68,35 +68,35 @@ patents cannot be used to render the program non-free.
|
|
68
68
|
The precise terms and conditions for copying, distribution and
|
69
69
|
modification follow.
|
70
70
|
|
71
|
-
|
71
|
+
TERMS AND CONDITIONS
|
72
72
|
|
73
|
-
|
73
|
+
0. Definitions.
|
74
74
|
|
75
|
-
|
75
|
+
"This License" refers to version 3 of the GNU General Public License.
|
76
76
|
|
77
|
-
|
77
|
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
78
78
|
works, such as semiconductor masks.
|
79
79
|
|
80
|
-
|
81
|
-
License. Each licensee is addressed as
|
80
|
+
"The Program" refers to any copyrightable work licensed under this
|
81
|
+
License. Each licensee is addressed as "you". "Licensees" and
|
82
82
|
"recipients" may be individuals or organizations.
|
83
83
|
|
84
|
-
To
|
84
|
+
To "modify" a work means to copy from or adapt all or part of the work
|
85
85
|
in a fashion requiring copyright permission, other than the making of an
|
86
|
-
exact copy. The resulting work is called a
|
87
|
-
earlier work or a work
|
86
|
+
exact copy. The resulting work is called a "modified version" of the
|
87
|
+
earlier work or a work "based on" the earlier work.
|
88
88
|
|
89
|
-
A
|
89
|
+
A "covered work" means either the unmodified Program or a work based
|
90
90
|
on the Program.
|
91
91
|
|
92
|
-
To
|
92
|
+
To "propagate" a work means to do anything with it that, without
|
93
93
|
permission, would make you directly or secondarily liable for
|
94
94
|
infringement under applicable copyright law, except executing it on a
|
95
95
|
computer or modifying a private copy. Propagation includes copying,
|
96
96
|
distribution (with or without modification), making available to the
|
97
97
|
public, and in some countries other activities as well.
|
98
98
|
|
99
|
-
To
|
99
|
+
To "convey" a work means any kind of propagation that enables other
|
100
100
|
parties to make or receive copies. Mere interaction with a user through
|
101
101
|
a computer network, with no transfer of a copy, is not conveying.
|
102
102
|
|
@@ -109,18 +109,18 @@ work under this License, and how to view a copy of this License. If
|
|
109
109
|
the interface presents a list of user commands or options, such as a
|
110
110
|
menu, a prominent item in the list meets this criterion.
|
111
111
|
|
112
|
-
|
112
|
+
1. Source Code.
|
113
113
|
|
114
|
-
The
|
115
|
-
for making modifications to it.
|
114
|
+
The "source code" for a work means the preferred form of the work
|
115
|
+
for making modifications to it. "Object code" means any non-source
|
116
116
|
form of a work.
|
117
117
|
|
118
|
-
A
|
118
|
+
A "Standard Interface" means an interface that either is an official
|
119
119
|
standard defined by a recognized standards body, or, in the case of
|
120
120
|
interfaces specified for a particular programming language, one that
|
121
121
|
is widely used among developers working in that language.
|
122
122
|
|
123
|
-
The
|
123
|
+
The "System Libraries" of an executable work include anything, other
|
124
124
|
than the work as a whole, that (a) is included in the normal form of
|
125
125
|
packaging a Major Component, but which is not part of that Major
|
126
126
|
Component, and (b) serves only to enable use of the work with that
|
@@ -131,7 +131,7 @@ implementation is available to the public in source code form. A
|
|
131
131
|
(if any) on which the executable work runs, or a compiler used to
|
132
132
|
produce the work, or an object code interpreter used to run it.
|
133
133
|
|
134
|
-
The
|
134
|
+
The "Corresponding Source" for a work in object code form means all
|
135
135
|
the source code needed to generate, install, and (for an executable
|
136
136
|
work) run the object code and to modify the work, including scripts to
|
137
137
|
control those activities. However, it does not include the work's
|
@@ -151,7 +151,7 @@ Source.
|
|
151
151
|
The Corresponding Source for a work in source code form is that
|
152
152
|
same work.
|
153
153
|
|
154
|
-
|
154
|
+
2. Basic Permissions.
|
155
155
|
|
156
156
|
All rights granted under this License are granted for the term of
|
157
157
|
copyright on the Program, and are irrevocable provided the stated
|
@@ -176,7 +176,7 @@ your copyrighted material outside their relationship with you.
|
|
176
176
|
the conditions stated below. Sublicensing is not allowed; section 10
|
177
177
|
makes it unnecessary.
|
178
178
|
|
179
|
-
|
179
|
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
180
180
|
|
181
181
|
No covered work shall be deemed part of an effective technological
|
182
182
|
measure under any applicable law fulfilling obligations under article
|
@@ -192,7 +192,7 @@ modification of the work as a means of enforcing, against the work's
|
|
192
192
|
users, your or third parties' legal rights to forbid circumvention of
|
193
193
|
technological measures.
|
194
194
|
|
195
|
-
|
195
|
+
4. Conveying Verbatim Copies.
|
196
196
|
|
197
197
|
You may convey verbatim copies of the Program's source code as you
|
198
198
|
receive it, in any medium, provided that you conspicuously and
|
@@ -205,7 +205,7 @@ recipients a copy of this License along with the Program.
|
|
205
205
|
You may charge any price or no price for each copy that you convey,
|
206
206
|
and you may offer support or warranty protection for a fee.
|
207
207
|
|
208
|
-
|
208
|
+
5. Conveying Modified Source Versions.
|
209
209
|
|
210
210
|
You may convey a work based on the Program, or the modifications to
|
211
211
|
produce it from the Program, in the form of source code under the
|
@@ -242,7 +242,7 @@ beyond what the individual works permit. Inclusion of a covered work
|
|
242
242
|
in an aggregate does not cause this License to apply to the other
|
243
243
|
parts of the aggregate.
|
244
244
|
|
245
|
-
|
245
|
+
6. Conveying Non-Source Forms.
|
246
246
|
|
247
247
|
You may convey a covered work in object code form under the terms
|
248
248
|
of sections 4 and 5, provided that you also convey the
|
@@ -294,7 +294,7 @@ in one of these ways:
|
|
294
294
|
from the Corresponding Source as a System Library, need not be
|
295
295
|
included in conveying the object code work.
|
296
296
|
|
297
|
-
A
|
297
|
+
A "User Product" is either (1) a "consumer product", which means any
|
298
298
|
tangible personal property which is normally used for personal, family,
|
299
299
|
or household purposes, or (2) anything designed or sold for incorporation
|
300
300
|
into a dwelling. In determining whether a product is a consumer product,
|
@@ -307,7 +307,7 @@ is a consumer product regardless of whether the product has substantial
|
|
307
307
|
commercial, industrial or non-consumer uses, unless such uses represent
|
308
308
|
the only significant mode of use of the product.
|
309
309
|
|
310
|
-
|
310
|
+
"Installation Information" for a User Product means any methods,
|
311
311
|
procedures, authorization keys, or other information required to install
|
312
312
|
and execute modified versions of a covered work in that User Product from
|
313
313
|
a modified version of its Corresponding Source. The information must
|
@@ -340,9 +340,9 @@ documented (and with an implementation available to the public in
|
|
340
340
|
source code form), and must require no special password or key for
|
341
341
|
unpacking, reading or copying.
|
342
342
|
|
343
|
-
|
343
|
+
7. Additional Terms.
|
344
344
|
|
345
|
-
|
345
|
+
"Additional permissions" are terms that supplement the terms of this
|
346
346
|
License by making exceptions from one or more of its conditions.
|
347
347
|
Additional permissions that are applicable to the entire Program shall
|
348
348
|
be treated as though they were included in this License, to the extent
|
@@ -404,7 +404,7 @@ where to find the applicable terms.
|
|
404
404
|
form of a separately written license, or stated as exceptions;
|
405
405
|
the above requirements apply either way.
|
406
406
|
|
407
|
-
|
407
|
+
8. Termination.
|
408
408
|
|
409
409
|
You may not propagate or modify a covered work except as expressly
|
410
410
|
provided under this License. Any attempt otherwise to propagate or
|
@@ -432,7 +432,7 @@ this License. If your rights have been terminated and not permanently
|
|
432
432
|
reinstated, you do not qualify to receive new licenses for the same
|
433
433
|
material under section 10.
|
434
434
|
|
435
|
-
|
435
|
+
9. Acceptance Not Required for Having Copies.
|
436
436
|
|
437
437
|
You are not required to accept this License in order to receive or
|
438
438
|
run a copy of the Program. Ancillary propagation of a covered work
|
@@ -443,14 +443,14 @@ modify any covered work. These actions infringe copyright if you do
|
|
443
443
|
not accept this License. Therefore, by modifying or propagating a
|
444
444
|
covered work, you indicate your acceptance of this License to do so.
|
445
445
|
|
446
|
-
|
446
|
+
10. Automatic Licensing of Downstream Recipients.
|
447
447
|
|
448
448
|
Each time you convey a covered work, the recipient automatically
|
449
449
|
receives a license from the original licensors, to run, modify and
|
450
450
|
propagate that work, subject to this License. You are not responsible
|
451
451
|
for enforcing compliance by third parties with this License.
|
452
452
|
|
453
|
-
An
|
453
|
+
An "entity transaction" is a transaction transferring control of an
|
454
454
|
organization, or substantially all assets of one, or subdividing an
|
455
455
|
organization, or merging organizations. If propagation of a covered
|
456
456
|
work results from an entity transaction, each party to that
|
@@ -468,13 +468,13 @@ rights granted under this License, and you may not initiate litigation
|
|
468
468
|
any patent claim is infringed by making, using, selling, offering for
|
469
469
|
sale, or importing the Program or any portion of it.
|
470
470
|
|
471
|
-
|
471
|
+
11. Patents.
|
472
472
|
|
473
|
-
A
|
473
|
+
A "contributor" is a copyright holder who authorizes use under this
|
474
474
|
License of the Program or a work on which the Program is based. The
|
475
475
|
work thus licensed is called the contributor's "contributor version".
|
476
476
|
|
477
|
-
A contributor's
|
477
|
+
A contributor's "essential patent claims" are all patent claims
|
478
478
|
owned or controlled by the contributor, whether already acquired or
|
479
479
|
hereafter acquired, that would be infringed by some manner, permitted
|
480
480
|
by this License, of making, using, or selling its contributor version,
|
@@ -537,7 +537,7 @@ or that patent license was granted, prior to 28 March 2007.
|
|
537
537
|
any implied license or other defenses to infringement that may
|
538
538
|
otherwise be available to you under applicable patent law.
|
539
539
|
|
540
|
-
|
540
|
+
12. No Surrender of Others' Freedom.
|
541
541
|
|
542
542
|
If conditions are imposed on you (whether by court order, agreement or
|
543
543
|
otherwise) that contradict the conditions of this License, they do not
|
@@ -549,7 +549,7 @@ to collect a royalty for further conveying from those to whom you convey
|
|
549
549
|
the Program, the only way you could satisfy both those terms and this
|
550
550
|
License would be to refrain entirely from conveying the Program.
|
551
551
|
|
552
|
-
|
552
|
+
13. Use with the GNU Affero General Public License.
|
553
553
|
|
554
554
|
Notwithstanding any other provision of this License, you have
|
555
555
|
permission to link or combine any covered work with a work licensed
|
@@ -560,7 +560,7 @@ but the special requirements of the GNU Affero General Public License,
|
|
560
560
|
section 13, concerning interaction through a network will apply to the
|
561
561
|
combination as such.
|
562
562
|
|
563
|
-
|
563
|
+
14. Revised Versions of this License.
|
564
564
|
|
565
565
|
The Free Software Foundation may publish revised and/or new versions of
|
566
566
|
the GNU General Public License from time to time. Such new versions will
|
@@ -586,7 +586,7 @@ permissions. However, no additional obligations are imposed on any
|
|
586
586
|
author or copyright holder as a result of your choosing to follow a
|
587
587
|
later version.
|
588
588
|
|
589
|
-
|
589
|
+
15. Disclaimer of Warranty.
|
590
590
|
|
591
591
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
592
592
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
@@ -597,7 +597,7 @@ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
597
597
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
598
598
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
599
599
|
|
600
|
-
|
600
|
+
16. Limitation of Liability.
|
601
601
|
|
602
602
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
603
603
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
@@ -609,7 +609,7 @@ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
609
609
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
610
610
|
SUCH DAMAGES.
|
611
611
|
|
612
|
-
|
612
|
+
17. Interpretation of Sections 15 and 16.
|
613
613
|
|
614
614
|
If the disclaimer of warranty and limitation of liability provided
|
615
615
|
above cannot be given local legal effect according to their terms,
|
@@ -618,11 +618,9 @@ an absolute waiver of all civil liability in connection with the
|
|
618
618
|
Program, unless a warranty or assumption of liability accompanies a
|
619
619
|
copy of the Program in return for a fee.
|
620
620
|
|
621
|
-
|
622
|
-
--------------------------------------------------------------------------
|
623
|
-
|
621
|
+
END OF TERMS AND CONDITIONS
|
624
622
|
|
625
|
-
|
623
|
+
How to Apply These Terms to Your New Programs
|
626
624
|
|
627
625
|
If you develop a new program, and you want it to be of the greatest
|
628
626
|
possible use to the public, the best way to achieve this is to make it
|
@@ -633,8 +631,8 @@ to attach them to the start of each source file to most effectively
|
|
633
631
|
state the exclusion of warranty; and each file should have at least
|
634
632
|
the "copyright" line and a pointer to where the full notice is found.
|
635
633
|
|
636
|
-
|
637
|
-
Copyright (C)
|
634
|
+
Geet - program for working with code hosting services via commandline
|
635
|
+
Copyright (C) 2017 Saverio Miroddi
|
638
636
|
|
639
637
|
This program is free software: you can redistribute it and/or modify
|
640
638
|
it under the terms of the GNU General Public License as published by
|
@@ -654,12 +652,12 @@ Also add information on how to contact you by electronic and paper mail.
|
|
654
652
|
If the program does terminal interaction, make it output a short
|
655
653
|
notice like this when it starts in an interactive mode:
|
656
654
|
|
657
|
-
|
658
|
-
This program comes with ABSOLUTELY NO WARRANTY; for details type
|
655
|
+
Geet Copyright (C) 2017 Saverio Miroddi
|
656
|
+
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
659
657
|
This is free software, and you are welcome to redistribute it
|
660
|
-
under certain conditions; type
|
658
|
+
under certain conditions; type `show c' for details.
|
661
659
|
|
662
|
-
|
660
|
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
663
661
|
parts of the General Public License. Of course, your program's commands
|
664
662
|
might be different; for a GUI interface, you would use an "about box".
|
665
663
|
|
data/README.md
CHANGED
@@ -33,6 +33,11 @@ List the open issues, in default order (inverse creation date):
|
|
33
33
|
> 4. Allow writing description in an editor (https://github.com/saveriomiroddi/geet/issues/4)
|
34
34
|
> 2. Support opening PR into other repositories (https://github.com/saveriomiroddi/geet/issues/2)
|
35
35
|
|
36
|
+
List the open PRs, in default order (inverse creation date):
|
37
|
+
|
38
|
+
$ geet pr list
|
39
|
+
> 21. Add PRs listing support (https://github.com/saveriomiroddi/geet/pull/21)
|
40
|
+
|
36
41
|
For the help:
|
37
42
|
|
38
43
|
$ geet --help
|
data/bin/geet
CHANGED
@@ -29,6 +29,8 @@ when Helpers::ConfigurationHelper::PR_CREATE_COMMAND
|
|
29
29
|
title, description = options.values_at(:title, :description)
|
30
30
|
|
31
31
|
Services::CreatePr.new.execute(repository, title, description, options)
|
32
|
+
when Helpers::ConfigurationHelper::PR_LIST_COMMAND
|
33
|
+
Services::ListPrs.new.execute(repository)
|
32
34
|
else
|
33
35
|
raise "Internal error - Unrecognized command #{command.inspect}"
|
34
36
|
end
|
data/lib/geet/git/repository.rb
CHANGED
@@ -17,7 +17,7 @@ module Geet
|
|
17
17
|
def_delegators :@remote_repository, :collaborators, :labels
|
18
18
|
def_delegators :@remote_repository, :create_gist
|
19
19
|
def_delegators :@remote_repository, :create_issue, :list_issues
|
20
|
-
def_delegators :@remote_repository, :create_pr
|
20
|
+
def_delegators :@remote_repository, :create_pr, :list_prs
|
21
21
|
def_delegators :@account, :authenticated_user
|
22
22
|
|
23
23
|
DOMAIN_PROVIDERS_MAPPING = {
|
@@ -25,7 +25,15 @@ module Geet
|
|
25
25
|
}.freeze
|
26
26
|
|
27
27
|
# For simplicity, we match any character except the ones the separators.
|
28
|
-
REMOTE_ORIGIN_REGEX = %r{
|
28
|
+
REMOTE_ORIGIN_REGEX = %r{
|
29
|
+
\A
|
30
|
+
(?:https://(.+?)/|git@(.+?):)
|
31
|
+
([^/]+)
|
32
|
+
/
|
33
|
+
(.*?)
|
34
|
+
(?:\.git)?
|
35
|
+
\Z
|
36
|
+
}x
|
29
37
|
|
30
38
|
def initialize(api_token)
|
31
39
|
the_provider_domain = provider_domain
|
@@ -44,15 +52,15 @@ module Geet
|
|
44
52
|
end
|
45
53
|
|
46
54
|
def provider_domain
|
47
|
-
remote_origin[REMOTE_ORIGIN_REGEX, 1]
|
55
|
+
remote_origin[REMOTE_ORIGIN_REGEX, 1] || remote_origin[REMOTE_ORIGIN_REGEX, 2]
|
48
56
|
end
|
49
57
|
|
50
58
|
def owner
|
51
|
-
remote_origin[REMOTE_ORIGIN_REGEX,
|
59
|
+
remote_origin[REMOTE_ORIGIN_REGEX, 3]
|
52
60
|
end
|
53
61
|
|
54
62
|
def repo
|
55
|
-
remote_origin[REMOTE_ORIGIN_REGEX,
|
63
|
+
remote_origin[REMOTE_ORIGIN_REGEX, 4]
|
56
64
|
end
|
57
65
|
|
58
66
|
# DATA
|
@@ -7,6 +7,36 @@ module Geet
|
|
7
7
|
class AbstractIssue
|
8
8
|
attr_reader :issue_number
|
9
9
|
|
10
|
+
# Returns an array of Struct(:number, :title); once this workflow is extended,
|
11
|
+
# the struct will likely be converted to a standard class.
|
12
|
+
#
|
13
|
+
# See https://developer.github.com/v3/issues/#list-issues-for-a-repository
|
14
|
+
#
|
15
|
+
# options:
|
16
|
+
# filter: :pr, :issue, or nil
|
17
|
+
#
|
18
|
+
def self.list(repository, api_helper, filter: nil)
|
19
|
+
request_address = "#{api_helper.repo_link}/issues"
|
20
|
+
|
21
|
+
response = api_helper.send_request(request_address, multipage: true)
|
22
|
+
issue_class = Struct.new(:number, :title, :link)
|
23
|
+
|
24
|
+
response.each_with_object([]) do |issue_data, result|
|
25
|
+
include_issue = \
|
26
|
+
filter.nil? ||
|
27
|
+
filter == :pr && issue_data.key?('pull_request') ||
|
28
|
+
filter == :issue && ! issue_data.key?('pull_request')
|
29
|
+
|
30
|
+
if include_issue
|
31
|
+
number = issue_data.fetch('number')
|
32
|
+
title = issue_data.fetch('title')
|
33
|
+
link = issue_data.fetch('html_url')
|
34
|
+
|
35
|
+
result << issue_class.new(number, title, link)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
10
40
|
def initialize(repository, issue_number, api_helper)
|
11
41
|
@repository = repository
|
12
42
|
@issue_number = issue_number
|
data/lib/geet/git_hub/issue.rb
CHANGED
@@ -16,28 +16,6 @@ module Geet
|
|
16
16
|
new(repository, issue_number, api_helper)
|
17
17
|
end
|
18
18
|
|
19
|
-
# Returns an array of Struct(:number, :title); once this workflow is extended,
|
20
|
-
# the struct will likely be converted to a standard class.
|
21
|
-
#
|
22
|
-
# See https://developer.github.com/v3/issues/#list-issues-for-a-repository
|
23
|
-
#
|
24
|
-
def self.list(repository, api_helper)
|
25
|
-
request_address = "#{api_helper.repo_link}/issues"
|
26
|
-
|
27
|
-
response = api_helper.send_request(request_address, multipage: true)
|
28
|
-
issue_class = Struct.new(:number, :title, :link)
|
29
|
-
|
30
|
-
response.each_with_object([]) do |issue_data, result|
|
31
|
-
if ! issue_data.key?('pull_request')
|
32
|
-
number = issue_data.fetch('number')
|
33
|
-
title = issue_data.fetch('title')
|
34
|
-
link = issue_data.fetch('html_url')
|
35
|
-
|
36
|
-
result << issue_class.new(number, title, link)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
19
|
def link
|
42
20
|
"https://github.com/#{@repository.owner}/#{@repository.repo}/issues/#{@issue_number}"
|
43
21
|
end
|
@@ -36,12 +36,16 @@ module Geet
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def list_issues
|
39
|
-
Geet::GitHub::
|
39
|
+
Geet::GitHub::AbstractIssue.list(@local_repository, @api_helper, filter: :issue)
|
40
40
|
end
|
41
41
|
|
42
42
|
def create_pr(title, description, head: @local_repository.current_head)
|
43
43
|
Geet::GitHub::PR.create(@local_repository, title, description, head, @api_helper)
|
44
44
|
end
|
45
|
+
|
46
|
+
def list_prs
|
47
|
+
Geet::GitHub::AbstractIssue.list(@local_repository, @api_helper, filter: :pr)
|
48
|
+
end
|
45
49
|
end
|
46
50
|
end
|
47
51
|
end
|
@@ -11,6 +11,7 @@ module Geet
|
|
11
11
|
ISSUE_CREATE_COMMAND = 'issue.create'
|
12
12
|
ISSUE_LIST_COMMAND = 'issue.list'
|
13
13
|
PR_CREATE_COMMAND = 'pr.create'
|
14
|
+
PR_LIST_COMMAND = 'pr.list'
|
14
15
|
|
15
16
|
# Command options
|
16
17
|
|
@@ -40,6 +41,9 @@ module Geet
|
|
40
41
|
'description'
|
41
42
|
].freeze
|
42
43
|
|
44
|
+
PR_LIST_OPTIONS = [
|
45
|
+
].freeze
|
46
|
+
|
43
47
|
# Public interface
|
44
48
|
|
45
49
|
def decode_argv
|
@@ -53,6 +57,7 @@ module Geet
|
|
53
57
|
},
|
54
58
|
'pr' => {
|
55
59
|
'create' => PR_CREATE_OPTIONS,
|
60
|
+
'list' => PR_LIST_OPTIONS,
|
56
61
|
},
|
57
62
|
)
|
58
63
|
end
|
data/lib/geet/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Saverio Miroddi
|
@@ -38,7 +38,7 @@ files:
|
|
38
38
|
- ".ruby-version"
|
39
39
|
- Gemfile
|
40
40
|
- Gemfile.lock
|
41
|
-
- LICENSE
|
41
|
+
- LICENSE
|
42
42
|
- README.md
|
43
43
|
- bin/geet
|
44
44
|
- geet.gemspec
|
@@ -56,6 +56,7 @@ files:
|
|
56
56
|
- lib/geet/services/create_issue.rb
|
57
57
|
- lib/geet/services/create_pr.rb
|
58
58
|
- lib/geet/services/list_issues.rb
|
59
|
+
- lib/geet/services/list_prs.rb
|
59
60
|
- lib/geet/version.rb
|
60
61
|
homepage: https://github.com/saveriomiroddi/geet
|
61
62
|
licenses:
|