Class | Commands::Update |
In: |
vendor/rails/railties/lib/commands/plugin.rb
|
Parent: | Object |
# File vendor/rails/railties/lib/commands/plugin.rb, line 777 777: def initialize(base_command) 778: @base_command = base_command 779: end
# File vendor/rails/railties/lib/commands/plugin.rb, line 781 781: def options 782: OptionParser.new do |o| 783: o.set_summary_indent(' ') 784: o.banner = "Usage: #{@base_command.script_name} update [name [name]...]" 785: o.on( "-r REVISION", "--revision REVISION", 786: "Checks out the given revision from subversion.", 787: "Ignored if subversion is not used.") { |v| @revision = v } 788: o.define_head "Update plugins." 789: end 790: end
# File vendor/rails/railties/lib/commands/plugin.rb, line 792 792: def parse!(args) 793: options.parse!(args) 794: root = @base_command.environment.root 795: cd root 796: args = Dir["vendor/plugins/*"].map do |f| 797: File.directory?("#{f}/.svn") ? File.basename(f) : nil 798: end.compact if args.empty? 799: cd "vendor/plugins" 800: args.each do |name| 801: if File.directory?(name) 802: puts "Updating plugin: #{name}" 803: system("svn #{$verbose ? '' : '-q'} up \"#{name}\" #{@revision ? "-r #{@revision}" : ''}") 804: else 805: puts "Plugin doesn't exist: #{name}" 806: end 807: end 808: end