lib/vnstat.rb in vnstat-ruby-1.1.0 vs lib/vnstat.rb in vnstat-ruby-2.0.0
- old
+ new
@@ -1,8 +1,12 @@
-require 'date'
-require 'nokogiri'
+# frozen_string_literal: true
+require 'bundler/setup'
+require 'rubygems'
+require 'vnstat/version'
+require 'time'
+
##
# The Vnstat namespace.
module Vnstat
autoload :Configuration, 'vnstat/configuration'
autoload :Document, 'vnstat/document'
@@ -56,10 +60,21 @@
end
##
# Returns information for the currently installed version of vnstat.
#
+ # @deprecated Please use {#cli_version} instead.
# @return [String]
def version
+ warn '[DEPRECATION] `Vnstat.version` is deprecated. Please use ' \
+ '`Vnstat.cli_version` instead.'
+ cli_version
+ end
+
+ ##
+ # Returns information for the currently installed version of vnstat.
+ #
+ # @return [String]
+ def cli_version
Utils.call_executable('-v')
end
end