Class: Dependabot::Bundler::PackageManager

Inherits:
PackageManagerBase
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dependabot/bundler/package_manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ PackageManager

Returns a new instance of PackageManager.



24
25
26
27
28
29
# File 'lib/dependabot/bundler/package_manager.rb', line 24

def initialize(version)
  @version = T.let(Version.new(version), Dependabot::Version)
  @name = T.let(PACKAGE_MANAGER, String)
  @deprecated_versions = T.let(DEPRECATED_BUNDLER_VERSIONS, T::Array[Dependabot::Version])
  @supported_versions = T.let(SUPPORTED_BUNDLER_VERSIONS, T::Array[Dependabot::Version])
end

Instance Attribute Details

#deprecated_versionsObject (readonly)

Returns the value of attribute deprecated_versions.



38
39
40
# File 'lib/dependabot/bundler/package_manager.rb', line 38

def deprecated_versions
  @deprecated_versions
end

#nameObject (readonly)

Returns the value of attribute name.



32
33
34
# File 'lib/dependabot/bundler/package_manager.rb', line 32

def name
  @name
end

#supported_versionsObject (readonly)

Returns the value of attribute supported_versions.



41
42
43
# File 'lib/dependabot/bundler/package_manager.rb', line 41

def supported_versions
  @supported_versions
end

#versionObject (readonly)

Returns the value of attribute version.



35
36
37
# File 'lib/dependabot/bundler/package_manager.rb', line 35

def version
  @version
end

Instance Method Details

#deprecated?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/dependabot/bundler/package_manager.rb', line 44

def deprecated?
  deprecated_versions.include?(version)
end

#unsupported?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/dependabot/bundler/package_manager.rb', line 48

def unsupported?
  !deprecated? && version < supported_versions.first
end