pra 1.0.0 → 1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a2be92bf55869e2dd6b07043ef8bd1826698895d
4
- data.tar.gz: 105bfd005ecf099bb7b25a8b61131a4155b0a724
3
+ metadata.gz: f854d2dbd12cfe0df0d280e0b4c48cf5389acc1c
4
+ data.tar.gz: 95a6f5c7dce502ab33aeacee0957a22c00425e22
5
5
  SHA512:
6
- metadata.gz: f83912cc359bfd70f36747b7c7493ed06906073fc2715b91dcede0fb9b42eb6be1212b8c519c42f4ba4acaa4445217705cc747011815543d3dc2b8f5514350c4
7
- data.tar.gz: 85833ebe12ef250ed4c355d183ae2aced925c4e6e8b7fbaea22f804e698133d398eca30f8a0ba7f8174cd81b3f80520a24b7a7d25e001ff10a32f196447b52fd
6
+ metadata.gz: f35294303b1581e0e51c34ffac26dc70c255ed5a76b253e393f890ab57d8b26074529a41f6174cb12434f5f6ed90302d9061fc8b224c8a5783a59402b400c68e
7
+ data.tar.gz: ec7edb303f591bc50e2884906aa3b95b371d3266df854ef213e4158eb5480b4eafd78e9d31477f088cf61a2188c0da9fd97314c1d19868c7de4cdfd23912ffa6
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.0.0-p247
1
+ 2.0.0-p247
data/ChangeLog.md CHANGED
@@ -6,6 +6,11 @@ versions as well as provide a rough history.
6
6
 
7
7
  #### Next Release
8
8
 
