Parent

MiniMagick::CommandBuilder

Attributes

args[R]
command[R]

Public Class Methods

new(command, *options) click to toggle source
     # File lib/mini_magick.rb, line 446
446:     def initialize(command, *options)
447:       @command = command
448:       @args = []
449:       options.each { |arg| push(arg) }
450:     end

Public Instance Methods

+(*options) click to toggle source
     # File lib/mini_magick.rb, line 471
471:     def +(*options)
472:       push(@args.pop.gsub(/^-/, '+'))
473:       if options.any?
474:         options.each do |o|
475:           push escape_string(o)
476:         end
477:       end
478:     end
<<(arg) click to toggle source
Alias for: push
add_command(command, *options) click to toggle source
     # File lib/mini_magick.rb, line 480
480:     def add_command(command, *options)
481:       push "-#{command}"
482:       if options.any?
483:         options.each do |o|
484:           push escape_string(o)
485:         end
486:       end
487:     end
add_creation_operator(command, *options) click to toggle source
     # File lib/mini_magick.rb, line 493
493:     def add_creation_operator(command, *options)
494:       creation_command = command
495:       if options.any?
496:         options.each do |option|
497:           creation_command << ":#{option}"
498:         end
499:       end
500:       push creation_command
501:     end
command() click to toggle source
     # File lib/mini_magick.rb, line 452
452:     def command
453:       "#{MiniMagick.processor} #{@command} #{@args.join(' ')}".strip
454:     end
escape_string(value) click to toggle source
     # File lib/mini_magick.rb, line 489
489:     def escape_string(value)
490:       '"' + value + '"'
491:     end
method_missing(symbol, *options) click to toggle source
     # File lib/mini_magick.rb, line 456
456:     def method_missing(symbol, *options)
457:       guessed_command_name = symbol.to_s.gsub('_','-')
458:       if guessed_command_name == "format"
459:         raise Error, "You must call 'format' on the image object directly!"
460:       elsif MOGRIFY_COMMANDS.include?(guessed_command_name)
461:         add_command(guessed_command_name, *options)
462:         self
463:       elsif IMAGE_CREATION_OPERATORS.include?(guessed_command_name)
464:         add_creation_operator(guessed_command_name, *options)
465:         self
466:       else
467:         super(symbol, *args)
468:       end
469:     end
push(arg) click to toggle source
     # File lib/mini_magick.rb, line 503
503:     def push(arg)
504:       @args << arg.to_s.strip
505:     end
Also aliased as: <<

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.