GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Rubygem
Description: The official `github` command line helper for simplifying your GitHub experience.
Homepage: http://github.com
Clone URL: git://github.com/defunkt/github-gem.git
Pull out two helpers into the shared level

Enhance GitHub.load to load both per-bin and shared if both exist
kballard (author)
Mon Jul 21 15:51:22 -0700 2008
commit  d3c332224a578cc1e1bbe158a6bea64995e2036e
tree    4e508d8d9d1c9dcb98aa55c16c5f831d3738e202
parent  8f65ab563528676df3594d098fa457623fb04a8e
...
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
...
104
105
106
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -104,20 +104,3 @@ end
0
 helper :network_page_for do |user|
0
   "https://github.com/#{user}/#{project}/network"
0
 end
0
-
0
-helper :has_launchy? do |blk|
0
- begin
0
- gem 'launchy'
0
- require 'launchy'
0
- blk.call
0
- rescue Gem::LoadError
0
- STDERR.puts "Sorry, you need to install launchy: `gem install launchy`"
0
- end
0
-end
0
-
0
-helper :open do |url|
0
- has_launchy? proc {
0
- Launchy::Browser.new.visit url
0
- }
0
-end
0
-
...
108
109
110
 
111
112
113
 
 
 
 
 
 
 
 
 
114
115
116
...
108
109
110
111
112
 
 
113
114
115
116
117
118
119
120
121
122
123
124
0
@@ -108,9 +108,17 @@ module GitHub
0
     if file[0] == ?/
0
       path = file
0
     else
0
+ # if both exist, we want to load both
0
       path = BasePath + "/commands/#{command_name}/#{file}"
0
- unless File.exists?(path)
0
- path = BasePath + "/commands/#{file}"
0
+ path2 = BasePath + "/commands/#{file}"
0
+ if File.exists?(path)
0
+ if File.exists?(path2)
0
+ data = File.read(path)
0
+ GitHub.module_eval data, path
0
+ path = path2
0
+ end
0
+ else
0
+ path = path2
0
       end
0
     end
0
     data = File.read(path)

Comments

    No one has commented yet.