smart_todo 1.0.0 → 1.0.1
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/.rubocop.yml +2 -0
- data/.travis.yml +15 -0
- data/CHANGELOG.md +15 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/smart_todo/events/{pull_request_close.rb → issue_close.rb} +4 -4
- data/lib/smart_todo/events.rb +12 -3
- data/lib/smart_todo/version.rb +1 -1
- data/lib/smart_todo.rb +1 -1
- metadata +5 -5
- data/.shopify-build/VERSION +0 -1
- data/.shopify-build/smart-todo.yml +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00c1fc521428aa50cef7d23ea71e79cd7ef19389c2ec9bf6a03f83a61613d43c
|
4
|
+
data.tar.gz: 793c12664a7e8c54e22d33f392eec319d6cfeed0954b3854c0b631a4bac7e585
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc05790423e467a734c1e0ca0f8fe60a095da70ecfddc05ddb91f908f024ee47d198ab166dd2c658daf6ac604b7b9c18647354edf2e5f080498275b8fb379d35
|
7
|
+
data.tar.gz: ba0ec4630934f6d9688f7bcdfd7a1ab05cac527f939adf7c9b84baac8b8e58a8a9dba23e68043bd028f310751271ba21b53756ce11c4a1173aa117993b9f3c7a
|
data/.rubocop.yml
CHANGED
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
## [Unreleased]
|
8
|
+
|
9
|
+
## [1.0.1] - 2019-08-06
|
10
|
+
### Fixed
|
11
|
+
- Fixed `issue_close` event making a call to the `pulls/` GH endpoint instead of the `issues/` one
|
12
|
+
|
13
|
+
## [1.0.0] - 2019-07-19
|
14
|
+
### Added
|
15
|
+
- Initial Release
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
<img src="https://user-images.githubusercontent.com/8122246/61341925-b936d180-a848-11e9-95c1-0d2f398c51b1.png?raw=true" width="200">
|
3
3
|
</h3>
|
4
4
|
|
5
|
-
[](https://travis-ci.com/Shopify/smart_todo)
|
6
6
|
|
7
7
|
_SmartTodo_ is a library designed to assign users on TODO comments written in your codebase and help assignees be reminded when it's time to commit to their TODO.
|
8
8
|
|
@@ -5,20 +5,20 @@ require 'json'
|
|
5
5
|
|
6
6
|
module SmartTodo
|
7
7
|
module Events
|
8
|
-
# An event that check if a
|
8
|
+
# An event that check if a GitHub Pull Request or Issue is closed.
|
9
9
|
# This event will make an API call to the GitHub API.
|
10
10
|
#
|
11
11
|
# If the Pull Request or Issue is on a private repository, exporting a token
|
12
12
|
# with the `repos` scope in the +SMART_TODO_GITHUB_TOKEN+ environment variable
|
13
13
|
# is required.
|
14
|
-
class
|
14
|
+
class IssueClose
|
15
15
|
TOKEN_ENV = 'SMART_TODO_GITHUB_TOKEN'
|
16
16
|
|
17
17
|
# @param organization [String]
|
18
18
|
# @param repo [String]
|
19
19
|
# @param pr_number [String, Integer]
|
20
|
-
def initialize(organization, repo, pr_number)
|
21
|
-
@url = "/repos/#{organization}/#{repo}
|
20
|
+
def initialize(organization, repo, pr_number, type:)
|
21
|
+
@url = "/repos/#{organization}/#{repo}/#{type}/#{pr_number}"
|
22
22
|
@organization = organization
|
23
23
|
@repo = repo
|
24
24
|
@pr_number = pr_number
|
data/lib/smart_todo/events.rb
CHANGED
@@ -38,15 +38,24 @@ module SmartTodo
|
|
38
38
|
GemRelease.new(gem_name, requirements).met?
|
39
39
|
end
|
40
40
|
|
41
|
-
# Check if the
|
41
|
+
# Check if the issue +issue_number+ is closed
|
42
|
+
#
|
43
|
+
# @param organization [String] the GitHub organization name
|
44
|
+
# @param repo [String] the GitHub repo name
|
45
|
+
# @param issue_number [String, Integer]
|
46
|
+
# @return [false, String]
|
47
|
+
def issue_close(organization, repo, issue_number)
|
48
|
+
IssueClose.new(organization, repo, issue_number, type: 'issues').met?
|
49
|
+
end
|
50
|
+
|
51
|
+
# Check if the pull request +pr_number+ is closed
|
42
52
|
#
|
43
53
|
# @param organization [String] the GitHub organization name
|
44
54
|
# @param repo [String] the GitHub repo name
|
45
55
|
# @param pr_number [String, Integer]
|
46
56
|
# @return [false, String]
|
47
57
|
def pull_request_close(organization, repo, pr_number)
|
48
|
-
|
58
|
+
IssueClose.new(organization, repo, pr_number, type: 'pulls').met?
|
49
59
|
end
|
50
|
-
alias_method :issue_close, :pull_request_close
|
51
60
|
end
|
52
61
|
end
|
data/lib/smart_todo/version.rb
CHANGED
data/lib/smart_todo.rb
CHANGED
@@ -17,6 +17,6 @@ module SmartTodo
|
|
17
17
|
module Events
|
18
18
|
autoload :Date, 'smart_todo/events/date'
|
19
19
|
autoload :GemRelease, 'smart_todo/events/gem_release'
|
20
|
-
autoload :
|
20
|
+
autoload :IssueClose, 'smart_todo/events/issue_close'
|
21
21
|
end
|
22
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_todo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -94,8 +94,8 @@ files:
|
|
94
94
|
- ".gitignore"
|
95
95
|
- ".rubocop-http---shopify-github-io-ruby-style-guide-rubocop-yml"
|
96
96
|
- ".rubocop.yml"
|
97
|
-
- ".
|
98
|
-
-
|
97
|
+
- ".travis.yml"
|
98
|
+
- CHANGELOG.md
|
99
99
|
- CODE_OF_CONDUCT.md
|
100
100
|
- Gemfile
|
101
101
|
- Gemfile.lock
|
@@ -113,7 +113,7 @@ files:
|
|
113
113
|
- lib/smart_todo/events.rb
|
114
114
|
- lib/smart_todo/events/date.rb
|
115
115
|
- lib/smart_todo/events/gem_release.rb
|
116
|
-
- lib/smart_todo/events/
|
116
|
+
- lib/smart_todo/events/issue_close.rb
|
117
117
|
- lib/smart_todo/parser/comment_parser.rb
|
118
118
|
- lib/smart_todo/parser/metadata_parser.rb
|
119
119
|
- lib/smart_todo/parser/todo_node.rb
|
data/.shopify-build/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
v1
|
@@ -1,37 +0,0 @@
|
|
1
|
-
containers:
|
2
|
-
ruby-2.3:
|
3
|
-
docker: circleci/ruby:2.3
|
4
|
-
ruby-2.4:
|
5
|
-
docker: circleci/ruby:2.4
|
6
|
-
ruby-2.5:
|
7
|
-
docker: circleci/ruby:2.5
|
8
|
-
ruby-2.6:
|
9
|
-
docker: circleci/ruby:2.6
|
10
|
-
|
11
|
-
shared:
|
12
|
-
defaults: &defaults
|
13
|
-
timeout: 5m
|
14
|
-
dependencies:
|
15
|
-
- bundler
|
16
|
-
run:
|
17
|
-
- bundle exec rake test
|
18
|
-
|
19
|
-
steps:
|
20
|
-
- label: ":cop: Ruby style check"
|
21
|
-
timeout: 5m
|
22
|
-
container: ruby-2.5
|
23
|
-
dependencies:
|
24
|
-
- bundler
|
25
|
-
run: bin/rubocop
|
26
|
-
- label: ":ruby: Ruby 2.3"
|
27
|
-
container: ruby-2.3
|
28
|
-
<<: *defaults
|
29
|
-
- label: ":ruby: Ruby 2.4"
|
30
|
-
container: ruby-2.4
|
31
|
-
<<: *defaults
|
32
|
-
- label: ":ruby: Ruby 2.5"
|
33
|
-
container: ruby-2.5
|
34
|
-
<<: *defaults
|
35
|
-
- label: ":ruby: Ruby 2.6"
|
36
|
-
container: ruby-2.6
|
37
|
-
<<: *defaults
|