gissuel 0.2.0 → 0.3.0
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/README.md +24 -3
- data/lib/gissuel/cli.rb +4 -4
- data/lib/gissuel/issues.rb +27 -9
- data/lib/gissuel/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e2dfe162a1416ab157dd9f0edae53dd1dc51217
|
4
|
+
data.tar.gz: 48cc405516f8af5d5d1df453c17bce42cfe1bafd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f45a7e2c906f4d9fb40576f80e44e4754db85a42e6864fff78379718edbe5810db3631e62fd94164c38533ff06a2969123d06189c03b81c86bfe69f9951c347
|
7
|
+
data.tar.gz: e7eb7952e15defc8e70494af99a57c8f00f5b957c5d3ffdf9099f776353e6e84e2030b8c846e6f6199d098e5ffa52d99607fd6c9fe0e7354ecb10a1b540c5e64
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ Gissuel
|
|
10
10
|
|
11
11
|
## Usage
|
12
12
|
|
13
|
-
- Run `gissuel get --label [label] --repo [repo-name] --
|
13
|
+
- Run `gissuel get --label [label] --repo [repo-name] --verbose`
|
14
14
|
|
15
15
|
For example, I added lines similar to the following to my `.zshrc` file
|
16
16
|
|
@@ -18,10 +18,31 @@ Gissuel
|
|
18
18
|
export GITHUB_TOKEN="XXXXXXXXXXXXX"
|
19
19
|
gissuel planned semaphoreci/semaphore
|
20
20
|
```
|
21
|
+
|
21
22
|
- Options are optional
|
22
23
|
- `--repo` (`--label`) - When not specified, Gissuel will look for any issue
|
23
24
|
that is assigned to token owner. Otherwise, it will only look for specified repo (label).
|
24
|
-
- `--
|
25
|
+
- `--verbose` - when Gissuel is called with this option, it will show text for
|
25
26
|
each found issue
|
26
|
-
- `--index` - combined with above mentioned options, it will print only
|
27
|
+
- `--index` - combined with above mentioned options, it will print only an issue
|
27
28
|
under the specified ordinal number
|
29
|
+
|
30
|
+
## Examples
|
31
|
+
|
32
|
+
|
33
|
+
I want to get quick overview of issues assigned to me within `semaphoreci/semaphore` repo:
|
34
|
+
```
|
35
|
+
gissuel get --repo semaphoreci/semaphore
|
36
|
+
```
|
37
|
+
I want to list mine issues with label planned:
|
38
|
+
```
|
39
|
+
gissuel get --label planned
|
40
|
+
```
|
41
|
+
I'd like to take a quick look at all issues withing repo `semaphoreci/semaphore` with label `planned` assigned to me
|
42
|
+
```
|
43
|
+
gissuel get --repo semaphoreci/semaphore --label planned
|
44
|
+
```
|
45
|
+
Finally, from the last list, I'd like to see description of second issue
|
46
|
+
```
|
47
|
+
gissuel get --repo semaphoreci/semaphore --label planned --index 2 --verbose
|
48
|
+
```
|
data/lib/gissuel/cli.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Gissuel
|
2
2
|
|
3
3
|
class CLI < Thor
|
4
|
-
attr_reader :label, :repo, :
|
4
|
+
attr_reader :label, :repo, :verbose, :index
|
5
5
|
|
6
6
|
desc "get", "will print out list of issues assigned to you"
|
7
7
|
|
@@ -17,15 +17,15 @@ module Gissuel
|
|
17
17
|
|
18
18
|
option :label
|
19
19
|
option :repo
|
20
|
-
option :
|
20
|
+
option :verbose, :lazy_default => true, :default => false, :type => :boolean
|
21
21
|
option :index, :default => 0, :type => :numeric
|
22
22
|
def get
|
23
23
|
@label = options[:label]
|
24
24
|
@repo = options[:repo]
|
25
|
-
@
|
25
|
+
@verbose = options[:verbose]
|
26
26
|
@index = options[:index]
|
27
27
|
|
28
|
-
Gissuel::Issues.new(label, repo,
|
28
|
+
Gissuel::Issues.new(label, repo, verbose, index).publish
|
29
29
|
end
|
30
30
|
|
31
31
|
desc "version", "Prints the haskii version info"
|
data/lib/gissuel/issues.rb
CHANGED
@@ -3,12 +3,12 @@ module Gissuel
|
|
3
3
|
|
4
4
|
TOKEN = ENV["GITHUB_TOKEN"]
|
5
5
|
|
6
|
-
def initialize(label, repo,
|
7
|
-
@
|
8
|
-
@
|
9
|
-
@
|
10
|
-
@
|
11
|
-
@index
|
6
|
+
def initialize(label, repo, verbose, index)
|
7
|
+
@verbose = verbose
|
8
|
+
@label = label
|
9
|
+
@repo = repo
|
10
|
+
@state = "open"
|
11
|
+
@index = index
|
12
12
|
end
|
13
13
|
|
14
14
|
def publish
|
@@ -47,10 +47,11 @@ module Gissuel
|
|
47
47
|
if @index.zero? then
|
48
48
|
Gissuel::Log.new("👋 there is one issue on your 🍽️.").red
|
49
49
|
Gissuel::Log.new("☕ here is quick look at it:\n").grey
|
50
|
+
report_issue(issues.first, @index + 1)
|
50
51
|
else
|
51
52
|
Gissuel::Log.new("☕ here is quick look at the issue:\n").grey
|
52
|
-
end
|
53
53
|
report_issue(issues.first, @index)
|
54
|
+
end
|
54
55
|
else
|
55
56
|
Gissuel::Log.new("👋 there are #{issues.count} issues on your 🍽️.").red
|
56
57
|
Gissuel::Log.new("☕ here is quick look at these:\n").grey
|
@@ -64,8 +65,25 @@ module Gissuel
|
|
64
65
|
def report_issue(issue, index)
|
65
66
|
Gissuel::Log.new("[#{index}]: #{issue.title}").yellow
|
66
67
|
Gissuel::Log.new("URL: #{issue.html_url}").blue
|
67
|
-
Gissuel::Log.new("
|
68
|
-
Gissuel::Log.new(
|
68
|
+
Gissuel::Log.new("DESCRIPTION: #{issue.body}").grey if @verbose
|
69
|
+
Gissuel::Log.new(comments_report(issue)).green
|
70
|
+
end
|
71
|
+
|
72
|
+
def comments_report(issue)
|
73
|
+
general_info = "No of comments: #{issue.comments} | Updated at: #{issue.updated_at}"
|
74
|
+
|
75
|
+
# comment_autor_requested? ? [general, comment_author(issue)].join(" | ") : general
|
76
|
+
issue.comments.nonzero? && @verbose ? [general_info, last_comment_author(issue)].join(" | ") : general_info
|
77
|
+
end
|
78
|
+
|
79
|
+
def last_comment_author(issue)
|
80
|
+
repo = issue.repository_url
|
81
|
+
.split("/")
|
82
|
+
.last(2)
|
83
|
+
.join("/")
|
84
|
+
|
85
|
+
client.issue_comments(repo, issue.number).last
|
86
|
+
.user.login
|
69
87
|
end
|
70
88
|
|
71
89
|
end
|
data/lib/gissuel/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gissuel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Milana
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|