Sha256: 4b26501c6b339fe8e563618451db5a881ce2657446145ddd31aa0a1eaa0a899d

Contents?: true

Size: 422 Bytes

Versions: 3

Compression:

Stored size: 422 Bytes

Contents

Module.class_exec do
  def eigenclass
    @eigenclass ||= class << self; self; end
  end

  def deprecate(name, replacement, version)
    old_name = :"#{name}_without_deprecation"
    alias_method old_name, name

    define_method(name) do |*args, &blk|
      warn "ShellMock: ##{name} is deprecated and will be removed by #{version}. Please use #{replacement} instead."
      send old_name, *args, &blk
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
shell_mock-0.7.2 lib/shell_mock/core_ext/module.rb
shell_mock-0.7.1 lib/shell_mock/core_ext/module.rb
shell_mock-0.7.0 lib/shell_mock/core_ext/module.rb