nex3-github 0.1.2 → 0.1.3
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/Manifest +7 -7
- data/README +1 -0
- data/commands/commands.rb +57 -28
- data/commands/helpers.rb +36 -28
- data/lib/extensions.rb +28 -0
- data/lib/github.rb +41 -13
- data/lib/github/command.rb +1 -3
- data/spec/command_spec.rb +66 -0
- data/spec/extensions_spec.rb +34 -0
- data/spec/github_spec.rb +51 -0
- data/spec/helper_spec.rb +188 -0
- data/spec/spec_helper.rb +128 -4
- data/spec/ui_spec.rb +406 -0
- data/spec/windoze_spec.rb +36 -0
- metadata +21 -12
- data/spec/helpers/owner_spec.rb +0 -12
- data/spec/helpers/project_spec.rb +0 -24
- data/spec/helpers/public_url_for_spec.rb +0 -12
- data/spec/helpers/repo_for_spec.rb +0 -12
- data/spec/helpers/user_and_repo_from_spec.rb +0 -37
- data/spec/helpers/user_for_spec.rb +0 -12
@@ -0,0 +1,36 @@
|
|
1
|
+
# this is an extremely hacky spec
|
2
|
+
# intended purely to test the Windoze-specific code
|
3
|
+
|
4
|
+
require 'rubygems'
|
5
|
+
require 'spec'
|
6
|
+
|
7
|
+
describe "github/command.rb" do
|
8
|
+
before(:all) do
|
9
|
+
@orig_platform = RUBY_PLATFORM
|
10
|
+
Object.send :remove_const, :RUBY_PLATFORM
|
11
|
+
Object.const_set :RUBY_PLATFORM, "mswin"
|
12
|
+
end
|
13
|
+
|
14
|
+
after(:all) do
|
15
|
+
Object.send :remove_const, :RUBY_PLATFORM
|
16
|
+
Object.const_set :RUBY_PLATFORM, @orig_platform
|
17
|
+
end
|
18
|
+
|
19
|
+
before(:each) do
|
20
|
+
@filename = File.dirname(__FILE__) + "/../lib/github/command.rb"
|
21
|
+
@data = File.read(@filename)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should require win32/open3 under Windows" do
|
25
|
+
mod = Module.new
|
26
|
+
mod.should_receive(:require).with("win32/open3")
|
27
|
+
mod.class_eval @data, @filename
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should blow up if win32/open3 isn't present under Windows" do
|
31
|
+
mod = Module.new
|
32
|
+
mod.should_receive(:require).with("win32/open3").and_return { raise LoadError }
|
33
|
+
mod.should_receive(:warn).with("You must 'gem install win32-open3' to use the github command on Windows")
|
34
|
+
lambda { mod.class_eval @data, @filename }.should raise_error(SystemExit)
|
35
|
+
end
|
36
|
+
end
|
metadata
CHANGED
@@ -1,18 +1,26 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nex3-github
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Chris Wanstrath
|
7
|
+
- Chris Wanstrath, Kevin Ballard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-05-
|
12
|
+
date: 2008-05-18 00:00:00 -07:00
|
13
13
|
default_executable: github
|
14
|
-
dependencies:
|
15
|
-
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: launchy
|
17
|
+
version_requirement:
|
18
|
+
version_requirements: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: "0"
|
23
|
+
version:
|
16
24
|
description: The official `github` command line helper for simplifying your GitHub experience.
|
17
25
|
email: chris@ozmm.org
|
18
26
|
executables:
|
@@ -21,6 +29,7 @@ extensions: []
|
|
21
29
|
|
22
30
|
extra_rdoc_files:
|
23
31
|
- bin/github
|
32
|
+
- lib/extensions.rb
|
24
33
|
- lib/github/command.rb
|
25
34
|
- lib/github/helper.rb
|
26
35
|
- lib/github.rb
|
@@ -30,20 +39,20 @@ files:
|
|
30
39
|
- bin/github
|
31
40
|
- commands/commands.rb
|
32
41
|
- commands/helpers.rb
|
42
|
+
- lib/extensions.rb
|
33
43
|
- lib/github/command.rb
|
34
44
|
- lib/github/helper.rb
|
35
45
|
- lib/github.rb
|
36
46
|
- LICENSE
|
47
|
+
- Manifest
|
37
48
|
- README
|
38
49
|
- spec/command_spec.rb
|
39
|
-
- spec/
|
40
|
-
- spec/
|
41
|
-
- spec/
|
42
|
-
- spec/helpers/repo_for_spec.rb
|
43
|
-
- spec/helpers/user_and_repo_from_spec.rb
|
44
|
-
- spec/helpers/user_for_spec.rb
|
50
|
+
- spec/extensions_spec.rb
|
51
|
+
- spec/github_spec.rb
|
52
|
+
- spec/helper_spec.rb
|
45
53
|
- spec/spec_helper.rb
|
46
|
-
-
|
54
|
+
- spec/ui_spec.rb
|
55
|
+
- spec/windoze_spec.rb
|
47
56
|
- github.gemspec
|
48
57
|
has_rdoc: true
|
49
58
|
homepage: http://github.com/
|
data/spec/helpers/owner_spec.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
describe "The owner helper" do
|
4
|
-
before(:each) do
|
5
|
-
@helper = GitHub::Helper.new
|
6
|
-
end
|
7
|
-
|
8
|
-
it "should return hacker" do
|
9
|
-
@helper.should_receive(:url_for).with(:origin).and_return("git://github.com/hacker/project.git")
|
10
|
-
@helper.owner.should == "hacker"
|
11
|
-
end
|
12
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
describe "The project helper" do
|
4
|
-
before(:each) do
|
5
|
-
@helper = GitHub::Helper.new
|
6
|
-
end
|
7
|
-
|
8
|
-
it "should return project-awesome" do
|
9
|
-
@helper.should_receive(:url_for).with(:origin).and_return("git://github.com/user/project-awesome.git")
|
10
|
-
@helper.project.should == "project-awesome"
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should exit due to missing origin" do
|
14
|
-
@helper.should_receive(:url_for).twice.with(:origin).and_return("")
|
15
|
-
STDERR.should_receive(:puts).with("Error: missing remote 'origin'")
|
16
|
-
lambda { @helper.project }.should raise_error(SystemExit)
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should exit due to non-github origin" do
|
20
|
-
@helper.should_receive(:url_for).twice.with(:origin).and_return("home:path/to/repo.git")
|
21
|
-
STDERR.should_receive(:puts).with("Error: remote 'origin' is not a github URL")
|
22
|
-
lambda { @helper.project }.should raise_error(SystemExit)
|
23
|
-
end
|
24
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
describe "The public_url_for helper" do
|
4
|
-
before(:each) do
|
5
|
-
@helper = GitHub::Helper.new
|
6
|
-
end
|
7
|
-
|
8
|
-
it "should return git://github.com/wycats/merb-core.git" do
|
9
|
-
@helper.should_receive(:url_for).with(:origin).and_return("git://github.com/user/merb-core.git")
|
10
|
-
@helper.public_url_for("wycats").should == "git://github.com/wycats/merb-core.git"
|
11
|
-
end
|
12
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
describe "The repo_for helper" do
|
4
|
-
before(:each) do
|
5
|
-
@helper = GitHub::Helper.new
|
6
|
-
end
|
7
|
-
|
8
|
-
it "should return mephisto.git" do
|
9
|
-
@helper.should_receive(:url_for).with("mojombo").and_return("git@github.com:mojombo/mephisto.git")
|
10
|
-
@helper.repo_for("mojombo").should == "mephisto.git"
|
11
|
-
end
|
12
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
describe "The user_and_repo_from helper" do
|
4
|
-
before(:each) do
|
5
|
-
@helper = GitHub::Helper.new
|
6
|
-
end
|
7
|
-
|
8
|
-
it "should parse a git:// url" do
|
9
|
-
@helper.user_and_repo_from("git://github.com/defunkt/github.git").should == ["defunkt", "github.git"]
|
10
|
-
end
|
11
|
-
|
12
|
-
it "should parse a ssh-based url" do
|
13
|
-
@helper.user_and_repo_from("git@github.com:mojombo/god.git").should == ["mojombo", "god.git"]
|
14
|
-
end
|
15
|
-
|
16
|
-
it "should parse a non-standard ssh-based url" do
|
17
|
-
@helper.user_and_repo_from("ssh://git@github.com:mojombo/god.git").should == ["mojombo", "god.git"]
|
18
|
-
@helper.user_and_repo_from("github.com:mojombo/god.git").should == ["mojombo", "god.git"]
|
19
|
-
@helper.user_and_repo_from("ssh://github.com:mojombo/god.git").should == ["mojombo", "god.git"]
|
20
|
-
end
|
21
|
-
|
22
|
-
it "should return nothing for other urls" do
|
23
|
-
@helper.user_and_repo_from("home:path/to/repo.git").should == ['', '']
|
24
|
-
end
|
25
|
-
|
26
|
-
it "should return nothing for invalid git:// urls" do
|
27
|
-
@helper.user_and_repo_from("git://github.com/foo").should == ['', '']
|
28
|
-
end
|
29
|
-
|
30
|
-
it "should return nothing for invalid ssh-based urls" do
|
31
|
-
@helper.user_and_repo_from("git@github.com:kballard").should == ['', '']
|
32
|
-
@helper.user_and_repo_from("git@github.com:kballard/test/repo.git").should == ['', '']
|
33
|
-
@helper.user_and_repo_from("ssh://git@github.com:kballard").should == ['', '']
|
34
|
-
@helper.user_and_repo_from("github.com:kballard").should == ['', '']
|
35
|
-
@helper.user_and_repo_from("ssh://github.com:kballard").should == ['', '']
|
36
|
-
end
|
37
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
describe "The user_for helper" do
|
4
|
-
before(:each) do
|
5
|
-
@helper = GitHub::Helper.new
|
6
|
-
end
|
7
|
-
|
8
|
-
it "should return defunkt" do
|
9
|
-
@helper.should_receive(:url_for).with("origin").and_return("git@github.com:defunkt/project.git")
|
10
|
-
@helper.user_for("origin").should == "defunkt"
|
11
|
-
end
|
12
|
-
end
|