Class: Zypper::Upgraderepo::DirRequest

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/zypper/upgraderepo/requests/local.rb

Overview

Base class for a local directory request.

Direct Known Subclasses

Requests::LocalRequest

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj, _timeout) ⇒ DirRequest

Returns a new instance of DirRequest.



13
14
15
# File 'lib/zypper/upgraderepo/requests/local.rb', line 13

def initialize(obj, _timeout)
  super obj
end

Instance Attribute Details

#dir_pathObject (readonly)

Returns the value of attribute dir_path.



11
12
13
# File 'lib/zypper/upgraderepo/requests/local.rb', line 11

def dir_path
  @dir_path
end

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/zypper/upgraderepo/requests/local.rb', line 17

def available?
  Dir.exist? ping
end

#cache!Object



45
46
47
# File 'lib/zypper/upgraderepo/requests/local.rb', line 45

def cache!
  @dir_path = nil
end

#forbidden?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/zypper/upgraderepo/requests/local.rb', line 33

def forbidden?
  File.readable? ping
end

#not_found?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/zypper/upgraderepo/requests/local.rb', line 29

def not_found?
  !available?
end

#redirected?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/zypper/upgraderepo/requests/local.rb', line 21

def redirected?
  File.symlink? ping
end

#redirected_toObject



25
26
27
# File 'lib/zypper/upgraderepo/requests/local.rb', line 25

def redirected_to
  File.realpath ping
end

#statusObject



41
42
43
# File 'lib/zypper/upgraderepo/requests/local.rb', line 41

def status
  File.stat ping
end

#timeout?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/zypper/upgraderepo/requests/local.rb', line 37

def timeout?
  false
end