9
+ #### v1.1.0
10
+
11
+ * Added "Assignee" column so that users can see which pull requests have
12
+ already been assigned ([\#10](https://github.com/reachlocal/pra/issues/10))
13
+
9
14
  #### v1.0.0
10
15
 
11
16
  * Added connection failure handling so it stays running
@@ -112,8 +112,8 @@ module Pra
112
112
  def draw_current_pull_requests
113
113
  @state_lock.synchronize {
114
114
  output_string(3, 0, "#{@current_pull_requests.length} Pull Requests")
115
- output_string(HEADER_LINE, 0, "repository title from_reference to_reference author service")
116
- output_string(HEADER_LINE + 1, 0, "--------------------------------------------------------------------------------------------------------------------------------")
115
+ output_string(HEADER_LINE, 0, "repository title from_reference to_reference author assignee service")
116
+ output_string(HEADER_LINE + 1, 0, "-----------------------------------------------------------------------------------------------------------------------------------------------")
117
117
 
118
118
  (LIST_START_LINE...LIST_START_LINE+@previous_number_of_pull_requests).each do |i|
119
119
  Curses.setpos(i,0)
@@ -123,9 +123,9 @@ module Pra
123
123
 
124
124
  @current_pull_requests.each_with_index do |pull_request, index|
125
125
  if index == @selected_pull_request_index
126
- output_highlighted_string(LIST_START_LINE + index, 0, "#{pull_request.repository.ljust(15)[0..14]}\t#{pull_request.title.ljust(20)[0..19]}\t#{pull_request.from_reference.ljust(20)[0..19]}\t#{pull_request.to_reference.ljust(20)[0..19]}\t#{pull_request.author.ljust(20)[0..19]}\t#{pull_request.service_id.ljust(10)[0..9]}")
126
+ output_highlighted_string(LIST_START_LINE + index, 0, "#{pull_request.repository.ljust(15)[0..14]}\t#{pull_request.title.ljust(20)[0..19]}\t#{pull_request.from_reference.ljust(20)[0..19]}\t#{pull_request.to_reference.ljust(20)[0..19]}\t#{pull_request.author.ljust(20)[0..19]}\t#{pull_request.assignee.ljust(20)[0..19]}\t#{pull_request.service_id.ljust(10)[0..9]}")
127
127
  else
128
- output_string(LIST_START_LINE + index, 0, "#{pull_request.repository.ljust(15)[0..14]}\t#{pull_request.title.ljust(20)[0..19]}\t#{pull_request.from_reference.ljust(20)[0..19]}\t#{pull_request.to_reference.ljust(20)[0..19]}\t#{pull_request.author.ljust(20)[0..19]}\t#{pull_request.service_id.ljust(10)[0..9]}")
128
+ output_string(LIST_START_LINE + index, 0, "#{pull_request.repository.ljust(15)[0..14]}\t#{pull_request.title.ljust(20)[0..19]}\t#{pull_request.from_reference.ljust(20)[0..19]}\t#{pull_request.to_reference.ljust(20)[0..19]}\t#{pull_request.author.ljust(20)[0..19]}\t#{pull_request.assignee.ljust(20)[0..19]}\t#{pull_request.service_id.ljust(10)[0..9]}")
129
129
  end
130
130
  end
131
131
  }
@@ -20,7 +20,7 @@ module Pra
20
20
  def get_repo_pull_requests(repository_config)
21
21
  requests = []
22
22
  JSON.parse(rest_api_pull_request_resource(repository_config).get).each do |request|
23
- requests << Pra::PullRequest.new(title: request["title"], from_reference: request["head"]["label"], to_reference: request["base"]["label"], author: request["user"]["login"], link: request['html_url'], service_id: 'github', repository: repository_config["repository"])
23
+ requests << Pra::PullRequest.new(title: request["title"], from_reference: request["head"]["label"], to_reference: request["base"]["label"], author: request["user"]["login"], assignee: request["assignee"] ? request["assignee"]["login"] : nil, link: request['html_url'], service_id: 'github', repository: repository_config["repository"])
24
24
  end
25
25
  return requests
26
26
  end
@@ -1,15 +1,20 @@
1
1
  module Pra
2
2
  class PullRequest
3
- attr_accessor :title, :from_reference, :to_reference, :author, :link, :service_id, :repository
3
+ attr_accessor :title, :from_reference, :to_reference, :author, :assignee, :link, :service_id, :repository
4
4
 
5
5
  def initialize(attributes={})
6
6
  @title = attributes[:title]
7
7
  @from_reference = attributes[:from_reference]
8
8
  @to_reference = attributes[:to_reference]
9
9
  @author = attributes[:author]
10
+ @assignee = attributes[:assignee]
10
11
  @link = attributes[:link]
11
12
  @service_id = attributes[:service_id]
12
13
  @repository = attributes[:repository]
13
14
  end
15
+
16
+ def assignee
17
+ @assignee || ""
18
+ end
14
19
  end
15
20
  end
@@ -20,7 +20,7 @@ module Pra
20
20
  def get_repo_pull_requests(repository_config)
21
21
  requests = []
22
22
  JSON.parse(rest_api_pull_request_resource(repository_config).get)["values"].each do |request|
23
- requests << Pra::PullRequest.new(title: request["title"], from_reference: request["fromRef"]["id"], to_reference: request["toRef"]["id"], author: request["author"]["user"]["name"], link: "#{@config['protocol']}://#{@config['host']}#{request['link']['url']}", service_id: 'stash', repository: repository_config["repository_slug"])
23
+ requests << Pra::PullRequest.new(title: request["title"], from_reference: request["fromRef"]["id"], to_reference: request["toRef"]["id"], assignee: request["reviewers"].length > 0 ? request["reviewers"].first["user"]["name"] : nil, author: request["author"]["user"]["name"], link: "#{@config['protocol']}://#{@config['host']}#{request['link']['url']}", service_id: 'stash', repository: repository_config["repository_slug"])
24
24
  end
25
25
  return requests
26
26
  end
data/lib/pra/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pra
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pra
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew De Ponte
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-24 00:00:00.000000000 Z
11
+ date: 2013-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
148
  version: '0'
149
149
  requirements: []
150
150
  rubyforge_project:
151
- rubygems_version: 2.0.5
151
+ rubygems_version: 2.0.3
152
152
  signing_key:
153
153
  specification_version: 4
154
154
  summary: CLI tool that shows open pull-requests across systems.