Revisions

gist: 214954 Download_button fork
public
Public Clone URL: git://gist.github.com/214954.git
Embed All Files: show embed
plugin.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
    def install_using_git(options = {})
      root = rails_env.root
      install_path = mkdir_p "#{root}/vendor/plugins/#{name}"
      base_cmd = "git clone #{uri}"
      base_cmd += " -q" if options[:quiet] and not $verbose
      base_cmd += " #{options[:revision]}" if options[:revision]
      base_cmd += " #{install_path}"
      if system(base_cmd)
        puts "removing: .git .gitignore" if $verbose
        rm_rf %W(#{install_path}/.git #{install_path}/.gitignore)
      else
        rm_rf install_path
      end
    end