ghi 0.2.0 → 0.2.1
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.
- data/History.rdoc +7 -0
- data/README.rdoc +1 -1
- data/lib/ghi/cli.rb +2 -2
- data/spec/ghi/cli_spec.rb +12 -3
- metadata +2 -2
data/History.rdoc
CHANGED
data/README.rdoc
CHANGED
data/lib/ghi/cli.rb
CHANGED
@@ -157,8 +157,8 @@ module GHI::CLI #:nodoc:
|
|
157
157
|
|
158
158
|
def puts(*args)
|
159
159
|
args = args.flatten.each { |arg|
|
160
|
-
arg.gsub!(/\
|
161
|
-
arg.gsub!(/\
|
160
|
+
arg.gsub!(/\b\*(.+)\*\b/) { "\e[1m#$1\e[0m" } # Bold
|
161
|
+
arg.gsub!(/\b_(.+)_\b/) { "\e[4m#$1\e[0m" } # Underline
|
162
162
|
arg.gsub!(/(state:)?(# Open.*| open)$/) { "#$1\e[32m#$2\e[0m" }
|
163
163
|
arg.gsub!(/(state:)?(# Closed.*| closed)$/) { "#$1\e[31m#$2\e[0m" }
|
164
164
|
marked = [GHI.login, search_term, tag, "(?:#|gh)-\d+"].compact * "|"
|
data/spec/ghi/cli_spec.rb
CHANGED
@@ -13,14 +13,14 @@ describe GHI::CLI::Executable do
|
|
13
13
|
describe "parsing" do
|
14
14
|
describe "with well-formed arguments" do
|
15
15
|
before :each do
|
16
|
-
@user, @repo = "
|
16
|
+
@user, @repo = "local_user_host", "ghi"
|
17
17
|
@action = @state = @number = @term =
|
18
18
|
@title = @body = @tag = @comment = nil
|
19
19
|
end
|
20
20
|
|
21
21
|
after :each do
|
22
22
|
@cli.should_receive(@action)
|
23
|
-
@cli.parse! @args
|
23
|
+
@cli.parse! Array(@args)
|
24
24
|
@cli.action.should == @action
|
25
25
|
@cli.state.should == (@state || :open)
|
26
26
|
@cli.number.should == @number
|
@@ -44,7 +44,16 @@ describe GHI::CLI::Executable do
|
|
44
44
|
|
45
45
|
describe "inside a repository" do
|
46
46
|
after :each do
|
47
|
-
@cli.stub!(:`).and_return "stub@github.com
|
47
|
+
@cli.stub!(:`).and_return "stub@github.com:#@user/#@repo.git"
|
48
|
+
end
|
49
|
+
|
50
|
+
it "should parse empty as list open" do
|
51
|
+
@action, @state = :list, :open
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should parse -l as list open" do
|
55
|
+
@args = ["-l"]
|
56
|
+
@action, @state = :list, :open
|
48
57
|
end
|
49
58
|
|
50
59
|
it "should parse -l as list open" do
|
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.
|
4
|
+
version: 0.2.1
|
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-11-
|
12
|
+
date: 2009-11-29 00:00:00 -05:00
|
13
13
|
default_executable: ghi
|
14
14
|
dependencies: []
|
15
15
|
|