method
execute
v2_5_5 -
Show latest stable
-
0 notes -
Class: QueryCommand
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
execute()
public
Hide source
# File lib/rubygems/commands/query_command.rb, line 80 def execute exit_code = 0 if options[:args].to_a.empty? and options[:name].source.empty? name = options[:name] no_name = true elsif !options[:name].source.empty? name = Array(options[:name]) else args = options[:args].to_a name = options[:exact] ? args.map{|arg| /\A#{Regexp.escape(arg)}\Z/ } : args.map{|arg| /#{arg}/ } end prerelease = options[:prerelease] unless options[:installed].nil? then if no_name then alert_error "You must specify a gem name" exit_code |= 4 elsif name.count > 1 alert_error "You must specify only ONE gem!" exit_code |= 4 else installed = installed? name.first, options[:version] installed = !installed unless options[:installed] if installed then say "true" else say "false" exit_code |= 1 end end terminate_interaction exit_code end names = Array(name) names.each { |n| show_gems n, prerelease } end