ghn 2.0.0 → 2.1.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 +5 -1
- data/lib/ghn/collector.rb +6 -5
- data/lib/ghn/commands.rb +2 -1
- data/lib/ghn/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: bd7dc86da789c42cd537f64004c0a5e644094b73
|
4
|
+
data.tar.gz: d466cb5126eed061a205204f9eadb1508108d4d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: baa4ec0020c19f9bd464b4f5bd7b487497baa4f434f40eaec27b4033afbd679b12c3594cedcb68055a8c6f9f8afeb9a64e491eca5e915ab3216db46d40520a04
|
7
|
+
data.tar.gz: 158384d2303d32765708bc144ae4902e3d193de1e822b30b029034eed55228d980a833fd59b8a3d9cfc3c9de8b3ab4df2c8b904d56510933df384bbecf335113
|
data/README.md
CHANGED
@@ -20,7 +20,9 @@ Commands:
|
|
20
20
|
ghn open NAME # Open unread notifications in browser
|
21
21
|
|
22
22
|
Options:
|
23
|
-
-a, [--all], [--no-all]
|
23
|
+
-a, [--all], [--no-all] # List/Open all unread notifications
|
24
|
+
-p, [--participating], [--no-participating] # List/Open notifications your are participating
|
25
|
+
[--follow-issuecomment], [--no-follow-issuecomment] # Follow issuecomment anchor URL
|
24
26
|
```
|
25
27
|
|
26
28
|
NAME should be a username/reponame of repository.
|
@@ -31,6 +33,8 @@ NAME should be a username/reponame of repository.
|
|
31
33
|
|
32
34
|
`$ ghn open -a` opens all unread notifications in your browser.
|
33
35
|
|
36
|
+
`$ ghn open -p` opens notifications your are participating only.
|
37
|
+
|
34
38
|
## Aliases
|
35
39
|
|
36
40
|
You can set aliases as a shortcut of NAME.
|
data/lib/ghn/collector.rb
CHANGED
@@ -1,18 +1,19 @@
|
|
1
1
|
class Ghn
|
2
2
|
class Collector
|
3
|
-
attr_reader :client, :repo_full_name, :follow_issuecomment
|
3
|
+
attr_reader :client, :repo_full_name, :follow_issuecomment, :participating
|
4
4
|
|
5
|
-
def initialize(client, repo_full_name = nil,
|
5
|
+
def initialize(client, repo_full_name = nil, options = {})
|
6
6
|
@client = client
|
7
7
|
@repo_full_name = repo_full_name
|
8
|
-
@follow_issuecomment = follow_issuecomment
|
8
|
+
@follow_issuecomment = options[:follow_issuecomment] || false
|
9
|
+
@participating = options[:participating] || false
|
9
10
|
end
|
10
11
|
|
11
12
|
def collect(page = 1)
|
12
13
|
notifications = if repo_full_name
|
13
|
-
client.repo_notifications(repo_full_name, page: page)
|
14
|
+
client.repo_notifications(repo_full_name, page: page, participating: participating)
|
14
15
|
else
|
15
|
-
client.notifications(page: page)
|
16
|
+
client.notifications(page: page, participating: participating)
|
16
17
|
end
|
17
18
|
@count = notifications.count
|
18
19
|
notifications.map { |notification|
|
data/lib/ghn/commands.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
class Ghn
|
2
2
|
class Commands < Thor
|
3
3
|
class_option :all, type: :boolean, aliases: '-a', desc: 'List/Open all unread notifications'
|
4
|
+
class_option :participating, type: :boolean, aliases: '-p', desc: 'List/Open notifications your are participating'
|
4
5
|
class_option :follow_issuecomment, type: :boolean, desc: 'Follow issuecomment anchor URL'
|
5
6
|
|
6
7
|
desc 'list NAME', 'List unread notifications'
|
@@ -21,7 +22,7 @@ class Ghn
|
|
21
22
|
|
22
23
|
def collect(repo_full_name = nil)
|
23
24
|
threads = []
|
24
|
-
collector = Collector.new(client, repo_full_name, follow_issuecomment
|
25
|
+
collector = Collector.new(client, repo_full_name, follow_issuecomment: follow_issuecomment?, participating: options['participating'])
|
25
26
|
# Unfortunately, GitHub v3 Notifications API doesn't accept octokit's auto_paginate option
|
26
27
|
# because this API doesn't return Link header so far.
|
27
28
|
loop.with_index(1) do |_, page|
|
data/lib/ghn/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ghn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kensuke Nagae
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|