| Class | Commands::Update |
| In: |
vendor/rails/railties/lib/commands/plugin.rb
|
| Parent: | Object |
# File vendor/rails/railties/lib/commands/plugin.rb, line 804
804: def initialize(base_command)
805: @base_command = base_command
806: end
# File vendor/rails/railties/lib/commands/plugin.rb, line 808
808: def options
809: OptionParser.new do |o|
810: o.set_summary_indent(' ')
811: o.banner = "Usage: #{@base_command.script_name} update [name [name]...]"
812: o.on( "-r REVISION", "--revision REVISION",
813: "Checks out the given revision from subversion.",
814: "Ignored if subversion is not used.") { |v| @revision = v }
815: o.define_head "Update plugins."
816: end
817: end
# File vendor/rails/railties/lib/commands/plugin.rb, line 819
819: def parse!(args)
820: options.parse!(args)
821: root = @base_command.environment.root
822: cd root
823: args = Dir["vendor/plugins/*"].map do |f|
824: File.directory?("#{f}/.svn") ? File.basename(f) : nil
825: end.compact if args.empty?
826: cd "vendor/plugins"
827: args.each do |name|
828: if File.directory?(name)
829: puts "Updating plugin: #{name}"
830: system("svn #{$verbose ? '' : '-q'} up \"#{name}\" #{@revision ? "-r #{@revision}" : ''}")
831: else
832: puts "Plugin doesn't exist: #{name}"
833: end
834: end
835: end