ghi 0.3.1 → 0.9.0.dev
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/bin/ghi +2 -4
- data/lib/ghi.rb +112 -42
- data/lib/ghi/authorization.rb +71 -0
- data/lib/ghi/client.rb +126 -0
- data/lib/ghi/commands.rb +20 -0
- data/lib/ghi/commands/assign.rb +53 -0
- data/lib/ghi/commands/close.rb +45 -0
- data/lib/ghi/commands/command.rb +114 -0
- data/lib/ghi/commands/comment.rb +104 -0
- data/lib/ghi/commands/config.rb +35 -0
- data/lib/ghi/commands/edit.rb +49 -0
- data/lib/ghi/commands/help.rb +62 -0
- data/lib/ghi/commands/label.rb +153 -0
- data/lib/ghi/commands/list.rb +133 -0
- data/lib/ghi/commands/milestone.rb +150 -0
- data/lib/ghi/commands/open.rb +69 -0
- data/lib/ghi/commands/show.rb +21 -0
- data/lib/ghi/commands/version.rb +16 -0
- data/lib/ghi/formatting.rb +301 -0
- data/lib/ghi/formatting/colors.rb +295 -0
- data/lib/ghi/json.rb +1304 -0
- metadata +71 -49
- data/README.rdoc +0 -126
- data/lib/ghi/api.rb +0 -145
- data/lib/ghi/cli.rb +0 -657
- data/lib/ghi/issue.rb +0 -30
- data/spec/ghi/api_spec.rb +0 -218
- data/spec/ghi/cli_spec.rb +0 -267
- data/spec/ghi/issue_spec.rb +0 -26
- data/spec/ghi_spec.rb +0 -62
data/spec/ghi/issue_spec.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
require "ghi"
|
2
|
-
require "ghi/issue"
|
3
|
-
|
4
|
-
describe GHI::Issue do
|
5
|
-
before :each do
|
6
|
-
@now = Time.now
|
7
|
-
@issue = GHI::Issue.new "number" => 1,
|
8
|
-
"state" => "open",
|
9
|
-
"title" => "new issue",
|
10
|
-
"user" => "schacon",
|
11
|
-
"votes" => 0,
|
12
|
-
"created_at" => @now,
|
13
|
-
"updated_at" => @now,
|
14
|
-
"body" => "my sweet, sweet issue"
|
15
|
-
end
|
16
|
-
|
17
|
-
it "should read all keys" do
|
18
|
-
@issue.number.should == 1
|
19
|
-
@issue.state.should == "open"
|
20
|
-
@issue.title.should == "new issue"
|
21
|
-
@issue.user.should == "schacon"
|
22
|
-
@issue.votes.should == 0
|
23
|
-
@issue.created_at.should == @now
|
24
|
-
@issue.updated_at.should == @now
|
25
|
-
end
|
26
|
-
end
|
data/spec/ghi_spec.rb
DELETED
@@ -1,62 +0,0 @@
|
|
1
|
-
require "ghi"
|
2
|
-
|
3
|
-
LOGGED_OUT_YAML = <<-YAML
|
4
|
-
---
|
5
|
-
user:
|
6
|
-
id: 23
|
7
|
-
login: defunkt
|
8
|
-
name: Kristopher Walken Wanstrath
|
9
|
-
company: LA
|
10
|
-
location: SF
|
11
|
-
email: me@email.com
|
12
|
-
blog: http://myblog.com
|
13
|
-
following_count: 13
|
14
|
-
followers_count: 63
|
15
|
-
public_gist_count: 0
|
16
|
-
public_repo_count: 2
|
17
|
-
YAML
|
18
|
-
|
19
|
-
LOGGED_IN_YAML = <<-YAML
|
20
|
-
---
|
21
|
-
user:
|
22
|
-
id: 23
|
23
|
-
login: defunkt
|
24
|
-
name: Kristopher Walken Wanstrath
|
25
|
-
company: LA
|
26
|
-
location: SF
|
27
|
-
email: me@email.com
|
28
|
-
blog: http://myblog.com
|
29
|
-
following_count: 13
|
30
|
-
followers_count: 63
|
31
|
-
public_gist_count: 0
|
32
|
-
public_repo_count: 2
|
33
|
-
total_private_repo_count: 1
|
34
|
-
collaborators: 3
|
35
|
-
disk_usage: 50384
|
36
|
-
owned_private_repo_count: 1
|
37
|
-
private_gist_count: 0
|
38
|
-
plan:
|
39
|
-
name: mega
|
40
|
-
collaborators: 60
|
41
|
-
space: 20971520
|
42
|
-
private_repos: 125
|
43
|
-
YAML
|
44
|
-
|
45
|
-
describe GHI do
|
46
|
-
before :each do
|
47
|
-
GHI.instance_eval do
|
48
|
-
remove_instance_variable :@login if instance_variable_defined? :@login
|
49
|
-
remove_instance_variable :@token if instance_variable_defined? :@token
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
it "should return login" do
|
54
|
-
GHI.should_receive(:`).once.and_return "stephencelis\n"
|
55
|
-
GHI.login.should == "stephencelis"
|
56
|
-
end
|
57
|
-
|
58
|
-
it "should return token" do
|
59
|
-
GHI.should_receive(:`).once.and_return "da39a3ee5e6b4b0d3255bfef95601890\n"
|
60
|
-
GHI.token.should == "da39a3ee5e6b4b0d3255bfef95601890"
|
61
|
-
end
|
62
|
-
end
|