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