openpull 0.0.8 → 0.0.9

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
- SHA1:
3
- metadata.gz: d5a4717c914eb94dc66232e9cc76d8800b7bfe8b
4
- data.tar.gz: a76e3453a4cd46fa14050d5ebc69cb9162bfa117
2
+ SHA256:
3
+ metadata.gz: 82f1b6addaaf490e7b67098b24319e40edfc91c13a2da045793764195eab8ada
4
+ data.tar.gz: 7bb5b8770a4471f37ce8a8c5ef3006fcfa8229cdd2cf28dd30ff27264889e2f5
5
5
  SHA512:
6
- metadata.gz: 537cac70500d9d6274d408ac7d595caa635f65d4070ef28ba3a94fead57d1a3f8e4aa638297dba1cd79089b102caede04f1893e480200199b4efe24d05263c68
7
- data.tar.gz: 79731e724fb25428348f8601efa70421bb248a6c29bade759b0576393da623f01f6fcae498617945b8b66944b86b5c613dd63e040023bba1aa6e5ccbdeb17b8c
6
+ metadata.gz: fa0e6916e1d363246249895ad0d0d448ed19935eec6c77971d326c968f670dbfeea355401d3113b51438e31434adbf439a1ffc1d10052fc73899a53ff0862558
7
+ data.tar.gz: 4e2e273c8bb3d7f72e98292f62313f0417d5d1ac6165eae419193807a7d31e0e938f21a718e01c591dad9399055e6d812b96b37ecfe163edb05d9889b9581144
@@ -1,3 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
2
4
  require 'openpull'
3
5
  OpenPull::Runner.run(ARGV)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'octokit'
2
4
  require 'faraday-http-cache'
3
5
  require 'colorize'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module OpenPull
2
4
  class Client
3
5
  attr_reader :octokit_client, :organisation, :username
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module OpenPull
2
4
  class PullRequestDecorator < ::SimpleDelegator
3
5
  def as_row(username)
@@ -39,13 +41,13 @@ module OpenPull
39
41
 
40
42
  def commits
41
43
  num = rels[:commits].get.data.size
42
- num == 0 ? '' : num
44
+ num.zero? ? '' : num
43
45
  end
44
46
 
45
47
  def comments
46
48
  num = rels[:comments].get.data.size
47
49
  num += rels[:review_comments].get.data.size
48
- num == 0 ? '' : num
50
+ num.zero? ? '' : num
49
51
  end
50
52
 
51
53
  def mergeable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module OpenPull
2
4
  class PullRequestFetcher
3
5
  attr_reader :client, :organisation, :username
@@ -24,8 +26,8 @@ module OpenPull
24
26
  pull_requests = client.pull_requests(repository.id, state: 'open')
25
27
  return [] if pull_requests.empty?
26
28
 
27
- results = pull_requests.map do |pr|
28
- Thread.new { row(pr) }
29
+ results = pull_requests.map do |pull_request|
30
+ Thread.new { row(pull_request) }
29
31
  end.map(&:value)
30
32
 
31
33
  [headers(repository, results.size)] + results
@@ -44,11 +46,12 @@ module OpenPull
44
46
  head.map { |h| h.blue.bold }
45
47
  end
46
48
 
47
- def row(pr)
49
+ def row(pull_request)
48
50
  print '.'.yellow
49
51
 
50
- pr_data = pr.rels[:self].get.data
51
- OpenPull::PullRequestDecorator.new(pr_data).as_row(username)
52
+ OpenPull::PullRequestDecorator.new(
53
+ pull_request.rels[:self].get.data
54
+ ).as_row(username)
52
55
  end
53
56
  end
54
57
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'optparse'
2
4
 
3
5
  module OpenPull
@@ -84,24 +86,26 @@ module OpenPull
84
86
  end
85
87
  end
86
88
 
87
- def check_options(op)
89
+ def check_options(option)
88
90
  check_access_token
89
- check_organisation(op)
91
+ check_organisation(option)
90
92
  end
91
93
 
92
94
  def check_access_token
93
95
  @options[:access_token] = ENV['GITHUB_ACCESS_TOKEN']
94
96
  return unless @options[:access_token].nil?
97
+
95
98
  puts 'You need to set the GitHub access token in your environment. ' \
96
99
  '(GITHUB_ACCESS_TOKEN)'
97
100
  exit
98
101
  end
99
102
 
100
- def check_organisation(op)
103
+ def check_organisation(option)
101
104
  return unless @options[:organisation].nil?
105
+
102
106
  puts 'You need to either pass GitHub organisation or set it in your ' \
103
107
  'environment. (GITHUB_ORGANISATION)'
104
- puts "\n#{op}"
108
+ puts "\n#{option}"
105
109
  exit
106
110
  end
107
111
  end
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module OpenPull
2
4
  class Table
3
- HEADINGS = %w(
5
+ HEADINGS = %w[
4
6
  title user labels status commits comments mergeable url updated
5
- )
7
+ ].freeze
6
8
 
7
9
  class << self
8
10
  def rewind!
@@ -15,7 +17,7 @@ module OpenPull
15
17
  Terminal::Table.new(headings: HEADINGS.map(&:bold)) do |tab|
16
18
  sub_tables.each_with_index do |sub_table, j|
17
19
  sub_table.each_with_index do |row, i|
18
- tab.add_separator if i == 0 && j != 0
20
+ tab.add_separator if i.zero? && !j.zero?
19
21
  tab.add_row row
20
22
  end
21
23
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module OpenPull
2
- VERSION = '0.0.8'
4
+ VERSION = '0.0.9'
3
5
  end
metadata CHANGED
@@ -1,85 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openpull
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mads Ohm Larsen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-15 00:00:00.000000000 Z
11
+ date: 2019-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: octokit
14
+ name: colorize
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '3.7'
19
+ version: 0.8.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '3.7'
26
+ version: 0.8.1
27
27
  - !ruby/object:Gem::Dependency
28
- name: colorize
28
+ name: faraday-http-cache
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.7'
33
+ version: 0.4.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.7'
40
+ version: 0.4.2
41
41
  - !ruby/object:Gem::Dependency
42
- name: terminal-table
42
+ name: octokit
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.4'
47
+ version: 3.8.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.4'
54
+ version: 3.8.0
55
55
  - !ruby/object:Gem::Dependency
56
- name: faraday-http-cache
56
+ name: terminal-table
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.4'
61
+ version: 1.8.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0.4'
68
+ version: 1.8.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rubocop
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0.31'
75
+ version: '0.64'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0.31'
82
+ version: '0.64'
83
83
  description: Fetches open pull-requests, with status and mergability, in your organisation.
84
84
  email: mads.ohm@gmail.com
85
85
  executables:
@@ -95,7 +95,7 @@ files:
95
95
  - lib/openpull/runner.rb
96
96
  - lib/openpull/table.rb
97
97
  - lib/openpull/version.rb
98
- homepage: http://ohm.sh/
98
+ homepage: https://ohm.sh/
99
99
  licenses:
100
100
  - MIT
101
101
  metadata: {}
@@ -114,8 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  - !ruby/object:Gem::Version
115
115
  version: '0'
116
116
  requirements: []
117
- rubyforge_project:
118
- rubygems_version: 2.4.5
117
+ rubygems_version: 3.0.1
119
118
  signing_key:
120
119
  specification_version: 4
121
120
  summary: Fetches Open Pull-Requests from Github