Skip to content

Commit

Permalink
Merge pull request #981 from yast/sep-merge-yardoc
Browse files Browse the repository at this point in the history
YARD Documentation fixes
  • Loading branch information
imobachgs authored Sep 30, 2019
2 parents 7671f5b + f1c7326 commit f0c5014
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion doc/network-ng.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ to read the configuration for a connection (e.g., `ifcfg-eth0`, `ifcfg-wlan0`, e
in a set of smaller classes (one for each time of connection) under
{Y2Network::Sysconfig::ConnectionConfigReaders}.

{Y2Network::InterfacesWriter, }{Y2Network::Sysconfig::DNSWriter} and
{Y2Network::Sysconfig::InterfacesWriter}, {Y2Network::Sysconfig::DNSWriter} and
{Y2Network::Sysconfig::ConnectionConfigWriter}, including smaller classes under
{Y2Network::Sysconfig::ConnectionConfigWriters}, are involved in writing the configuration.

Expand Down
4 changes: 3 additions & 1 deletion src/lib/y2network/hwinfo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Yast.import "LanItems"

module Y2Network
# A helper for {Hwinfo}.
class HardwareWrapper
def initialize
Yast.include self, "network/routines.rb"
Expand Down Expand Up @@ -63,11 +64,12 @@ def read_hardware
end
end

# Stores useful (from networking POV) items of hwinfo for an interface
# Stores useful (from networking POV) items of hwinfo for an interface.
# FIXME: decide whether it should read hwinfo (on demand or at once) for a network
# device and store only necessary info or just parse provided hash
class Hwinfo
# TODO: this method should be private
# @return [Hash]
attr_reader :hwinfo

class << self
Expand Down
3 changes: 1 addition & 2 deletions src/lib/y2network/interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@ module Y2Network
# configuration (see {Hwinfo}), including naming and driver information.
#
# Logical configuration, like TCP/IP or WIFI settings, are handled through
# Y2Network::ConnectionConfig::Base classes. Actually, relationships with other interfaces (like
# {Y2Network::ConnectionConfig::Base} classes. Actually, relationships with other interfaces (like
# bonding slaves) are kept in those configuration objects too.
#
# @see Y2Network::PhysicalInterface
# @see Y2Network::VirtualInterface
# @see Y2Network::FakeInterface
class Interface
include Yast::Logger

Expand Down
11 changes: 7 additions & 4 deletions src/lib/y2network/ip_address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,20 @@
module Y2Network
# This class represents an IP address
#
# The IPAddr from the Ruby standard library drops the host part according to the netmask. The
# problem is that YaST uses a CIDR-like string, including the host part, to set IPADDR in ifcfg-*
# The IPAddr from the Ruby standard library drops the host bits according to the netmask. The
# problem is that YaST uses a CIDR-like string, including the host bits, to set IPADDR in ifcfg-*
# files (see man 5 ifcfg for further details).
#
# @example IPAddr from standard library behavior
# @see ConnectionConfig::IPConfig
# @see https://www.rubydoc.info/stdlib/ipaddr/IPAddr
#
# @example ::IPAddr from the standard library behavior
# ip = IPAddr.new("192.168.122.1/24")
# ip.to_s #=> "192.168.122.0/24"
#
# However, what we need is to be able to keep the host part
#
# @example IPAddress behaviour
# @example Y2Network::IPAddress behavior
# ip = IPAddress.new("192.168.122.1/24")
# ip.to_s #=> "192.168.122.1/24"
#
Expand Down
2 changes: 2 additions & 0 deletions src/lib/y2network/ipoib_mode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

module Y2Network
# This class represents the supported IPoIB transport modes.
# @see https://www.kernel.org/doc/html/latest/infiniband/ipoib.html
# IP over InfiniBand
class IpoibMode
class << self
# Returns all the existing modes
Expand Down
6 changes: 3 additions & 3 deletions src/lib/y2network/udev_rule_part.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# find current contact information at www.suse.com.

module Y2Network
# Simple class to represent a key-value pair in a udev rule
# Simple class to represent a key-value pair in a {UdevRule}.
#
# This class does not check whether operators or keys/values are valid or not. We can implement
# that logic later if required.
Expand All @@ -37,12 +37,12 @@ class << self
#
# @example Using globs
# part = UdevRulePart.from_string('ATTR{address}=='"?*31:78:f2"')
# part.key #=> "ATTR{æddress}"
# part.key #=> "ATTR{address}"
# part.operator #=> "=="
# part.value #=> "\"?*31:78:f2\""

# @param str [String] string form of an udev rule
# @return [UdevRule] udev rule object
# @return [UdevRulePart] udev rule object
def from_string(str)
match = PART_REGEXP.match(str)
return if match.nil?
Expand Down

0 comments on commit f0c5014

Please sign in to comment.