stephencelis-ghi 0.1.3 → 0.1.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 +7 -0
  2. data/lib/ghi/cli.rb +16 -5
  3. data/lib/ghi.rb +1 -1
  4. metadata +2 -2
data/History.rdoc CHANGED
@@ -1,3 +1,10 @@
1
+ === 0.1.4 / 2009-05-15
2
+
3
+ * 1 minor enhancement
4
+
5
+ * Minor Windows support.
6
+
7
+
1
8
  === 0.1.3 / 2009-05-08
2
9
 
3
10
  * 1 minor enhancement
data/lib/ghi/cli.rb CHANGED
@@ -17,11 +17,17 @@ module GHI::CLI #:nodoc:
17
17
  end
18
18
 
19
19
  def gets_from_editor(issue)
20
- unless in_repo?
21
- Tempfile.open message_filename, &file_proc(issue)
22
- else
20
+ if windows?
21
+ warn "Please supply the message by using the -m option"
22
+ exit 1
23
+ end
24
+
25
+ if in_repo?
23
26
  File.open message_path, "a+", &file_proc(issue)
27
+ else
28
+ Tempfile.open message_filename, &file_proc(issue)
24
29
  end
30
+
25
31
  return @message if comment?
26
32
  return @message.shift.strip, @message.join.sub(/\b\n\b/, " ").strip
27
33
  end
@@ -166,7 +172,7 @@ module GHI::CLI #:nodoc:
166
172
 
167
173
  def colorize?
168
174
  return @colorize if defined? @colorize
169
- @colorize = if $stdout.isatty
175
+ @colorize = if $stdout.isatty && !windows?
170
176
  !`git config --get-regexp color`.chomp.empty?
171
177
  else
172
178
  false
@@ -185,6 +191,10 @@ module GHI::CLI #:nodoc:
185
191
  pagers = [ENV["GHI_PAGER"], "less -EMRX", "pager", "more"].compact.uniq
186
192
  pagers.each { |pager| return @pager = IO.popen(pager, "w") rescue nil }
187
193
  end
194
+
195
+ def windows?
196
+ RUBY_PLATFORM.include?("mswin")
197
+ end
188
198
  end
189
199
 
190
200
  class Executable
@@ -196,7 +206,8 @@ module GHI::CLI #:nodoc:
196
206
  def parse!(*argv)
197
207
  @args = argv
198
208
 
199
- `git config --get remote.origin.url`.match %r{([^:/]+)/([^/]+).git$}
209
+ repo_expression = %r{([^:/]+)/([^/\.\s]+)(?:\.git)?$}
210
+ `git config --get remote.origin.url`.match repo_expression
200
211
  @user, @repo = $1, $2
201
212
 
202
213
  option_parser.parse!(*args)
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.1.3"
5
+ VERSION = "0.1.4"
6
6
 
7
7
  def self.login
8
8
  return @login if defined? @login
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stephencelis-ghi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.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-05-08 00:00:00 -07:00
12
+ date: 2009-05-15 00:00:00 -07:00
13
13
  default_executable: ghi
14
14
  dependencies: []
15
15