Sha256: f88b5c5eccd3d5c2d69477b6f2aec508ab9c093e370462b3dea55e600acf16bb

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

# frozen_string_literal: true

class Shoes
  module DSL
    module Media
      def image(*args, &blk)
        if blk
          raise Shoes::NotImplementedError,
                'Sorry image does not support the block form in Shoes 4!' \
                ' Check out github issue #1309 for any changes/updates or if you' \
                ' want to help :)'
        else
          opts = style_normalizer.normalize pop_style(args)
          path, *leftovers = args

          message = <<~EOS
            Wrong number of arguments. Must be:
              - image(path, [opts])
EOS
          raise ArgumentError, message if leftovers.any?

          create Shoes::Image, path, opts
        end
      end

      def video(*_args)
        raise Shoes::NotImplementedError,
              'Sorry video support has been cut from shoes 4!' \
              ' Check out github issue #113 for any changes/updates or if you' \
              ' want to help :)'
      end

      # similar controls as Shoes::Video (#video)
      def sound(soundfile, opts = {}, &blk)
        Shoes::Sound.new @__app__, soundfile, opts, &blk
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shoes-core-4.0.0.rc1 lib/shoes/dsl/media.rb