gissuel 0.1.0 β 0.2.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 +8 -2
- data/lib/gissuel/cli.rb +7 -3
- data/lib/gissuel/issues.rb +21 -14
- data/lib/gissuel/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b8ae9a9e88750a98dc714427e6ce5b254a43305
|
4
|
+
data.tar.gz: 4ff0835baa845c98c75c0343d18ba9091e536423
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d38500baacf8944f8856e9768ea98c277e475ba3863055abde68b5b2c095b7ff461ab8a4c80772a336f8bb1d352d2307feebf49d98f41e0fca67439316cbac2
|
7
|
+
data.tar.gz: 4737da86e70614a517ebc4874219e56e582b5708ec90531bc328cce994051f206b8b484755763e58d6a44dbe87c2410e9b948ed6b907c7635b2494dd3d9ca955
|
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] --body`
|
14
14
|
|
15
15
|
For example, I added lines similar to the following to my `.zshrc` file
|
16
16
|
|
@@ -18,4 +18,10 @@ Gissuel
|
|
18
18
|
export GITHUB_TOKEN="XXXXXXXXXXXXX"
|
19
19
|
gissuel planned semaphoreci/semaphore
|
20
20
|
```
|
21
|
-
- Options
|
21
|
+
- Options are optional
|
22
|
+
- `--repo` (`--label`) - When not specified, Gissuel will look for any issue
|
23
|
+
that is assigned to token owner. Otherwise, it will only look for specified repo (label).
|
24
|
+
- `--body` - when Gissuel is called with this option, it will show text for
|
25
|
+
each found issue
|
26
|
+
- `--index` - combined with above mentioned options, it will print only the issue
|
27
|
+
under the specified ordinal number
|
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, :body, :index
|
5
5
|
|
6
6
|
desc "get", "will print out list of issues assigned to you"
|
7
7
|
|
@@ -17,11 +17,15 @@ module Gissuel
|
|
17
17
|
|
18
18
|
option :label
|
19
19
|
option :repo
|
20
|
+
option :body, :lazy_default => true, :default => false, :type => :boolean
|
21
|
+
option :index, :default => 0, :type => :numeric
|
20
22
|
def get
|
21
23
|
@label = options[:label]
|
22
|
-
@repo
|
24
|
+
@repo = options[:repo]
|
25
|
+
@body = options[:body]
|
26
|
+
@index = options[:index]
|
23
27
|
|
24
|
-
Gissuel::Issues.new(label, repo).publish
|
28
|
+
Gissuel::Issues.new(label, repo, body, index).publish
|
25
29
|
end
|
26
30
|
|
27
31
|
desc "version", "Prints the haskii version info"
|
data/lib/gissuel/issues.rb
CHANGED
@@ -3,14 +3,16 @@ module Gissuel
|
|
3
3
|
|
4
4
|
TOKEN = ENV["GITHUB_TOKEN"]
|
5
5
|
|
6
|
-
def initialize(label, repo)
|
6
|
+
def initialize(label, repo, body, index)
|
7
7
|
@label = label
|
8
8
|
@repo = repo
|
9
9
|
@state = "open"
|
10
|
+
@body = body
|
11
|
+
@index = index
|
10
12
|
end
|
11
13
|
|
12
14
|
def publish
|
13
|
-
|
15
|
+
handle_issues(desired_issues)
|
14
16
|
end
|
15
17
|
|
16
18
|
private
|
@@ -24,8 +26,8 @@ module Gissuel
|
|
24
26
|
client.user.login
|
25
27
|
end
|
26
28
|
|
27
|
-
def
|
28
|
-
client.list_issues(
|
29
|
+
def desired_issues
|
30
|
+
issues = client.list_issues(
|
29
31
|
@repo,
|
30
32
|
options = {
|
31
33
|
:assignee => my_login,
|
@@ -33,31 +35,36 @@ module Gissuel
|
|
33
35
|
:state => @state
|
34
36
|
}
|
35
37
|
)
|
38
|
+
|
39
|
+
@index.zero? ? issues : [issues[@index - 1]]
|
36
40
|
end
|
37
41
|
|
38
|
-
def
|
42
|
+
def handle_issues(issues)
|
39
43
|
case issues.count
|
40
44
|
when 0
|
41
45
|
Gissuel::Log.new("\nGissuel: π β βΊοΈ").grey
|
42
46
|
when 1
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
+
if @index.zero? then
|
48
|
+
Gissuel::Log.new("π there is one issue on your π½οΈ.").red
|
49
|
+
Gissuel::Log.new("β here is quick look at it:\n").grey
|
50
|
+
else
|
51
|
+
Gissuel::Log.new("β here is quick look at the issue:\n").grey
|
52
|
+
end
|
53
|
+
report_issue(issues.first, @index)
|
47
54
|
else
|
48
55
|
Gissuel::Log.new("π there are #{issues.count} issues on your π½οΈ.").red
|
49
56
|
Gissuel::Log.new("β here is quick look at these:\n").grey
|
50
57
|
|
51
|
-
issues.
|
52
|
-
report_issue(
|
58
|
+
issues.each_with_index do |issue, index|
|
59
|
+
report_issue(issue, index + 1)
|
53
60
|
end
|
54
61
|
end
|
55
62
|
end
|
56
63
|
|
57
|
-
def report_issue(issue)
|
58
|
-
Gissuel::Log.new("
|
64
|
+
def report_issue(issue, index)
|
65
|
+
Gissuel::Log.new("[#{index}]: #{issue.title}").yellow
|
59
66
|
Gissuel::Log.new("URL: #{issue.html_url}").blue
|
60
|
-
Gissuel::Log.new("BODY: #{issue.body}").grey
|
67
|
+
Gissuel::Log.new("BODY: #{issue.body}").grey if @body
|
61
68
|
Gissuel::Log.new("No of comments: #{issue.comments} | Updated at: #{issue.updated_at}\n").green
|
62
69
|
end
|
63
70
|
|
data/lib/gissuel/version.rb
CHANGED