summaryrefslogtreecommitdiff
path: root/lib/chef/provider/package/dnf.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-12-15 14:08:49 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-12-15 14:08:49 -0800
commitd14efdb0be57f59a0e93ba96c7342fd29fc8e656 (patch)
treef70395f9c813bb69d0ee96611a39b3264ea2392b /lib/chef/provider/package/dnf.rb
parent1ce528e4a36bb6aad6eb03cf94e3cb7af11a2ed1 (diff)
downloadchef-d14efdb0be57f59a0e93ba96c7342fd29fc8e656.tar.gz
also extract out the utility class
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/provider/package/dnf.rb')
-rw-r--r--lib/chef/provider/package/dnf.rb32
1 files changed, 1 insertions, 31 deletions
diff --git a/lib/chef/provider/package/dnf.rb b/lib/chef/provider/package/dnf.rb
index 0d026a49b7..84594bf4a6 100644
--- a/lib/chef/provider/package/dnf.rb
+++ b/lib/chef/provider/package/dnf.rb
@@ -20,6 +20,7 @@ require "chef/resource/dnf_package"
require "chef/mixin/which"
require "chef/mixin/get_source_from_package"
require "chef/provider/package/dnf/python_helper"
+require "chef/provider/package/dnf/version"
class Chef
class Provider
@@ -28,37 +29,6 @@ class Chef
extend Chef::Mixin::Which
include Chef::Mixin::GetSourceFromPackage
- # helper class to assist in passing around name/version/arch triples
- class Version
- attr_accessor :name
- attr_accessor :version
- attr_accessor :arch
-
- def initialize(name, version, arch)
- @name = name
- @version = version
- @arch = arch
- end
-
- def to_s
- "#{name}-#{version}.#{arch}"
- end
-
- def version_with_arch
- "#{version}.#{arch}" unless version.nil?
- end
-
- def matches_name_and_arch?(other)
- other.version == version && other.arch == arch
- end
-
- def ==(other)
- name == other.name && version == other.version && arch == other.arch
- end
-
- alias_method :eql?, :==
- end
-
allow_nils
use_multipackage_api
use_package_name_for_source