Sha256: 463d87bc7f7d5ed71cb42907e640c6d37419c8dd78c03a63c483c9466d8b6a68

Contents?: true

Size: 1.3 KB

Versions: 14

Compression:

Stored size: 1.3 KB

Contents

require 'mini_magick/version'
require 'mini_magick/configuration'

module MiniMagick

  extend MiniMagick::Configuration

  ##
  # You might want to execute only certain blocks of processing with a
  # different CLI, because for example that CLI does that particular thing
  # faster. After the block CLI resets to its previous value.
  #
  # @example
  #   MiniMagick.with_cli :graphicsmagick do
  #     # operations that are better done with GraphicsMagick
  #   end
  def self.with_cli(cli)
    old_cli = self.cli
    self.cli = cli
    yield
  ensure
    self.cli = old_cli
  end

  ##
  # Checks whether the CLI used is ImageMagick.
  #
  # @return [Boolean]
  def self.imagemagick?
    cli == :imagemagick
  end

  ##
  # Checks whether the CLI used is ImageMagick 7.
  #
  # @return [Boolean]
  def self.imagemagick7?
    cli == :imagemagick7
  end

  ##
  # Checks whether the CLI used is GraphicsMagick.
  #
  # @return [Boolean]
  def self.graphicsmagick?
    cli == :graphicsmagick
  end

  ##
  # Returns ImageMagick's/GraphicsMagick's version.
  #
  # @return [String]
  def self.cli_version
    output = MiniMagick::Tool::Identify.new(&:version)
    output[/\d+\.\d+\.\d+(-\d+)?/]
  end

  class Error < RuntimeError; end
  class Invalid < StandardError; end

end

require 'mini_magick/tool'
require 'mini_magick/image'

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/mini_magick-4.13.1/lib/mini_magick.rb
mini_magick-4.13.2 lib/mini_magick.rb
mini_magick-4.13.1 lib/mini_magick.rb
mini_magick-4.13.0 lib/mini_magick.rb
mini_magick-4.12.0 lib/mini_magick.rb
mini_magick-4.11.0 lib/mini_magick.rb
mini_magick-4.10.1 lib/mini_magick.rb
mini_magick-4.10.0 lib/mini_magick.rb
mini_magick-4.9.5 lib/mini_magick.rb
mini_magick-4.9.4 lib/mini_magick.rb
mini_magick-4.9.3 lib/mini_magick.rb
mini_magick-4.9.2 lib/mini_magick.rb
mini_magick-4.9.1 lib/mini_magick.rb
mini_magick-4.9.0 lib/mini_magick.rb