Changeset 9049
- Timestamp:
- 03/17/08 21:44:16 (2 months ago)
- Files:
-
- trunk/railties/CHANGELOG (modified) (1 diff)
- trunk/railties/lib/commands/plugin.rb (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/railties/CHANGELOG
r9017 r9049 1 1 *SVN* 2 3 * Added support for installing plugins hosted at git repositories #11294 [danger] 2 4 3 5 * Fixed that script/generate would not look for plugin generators in plugin_paths #11000 [glv] trunk/railties/lib/commands/plugin.rb
r8921 r9049 163 163 end 164 164 165 def git_url? 166 @uri =~ /^git:\/\// || @url =~ /\.git$/ 167 end 168 165 169 def installed? 166 170 File.directory?("#{rails_env.root}/vendor/plugins/#{name}") \ … … 170 174 def install(method=nil, options = {}) 171 175 method ||= rails_env.best_install_method? 172 method = :export if method == :http and svn_url? 176 if :http == method 177 method = :export if svn_url? 178 method = :clone if git_url? 179 end 173 180 174 181 uninstall if installed? and options[:force] … … 248 255 end 249 256 end 257 258 def install_using_clone(options = {}) 259 git_command :clone, options 260 end 250 261 251 262 def svn_command(cmd, options = {}) … … 258 269 system(base_cmd) 259 270 end 271 272 def git_command(cmd, options = {}) 273 root = rails_env.root 274 mkdir_p "#{root}/vendor/plugins" 275 base_cmd = "git #{cmd} --depth 1 #{uri} \"#{root}/vendor/plugins/#{name}\"" 276 puts base_cmd if $verbose 277 puts "removing: #{root}/vendor/plugins/#{name}/.git" 278 system(base_cmd) 279 rm_rf "#{root}/vendor/plugins/#{name}/.git" 280 end 260 281 261 282 def guess_name(url) … … 264 285 @name = File.basename(File.dirname(url)) 265 286 end 287 @name.gsub!(/\.git$/, '') if @name =~ /\.git$/ 266 288 end 267 289 … … 448 470 o.separator " Install a plugin from a subversion URL:" 449 471 o.separator " #{@script_name} install http://dev.rubyonrails.com/svn/rails/plugins/continuous_builder\n" 472 o.separator " Install a plugin from a git URL:" 473 o.separator " #{@script_name} install git://github.com/SomeGuy/my_awesome_plugin.git\n" 450 474 o.separator " Install a plugin and add a svn:externals entry to vendor/plugins" 451 475 o.separator " #{@script_name} install -x continuous_builder\n"