ghs 0.1.1 → 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.
Files changed (5) hide show
  1. data/bin/ghs +11 -6
  2. metadata +15 -24
  3. data/README.markdown +0 -37
  4. data/Rakefile +0 -2
  5. data/ghs.gemspec +0 -24
data/bin/ghs CHANGED
@@ -20,7 +20,7 @@ end
20
20
 
21
21
  if ARGV.length < 1
22
22
  STDERR.puts "#{$0}: You need to specify a repo to search for."
23
- raise SystemExit
23
+ exit
24
24
  end
25
25
 
26
26
  repo = ARGV[0]
@@ -31,11 +31,16 @@ results = YAML.load(search) # y is now a hash containing the yaml data.
31
31
 
32
32
  if results["repositories"].length > 1 && !app['best']
33
33
  STDERR.puts "#{$0}: Multiple repos found, not sure which one you wanted.\nTo let me make the choice, rerun with the --best flag."
34
- raise SystemExit
34
+ exit
35
35
  end
36
36
 
37
- repo_name = results["repositories"][0]["name"]
38
- username = results["repositories"][0]["username"]
37
+ repo_name = results["repositories"][0]["name"] || results["repositories"][0][:name]
38
+ username = results["repositories"][0]["username"] || results["repositories"][0][:username]
39
+
40
+ unless repo_name && username
41
+ STDERR.puts "#{$0}: Couldn't find the url."
42
+ exit
43
+ end
39
44
 
40
45
  # STEP 2: Get the correct url
41
46
  show = open("http://github.com/api/v2/yaml/repos/show/#{username}/#{repo_name}").read
@@ -44,7 +49,7 @@ url = repo_info["repository"][:url]
44
49
 
45
50
  if !url
46
51
  STDERR.puts "#{$0}: Couldn't find the url."
47
- raise SystemExit
52
+ exit
48
53
  end
49
54
 
50
55
  STDERR.puts "
@@ -56,4 +61,4 @@ Description: #{repo_info["repository"][:description]}
56
61
  ==
57
62
  "
58
63
 
59
- puts "#{url}.git"
64
+ puts "#{url}.git"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ghs
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Aditya Bhargava
@@ -15,35 +15,27 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-30 00:00:00 -07:00
18
+ date: 2012-02-01 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
22
22
  description: Find the clone url for repos on Github
23
- email: aditya@wefoundland.com
23
+ email: bluemangroupie@gmail.com
24
24
  executables:
25
25
  - ghs
26
26
  extensions: []
27
27
 
28
- extra_rdoc_files:
29
- - README.markdown
28
+ extra_rdoc_files: []
29
+
30
30
  files:
31
- - README.markdown
32
- - Rakefile
33
31
  - bin/ghs
34
- - ghs.gemspec
35
32
  has_rdoc: true
36
- homepage: http://github.com/egonSchiele/Github-Repo-Search
33
+ homepage: https://github.com/egonSchiele/Github-Repo-Search
37
34
  licenses: []
38
35
 
39
36
  post_install_message:
40
- rdoc_options:
41
- - --line-numbers
42
- - --inline-source
43
- - --title
44
- - Ghs
45
- - --main
46
- - README.markdown
37
+ rdoc_options: []
38
+
47
39
  require_paths:
48
40
  - lib
49
41
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -60,17 +52,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
52
  requirements:
61
53
  - - ">="
62
54
  - !ruby/object:Gem::Version
63
- hash: 11
55
+ hash: 3
64
56
  segments:
65
- - 1
66
- - 2
67
- version: "1.2"
57
+ - 0
58
+ version: "0"
68
59
  requirements: []
69
60
 
70
- rubyforge_project: ghs
61
+ rubyforge_project:
71
62
  rubygems_version: 1.3.7
72
63
  signing_key:
73
- specification_version: 2
64
+ specification_version: 3
74
65
  summary: Find the clone url for repos on Github
75
66
  test_files: []
76
67
 
@@ -1,37 +0,0 @@
1
- Github Repo Search (ghs)
2
- ========================
3
-
4
- A script for the truly lazy github devs, ghs quickly finds clone urls for repositories.
5
-
6
- Cloning the rails repo, the old way:
7
-
8
- 1. Open a browser
9
- 2. Google "Rails github"
10
- 3. Go to the Rails github page
11
- 4. Copy the url
12
- 5. Open a terminal
13
- 6. Paste in the url
14
-
15
- Vs. the new way, using ghs:
16
- $ git clone `ghs -b rails`
17
-
18
-
19
- Getting ghs
20
- -----------
21
-
22
- $ gem install ghs
23
-
24
-
25
- Usage
26
- -----
27
-
28
- Get a repo's clone url:
29
-
30
- $ ghs [repo name]
31
-
32
- If there are multiple matches, ghs will stop by default.
33
- To choose the best match, use either of these:
34
-
35
- $ ghs -b [reponame]
36
- $ ghs --best [reponame]
37
-
data/Rakefile DELETED
@@ -1,2 +0,0 @@
1
- require 'rake'
2
- require 'rake/clean'
@@ -1,24 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- Gem::Specification.new do |s|
4
- s.name = %q{ghs}
5
- s.version = "0.1.1"
6
-
7
- s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Aditya Bhargava"]
9
- s.date = %q{2010-09-30}
10
- s.description = %q{Find the clone url for repos on Github}
11
- s.email = %q{aditya@wefoundland.com}
12
- s.extra_rdoc_files = ["README.markdown"]
13
- s.files = ["README.markdown", "Rakefile", "bin/ghs", "ghs.gemspec"]
14
- s.executables = ["ghs"]
15
- s.homepage = %q{http://github.com/egonSchiele/Github-Repo-Search}
16
- s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Ghs", "--main", "README.markdown"]
17
- s.rubyforge_project = %q{ghs}
18
- s.rubygems_version = %q{1.3.1}
19
- s.summary = %q{Find the clone url for repos on Github}
20
-
21
- if s.respond_to? :specification_version then
22
- s.specification_version = 2
23
- end
24
- end