whatsup_github 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0633d017c04fd64dfdd657e5c88db7dfed9ec1ff6fd91d4fe6471a50d1e0308
4
- data.tar.gz: 819d3cd2c72f38ea8df1fbd496a394b727d522ac52c620221fc9bb4f71b2a31e
3
+ metadata.gz: d76d974b6feb2663b6234906cde7aee2011f6fe1c87c2e90f7e4791e4f2b04a7
4
+ data.tar.gz: fb62023682520d065cfdf326300f576b38e85fea9fcf7e203b8105cae4278b94
5
5
  SHA512:
6
- metadata.gz: 9f545b95c7dd6e2e6facb23eec0ffa26d4f8e9f7330698c7c2bd471a2affcc98bbbddef433b35ff74ae8ace4a639b223262409fd32caf9014ed5d5b1d47fd9ab
7
- data.tar.gz: '0910958934e53e7a8feb8d63121f9193133a725057b7139df5fef6d4c2e16d506e44014afe55320027fda6c3514f1b8214a0f1fa9143583c79220054f16e2790'
6
+ metadata.gz: d50707d1f9eb818a36aec8bdc46d19d3543b037b94f9452b3734888184cf77c319364bdd5dc1a5675a4cd90718c808ad7b12052ffcba80d0ac43bd4652eb3d70
7
+ data.tar.gz: 2032e86160a162ba96521fcb3f7f4ae042c9494e12786e22e28ac4a75d0fcb0ae5c3154f03fe69c1616e0f1cd81eacc2c4166393287708d9535dd1e79eaf46cd
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.7.2
1
+ ruby-2.5.8
data/.travis.yml CHANGED
@@ -3,3 +3,4 @@ sudo: false
3
3
  language: ruby
4
4
  cache: bundler
5
5
  before_install: gem install bundler -v 2.2.15
6
+ script: bundle exec rake spec features
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.1
4
+
5
+ - Added authentication via an environment variable `WHATSUP_GITHUB_ACCESS_TOKEN`
6
+
3
7
  ## 0.4.0
4
8
 
5
9
  ### General
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- whatsup_github (0.4.0)
4
+ whatsup_github (0.4.1)
5
5
  netrc (~> 0.11)
6
6
  octokit (~> 4.20)
7
7
  thor (~> 1.1)
data/README.md CHANGED
@@ -20,7 +20,7 @@ The text must follow the `whatsnew` keyword and be located at the end.
20
20
 
21
21
  Example:
22
22
 
23
- ```
23
+ ```console
24
24
  This pull request adds ...
25
25
 
26
26
  Some other details about this pull request.
@@ -71,7 +71,7 @@ This gem can be installed as a system command-line tool or as a command-line too
71
71
 
72
72
  ### System installation
73
73
 
74
- ```
74
+ ```bash
75
75
  gem install whatsup_github
76
76
  ```
77
77
 
@@ -95,9 +95,11 @@ The configuration file [`.whatsup.yml`](lib/template/.whatsup.yml) will be creat
95
95
 
96
96
  ## Authentication
97
97
 
98
+ ### With the .netrc file
99
+
98
100
  Use [`~/.netrc`](https://github.com/octokit/octokit.rb#using-a-netrc-file) file for authentication.
99
101
 
100
- ```
102
+ ```config
101
103
  machine api.github.com
102
104
  login <GitHub login>
103
105
  password <GitHub token>
@@ -105,12 +107,22 @@ machine api.github.com
105
107
 
106
108
  Example:
107
109
 
108
- ```
110
+ ```config
109
111
  machine api.github.com
110
112
  login dshevtsov
111
113
  password y9o6YvEoa7IukRWUFdnkpuxNjJ3uwiDQp4zkAdU0
112
114
  ```
113
115
 
116
+ ### With an environment variable
117
+
118
+ Assign the `WHATSUP_GITHUB_ACCESS_TOKEN` to the GitHub token you want to use, prior the `whatsup_github` command.
119
+
120
+ Example:
121
+
122
+ ```bash
123
+ WHATSUP_GITHUB_ACCESS_TOKEN=askk494nmfodic68mk whatsup_github since 'apr 2'
124
+ ```
125
+
114
126
  ## Usage
115
127
 
116
128
  ```bash
@@ -129,13 +141,13 @@ You can use different date formats like `'April 2'`, `'2 April'`, `'apr 2'`, `'2
129
141
 
130
142
  To install dependencies:
131
143
 
132
- ```
144
+ ```bash
133
145
  bin/setup
134
146
  ```
135
147
 
136
148
  To install the package:
137
149
 
138
- ```
150
+ ```bash
139
151
  rake install
140
152
  ```
141
153
 
@@ -149,7 +161,7 @@ The project contains [rspec](https://rspec.info/) tests in `spec` and [cucumber]
149
161
 
150
162
  To run rspec tests:
151
163
 
152
- ```
164
+ ```bash
153
165
  rake spec
154
166
  ```
155
167
 
@@ -157,14 +169,14 @@ rake spec
157
169
 
158
170
  To run Cucumber tests:
159
171
 
160
- ```
172
+ ```bash
161
173
  rake features
162
174
  ```
163
175
 
164
176
  To pass the `output_file.feature` tests, you need to generate a non-empty `whats-new.yml`.
165
177
  To test just file:
166
178
 
167
- ```
179
+ ```bash
168
180
  bundle exec cucumber features/since.feature
169
181
  ```
170
182
 
@@ -47,8 +47,20 @@ module WhatsupGithub
47
47
  configuration.base_branch
48
48
  end
49
49
 
50
+ # Authorize with a GitHub token from $WHATSUP_GITHUB_ACCESS_TOKEN if available
51
+ # Otherwise, use credentials from ~/.netrc
52
+ # Otherwise, continue as a Guest
50
53
  def client
51
- Octokit::Client.new(netrc: true)
54
+ return @client if @client
55
+
56
+ @client =
57
+ if ENV['WHATSUP_GITHUB_ACCESS_TOKEN']
58
+ Octokit::Client.new(access_token: ENV['WHATSUP_GITHUB_ACCESS_TOKEN'])
59
+ elsif File.exist? "#{ENV['HOME']}/.netrc"
60
+ Octokit::Client.new(netrc: true)
61
+ else
62
+ Octokit::Client.new
63
+ end
52
64
  end
53
65
 
54
66
  def search_issues(label)
@@ -83,7 +83,6 @@ module WhatsupGithub
83
83
  return if @members
84
84
 
85
85
  @members = Members.new(config.membership).members
86
- p 'Hello'
87
86
  end
88
87
 
89
88
  def member_logins
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WhatsupGithub
4
- VERSION = '0.4.0'
4
+ VERSION = '0.4.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whatsup_github
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dima Shevtsov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-30 00:00:00.000000000 Z
11
+ date: 2021-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: netrc