Displays deprecation message to the user. Each message is printed once.
# File lib/github_api/deprecation.rb, line 16 def deprecate(method, alternate_method=nil) return if deprecation_tracker.include? method deprecation_tracker << method message = <<-NOTICE #{DEPRECATION_PREFIX} * #{method} is deprecated. NOTICE if alternate_method message << <<-ADDITIONAL * please use #{alternate_method} instead. ADDITIONAL end warn_deprecation(message) end
# File lib/github_api/deprecation.rb, line 10 def deprecation_tracker @deprecation_tracker ||= [] end
Delegate to Github::Client
# File lib/github_api.rb, line 25 def method_missing(method, *args, &block) return super unless new.respond_to?(method) new.send(method, *args, &block) end
Alias for Github::API.new
@return [Github::Client]
# File lib/github_api.rb, line 19 def new(options = {}, &block) Github::Client.new(options, &block) end
# File lib/github_api.rb, line 30 def respond_to?(method, include_private = false) new.respond_to?(method, include_private) || super(method, include_private) end
# File lib/github_api/deprecation.rb, line 33 def warn_deprecation(message) send :warn, message end