ghi 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/History.rdoc +12 -0
  2. data/lib/ghi.rb +1 -1
  3. data/lib/ghi/cli.rb +15 -9
  4. metadata +2 -2
data/History.rdoc CHANGED
@@ -1,3 +1,15 @@
1
+ === 0.2.4
2
+
3
+ * 1 enhancement
4
+
5
+ * Detect remotes and prefer them with the "-r" flag.
6
+
7
+
8
+ * 1 bugfix
9
+
10
+ * Fix formatting for Ruby 1.9.1.
11
+
12
+
1
13
  === 0.2.3 / 2009-12-17
2
14
 
3
15
  * Minor enhancements
data/lib/ghi.rb CHANGED
@@ -2,7 +2,7 @@ require "net/http"
2
2
  require "yaml"
3
3
 
4
4
  module GHI
5
- VERSION = "0.2.3"
5
+ VERSION = "0.2.4"
6
6
 
7
7
  class << self
8
8
  def login
data/lib/ghi/cli.rb CHANGED
@@ -90,7 +90,7 @@ module GHI::CLI #:nodoc:
90
90
  if verbosity
91
91
  issues.map { |i| ["=" * 79] + show_format(i) }
92
92
  else
93
- issues.map { |i| " #{i.number.to_s.rjust 3}: #{truncate i.title, 72}" }
93
+ issues.map { |i| " #{i.number.to_s.rjust 3}: #{truncate(i.title, 72)}" }
94
94
  end
95
95
  else
96
96
  "none"
@@ -119,13 +119,13 @@ module GHI::CLI #:nodoc:
119
119
 
120
120
  def show_format(issue, verbose = true)
121
121
  l = []
122
- l << " number: #{issue.number}" if issue.number
123
- l << " state: #{issue.state}" if issue.state
124
- l << " title: #{indent(issue.title, 15, 0)}" if issue.title
122
+ l << " number: #{issue.number}" if issue.number
123
+ l << " state: #{issue.state}" if issue.state
124
+ l << " title: #{indent(issue.title, 15, 0).join}" if issue.title
125
125
  l << " user: #{issue.user || GHI.login}"
126
- l << " votes: #{issue.votes}" if issue.votes
127
- l << " created at: #{issue.created_at}" if issue.created_at
128
- l << " updated at: #{issue.updated_at}" if issue.updated_at
126
+ l << " votes: #{issue.votes}" if issue.votes
127
+ l << " created at: #{issue.created_at}" if issue.created_at
128
+ l << " updated at: #{issue.updated_at}" if issue.updated_at
129
129
  return l unless verbose
130
130
  l << ""
131
131
  l += indent(issue.body)[0..-2]
@@ -133,7 +133,7 @@ module GHI::CLI #:nodoc:
133
133
 
134
134
  def action_format(value = nil)
135
135
  key = "#{action.to_s.capitalize.sub(/e?$/, "ed")} issue #{number}"
136
- "#{key}: #{truncate value.to_s, 78 - key.length}"
136
+ "#{key}: #{truncate(value.to_s, 78 - key.length)}"
137
137
  end
138
138
 
139
139
  def truncate(string, length)
@@ -370,7 +370,13 @@ module GHI::CLI #:nodoc:
370
370
  raise OptionParser::MissingArgument
371
371
  else
372
372
  repo = v.split "/"
373
- repo.unshift GHI.login if repo.length == 1
373
+ if repo.length == 1
374
+ if @repo && `git remote 2>/dev/null`[/^#{repo}$/]
375
+ repo << @repo
376
+ else
377
+ repo.unshift(GHI.login)
378
+ end
379
+ end
374
380
  @user, @repo = repo
375
381
  end
376
382
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ghi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Celis
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-07 00:00:00 -06:00
12
+ date: 2009-12-28 00:00:00 -06:00
13
13
  default_executable: ghi
14
14
  dependencies: []
15
15