Class: Bugzilla::Bugzilla
Overview
Bugzilla::Bugzilla
Bugzilla::Bugzilla class is to access the Bugzilla::WebService::Bugzilla API that provides functions tell you about Bugzilla in general.
Instance Method Summary collapse
-
#check_version(version_) ⇒ Object
Bugzilla::Bugzilla#check_version(version_).
-
#requires_version(cmd, version_) ⇒ Object
Bugzilla::Bugzilla#requires_version(cmd, version_).
Methods inherited from Skeleton
Constructor Details
This class inherits a constructor from Bugzilla::Skeleton
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Bugzilla::Skeleton
Instance Method Details
#check_version(version_) ⇒ Object
Bugzilla::Bugzilla#check_version(version_)
Returns Array contains the result of the version check and Bugzilla version that is running on.
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/bugzilla/bugzilla.rb', line 45 def check_version(version_) v = version f = false if v.kind_of?(Hash) && v.include?("version") && Gem::Version.new(v['version']) >= Gem::Version.new("#{version_}") then f = true end [f, v['version']] end |
#requires_version(cmd, version_) ⇒ Object
Bugzilla::Bugzilla#requires_version(cmd, version_)
Raise an exception if the Bugzilla doesn’t satisfy the requirement of the version.
65 66 67 68 |
# File 'lib/bugzilla/bugzilla.rb', line 65 def requires_version(cmd, version_) v = check_version(version_) raise NoMethodError, sprintf("%s is not supported in Bugzilla %s", cmd, v[1]) unless v[0] end |