gish 0.9.3 → 0.9.4

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
  SHA1:
3
- metadata.gz: 39dfdb5d3e7fd517e3cc8ced3f2d263a4c5c1a9f
4
- data.tar.gz: 5268d556cbcd7da8173a3ddfdd4915988d668800
3
+ metadata.gz: 17282a83906eb4c54cdc4d3838481027fae4f156
4
+ data.tar.gz: 7fed2aa273b24b43232bbe174dff64e8d55262d0
5
5
  SHA512:
6
- metadata.gz: b9ad1ae8cf514901c11f7a24b03477dd3ffae4df20fc0fca4ebedc7f5ffd808edb274f85bd0ca554d13aff1ad2cc5f13cf16b7207c207d818f16e209c87b1772
7
- data.tar.gz: e507b44c35692a785ff657a14843011806fed84d9586b8392a0025a627309224466e0939795cfc8f714ef3651f820cb37d5abb0b816e1d36e1e726986a9c9c54
6
+ metadata.gz: 1b776cbc5849dcf4798b87c74a8d4b36b5ef785117b914fb2d2d76402a3af40992152447632024639796d8f208406e127ba5865cbc43cd7a833844f4091cfcdd
7
+ data.tar.gz: 39befa93204e4e50b62293cd584f976878c4466bcf0f4825903186611d04b871b2d25bcd5e4b3d9b7babcf0a16ad3eac179c24f0b07c4b412983bd2050e59095
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.9.4
4
+
5
+ * Edit command added, and assign command now checks to see if specified user is a collaborator. Both thanks to [despo](https://github.com/despo).
6
+
3
7
  ## 0.9.3
4
8
 
5
9
  * Changed output formatting for the list command.
data/README.md CHANGED
@@ -48,14 +48,14 @@ Here are some examples to get you started.
48
48
  When listing issues, the number of comments on an issue will be displayed at the end of a line, along with a tag indicating if the issue is a pull request.
49
49
 
50
50
  ```
51
- #9 barisbalic Emoji! [PR] [2]
52
- #8 barisbalic Fix editor input for open command [0]
53
- #7 barisbalic Support API paging [0]
54
- #6 barisbalic Current repository check is lame [1]
55
- #5 barisbalic Format issue and comment times [0]
56
- #4 barisbalic Enhance terminal output [0]
57
- #2 barisbalic Check issue assignee [0]
58
- #1 barisbalic Add config subcommand [0]
51
+ #9 barisbalic Emoji! [PR] 2 comments
52
+ #8 barisbalic Fix editor input for open command 0 comments
53
+ #7 barisbalic Support API paging 0 comments
54
+ #6 barisbalic Current repository check is lame 1 comments
55
+ #5 barisbalic Format issue and comment times 0 comments
56
+ #4 barisbalic Enhance terminal output 0 comments
57
+ #2 barisbalic Check issue assignee 0 comments
58
+ #1 barisbalic Add config subcommand 0 comments
59
59
  ```
60
60
 
61
61
 
@@ -21,6 +21,10 @@ module Gish
21
21
  request { client.create_issue(Gish.repository, title, body, options) }
22
22
  end
23
23
 
24
+ def edit(issue_number, title, body)
25
+ request { client.update_issue(Gish.repository, issue_number, title, body, {}) }
26
+ end
27
+
24
28
  def close(issue_number, comment=nil)
25
29
  request { client.close_issue(Gish.repository, issue_number)}
26
30
  end
@@ -45,7 +49,7 @@ module Gish
45
49
  labels.each do |l|
46
50
  request { client.remove_label(Gish.repository, issue_number, l.strip) }
47
51
  end
48
- end
52
+ end
49
53
 
50
54
  def assign(issue_number, user_login)
51
55
  options = {:assignee => user_login}
@@ -64,4 +68,4 @@ module Gish
64
68
  end
65
69
  end
66
70
  end
67
- end
71
+ end
@@ -0,0 +1,9 @@
1
+ module Gish
2
+ module Commands
3
+ module Repository
4
+ def is_collaborator?(login)
5
+ request { client.collaborator?(Gish.repository, login) }
6
+ end
7
+ end
8
+ end
9
+ end
@@ -3,6 +3,8 @@ module Gish
3
3
  include TerminalHelpers
4
4
  include DateHelpers
5
5
 
6
+ attr_accessor :title, :body
7
+
6
8
  def initialize(github_issue)
7
9
  @url = github_issue.html_url
8
10
  @number = github_issue.number.to_s
data/lib/gish/runner.rb CHANGED
@@ -15,7 +15,7 @@ module Gish
15
15
  return unless options.repository? && options.repository != 'repository'
16
16
  Gish.repository = options.repository
17
17
  end
18
-
18
+
19
19
  desc 'labels SUBCOMMAND ...ARGS', 'Manage labels for the repository.'
20
20
  subcommand 'labels', Gish::Cli::Labels
21
21
 
@@ -46,7 +46,7 @@ module Gish
46
46
  def list(count=20)
47
47
  args = {:per_page => count}
48
48
  args[:state] = 'closed' if options.closed?
49
- args[:direction] = 'asc' if options.order == 'asc'
49
+ args[:direction] = 'asc' if options.order == 'asc'
50
50
  puts Gish.list(args)
51
51
  end
52
52
 
@@ -86,7 +86,9 @@ module Gish
86
86
 
87
87
  desc 'assign ISSUE_NUMBER USER_LOGIN', 'Assign an issue to a user.'
88
88
  def assign(issue_number, user_login)
89
- Gish.assign(issue_number, user_login)
89
+ return Gish.assign(issue_number, user_login) if Gish.is_collaborator?(user_login)
90
+
91
+ puts "#{user_login} is not a collaborator on #{Gish.repository}"
90
92
  end
91
93
 
92
94
  desc 'unassign ISSUE_NUMBER', 'Unassign an issue.'
@@ -106,9 +108,19 @@ module Gish
106
108
  Gish.create(title, message, labels, assignee)
107
109
  end
108
110
 
111
+ desc 'edit ISSUE_NUMBER', 'Edit an issue.'
112
+ method_option :title, :type => :string, :aliases => '-t', :desc => 'Specify the new title'
113
+ def edit(issue_number)
114
+ issue = Gish.show(issue_number)
115
+ message = capture_editor_input(issue.body)
116
+ title = options.title unless options.nil? and options.title.nil?
117
+ title ||= issue.title
118
+ Gish.edit(issue_number, title, message)
119
+ end
120
+
109
121
  desc 'version', 'Display the version of Gish.'
110
122
  def version
111
123
  puts "v#{Gish::VERSION}"
112
124
  end
113
125
  end
114
- end
126
+ end
data/lib/gish/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Gish
2
- VERSION = "0.9.3"
2
+ VERSION = "0.9.4"
3
3
  end
data/lib/gish.rb CHANGED
@@ -7,6 +7,7 @@ require "gish/commands/issue"
7
7
  require "gish/commands/comment"
8
8
  require "gish/commands/label"
9
9
  require "gish/commands/assignee"
10
+ require "gish/commands/repository"
10
11
  require "gish/presentation/issue"
11
12
  require "gish/presentation/label"
12
13
  require "gish/presentation/comment"
@@ -28,11 +29,12 @@ module Gish
28
29
  rescue Octokit::Unauthorized
29
30
  puts "Something is wrong with your personal access token."
30
31
  exit 1
31
- end
32
+ end
32
33
  end
33
34
 
34
35
  extend Gish::Commands::Label
35
36
  extend Gish::Commands::Issue
36
37
  extend Gish::Commands::Comment
37
38
  extend Gish::Commands::Assignee
39
+ extend Gish::Commands::Repository
38
40
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gish
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Baris Balic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-30 00:00:00.000000000 Z
11
+ date: 2014-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -90,6 +90,7 @@ files:
90
90
  - lib/gish/commands/comment.rb
91
91
  - lib/gish/commands/issue.rb
92
92
  - lib/gish/commands/label.rb
93
+ - lib/gish/commands/repository.rb
93
94
  - lib/gish/configuration.rb
94
95
  - lib/gish/helpers/date_helpers.rb
95
96
  - lib/gish/helpers/input_helpers.rb