Sha256: a554e92f6b38b3c3fcc03552d934ae0e51f2098ded56835e1deda692ab0babf3

Contents?: true

Size: 1.05 KB

Versions: 2

Compression:

Stored size: 1.05 KB

Contents

module SiteHook
  class Deprecation
    attr_reader :instructions
    def initialize(message, situation, instructions)
      @str = "▼▼▼ [#{Paint['DEPRECATION ERROR', :red, :bold]}] —— The following situation is deprecated! ▼▼▼"
      @situation = situation
      @str << "\n#{@situation}"
      @instructions = instructions
      @str << "\n#{@instructions}"
    end
    def self.deprecate(situation, instructions, continue)
      puts @str if @str
      return continue
    end
  end
  class NotImplemented
    attr_reader :command_object

    def initialize(command)
      @command_object = command
      @exe_name = @command_object.parent.parent.exe_name
      @output_string = "Command `#{@exe_name} #{command.name_for_help.join(' ')}"
    end
    def self.declare(command)
      instance = self.new(command)
      instance.instance_variable_set(
          :'@output_string',
          "#{instance.instance_variable_get(:'@output_string')}` is not implemented currently")
      puts instance.instance_variable_get(:'@output_string')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
site_hook-0.8.2 lib/site_hook/deprecate.rb
site_hook-0.8.1 lib/site_hook/deprecate.rb