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.
- data/History.rdoc +7 -0
- data/lib/ghi/cli.rb +16 -5
- data/lib/ghi.rb +1 -1
- metadata +2 -2
data/History.rdoc
CHANGED
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
|
-
|
21
|
-
|
22
|
-
|
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
|
-
|
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
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.
|
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-
|
12
|
+
date: 2009-05-15 00:00:00 -07:00
|
13
13
|
default_executable: ghi
|
14
14
|
dependencies: []
|
15
15
|
|