smart_todo 1.0.0 → 1.0.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: e194a50190cc4abe3340fa3cb500ea64e9d0ea6a5270044578d83fcdb996e11c
4
- data.tar.gz: 7b03f430e450a5b56a8e0b976f9212b8301a5302fc4e4296695f355f06d109de
3
+ metadata.gz: 00c1fc521428aa50cef7d23ea71e79cd7ef19389c2ec9bf6a03f83a61613d43c
4
+ data.tar.gz: 793c12664a7e8c54e22d33f392eec319d6cfeed0954b3854c0b631a4bac7e585
5
5
  SHA512:
6
- metadata.gz: 30a88b03050f254e56eac390202399a52077a27308f8b0ecec1c1a61ac3b10ee30bb8470885388055c30fcb3cdb769948395f11be0d60dfc246849953e6d97e5
7
- data.tar.gz: 32ff62e57ace9b8b35620ba7f42e250d8718faae78846cda850bee080db6d7abb18908b0f45fdc51b1b480e811f7150d0b4cdb91bdee679a1032e1223e7ca560
6
+ metadata.gz: cc05790423e467a734c1e0ca0f8fe60a095da70ecfddc05ddb91f908f024ee47d198ab166dd2c658daf6ac604b7b9c18647354edf2e5f080498275b8fb379d35
7
+ data.tar.gz: ba0ec4630934f6d9688f7bcdfd7a1ab05cac527f939adf7c9b84baac8b8e58a8a9dba23e68043bd028f310751271ba21b53756ce11c4a1173aa117993b9f3c7a
data/.rubocop.yml CHANGED
@@ -3,3 +3,5 @@ inherit_from:
3
3
 
4
4
  AllCops:
5
5
  TargetRubyVersion: 2.5
6
+ Exclude:
7
+ - vendor/**/*
data/.travis.yml ADDED
@@ -0,0 +1,15 @@
1
+ sudo: false
2
+ cache: bundler
3
+ language: ruby
4
+ before_install:
5
+ - gem update bundler
6
+ rvm:
7
+ - 2.3
8
+ - 2.4
9
+ - 2.5
10
+ - 2.6
11
+ script:
12
+ - bundle exec rubocop --config .rubocop.yml
13
+ - bundle exec rake test
14
+ notifications:
15
+ email: false
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- smart_todo (1.0.0)
4
+ smart_todo (1.0.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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
- [![Build status](https://badge.buildkite.com/dc3ed74a08ef4a3f6f13bc37bf6ac19a80c0deb3157dfa7937.svg)](https://buildkite.com/shopify/smart-todo?branch=master)
5
+ [![Build Status](https://travis-ci.com/Shopify/smart_todo.svg?branch=master)](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 GitHun Pull Request or Issue is closed.
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 PullRequestClose
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}/pulls/#{pr_number}"
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
@@ -38,15 +38,24 @@ module SmartTodo
38
38
  GemRelease.new(gem_name, requirements).met?
39
39
  end
40
40
 
41
- # Check if the Pull Request or issue +pr_number+ is closed
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
- PullRequestClose.new(organization, repo, pr_number).met?
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SmartTodo
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.1"
5
5
  end
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 :PullRequestClose, 'smart_todo/events/pull_request_close'
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.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-07-19 00:00:00.000000000 Z
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
- - ".shopify-build/VERSION"
98
- - ".shopify-build/smart-todo.yml"
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/pull_request_close.rb
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
@@ -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