Methods
Public Class methods
[ show source ]
# File railties/lib/commands/plugin.rb, line 822 822: def initialize(base_command) 823: @base_command = base_command 824: end
Public Instance methods
[ show source ]
# File railties/lib/commands/plugin.rb, line 826 826: def options 827: OptionParser.new do |o| 828: o.set_summary_indent(' ') 829: o.banner = "Usage: #{@base_command.script_name} update [name [name]...]" 830: o.on( "-r REVISION", "--revision REVISION", 831: "Checks out the given revision from subversion.", 832: "Ignored if subversion is not used.") { |v| @revision = v } 833: o.define_head "Update plugins." 834: end 835: end
[ show source ]
# File railties/lib/commands/plugin.rb, line 837 837: def parse!(args) 838: options.parse!(args) 839: root = @base_command.environment.root 840: cd root 841: args = Dir["vendor/plugins/*"].map do |f| 842: File.directory?("#{f}/.svn") ? File.basename(f) : nil 843: end.compact if args.empty? 844: cd "vendor/plugins" 845: args.each do |name| 846: if File.directory?(name) 847: puts "Updating plugin: #{name}" 848: system("svn #{$verbose ? '' : '-q'} up \"#{name}\" #{@revision ? "-r #{@revision}" : ''}") 849: else 850: puts "Plugin doesn't exist: #{name}" 851: end 852: end 853: end