Skip to content

Commit

Permalink
Fix documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Apr 5, 2018
1 parent 4e75b36 commit ed20a26
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 16 deletions.
1 change: 1 addition & 0 deletions library/packages/src/lib/y2packager/license.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def reject!
end

private

# @return [Y2Packager::LicensesFetchers::Base] License fetcher object
attr_reader :fetcher
end
Expand Down
4 changes: 4 additions & 0 deletions library/packages/src/lib/y2packager/licenses_fetchers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
require "y2packager/licenses_fetchers/rpm"

module Y2Packager
# This module contains licenses fetchers
#
# Licenses can be retrieved from different places (libzypp, URLs, etc.). The classes
# defined in this module are able to retrieve licenses contents.
module LicensesFetchers
# Return the licenses proper fetcher for a given source
#
Expand Down
5 changes: 5 additions & 0 deletions library/packages/src/lib/y2packager/licenses_handlers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
require "y2packager/licenses_handlers/rpm"

module Y2Packager
# This module contains licenses handlers
#
# Licenses can be retrieved from different places (libzypp, URLs, etc.). The
# classes defined in this module are able to interact with these sources in
# order to find out, for instance, whether a license must be accepted.
module LicensesHandlers
# Return the licenses proper fetcher for a given source
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@ def initialize(product_name)
end
end
end

4 changes: 2 additions & 2 deletions library/packages/src/lib/y2packager/licenses_handlers/rpm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

module Y2Packager
module LicensesHandlers
# This class is responsible for interacting with libzypp in order to get/set
# the license acceptance status for a given product
class Rpm < Base
attr_reader :product_name

# Determine whether the license should be accepted or not
#
# @return [Boolean] true if the license acceptance is required
Expand Down
23 changes: 11 additions & 12 deletions library/packages/src/lib/y2packager/product_license.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@
require "y2packager/licenses_handlers"

module Y2Packager
# This class holds the license stuff for a given product
#
# Why a separate ProductLicense class? First of all, we wanted to extract
# the license handling from Y2Packager::Product and moving this logic to
# Y2Packager::License was not a good idea because different products could
# share the same license. Additionally, this class offers an API to work
# with licenses when a proper Product or Addon object is not available
# (backward compatibility reasons).
#
# @see Y2Packager::Product
# @see Y2Packager::License
class ProductLicense
# This class holds the license stuff for a given product
#
# Why a separate ProductLicense class? First of all, we wanted to extract
# the license handling from Y2Packager::Product and moving this logic to
# Y2Packager::License was not a good idea because different products could
# share the same license. Additionally, this class offers an API to work
# with licenses when a proper Product or Addon object is not available
# (backward compatibility reasons).
#
# @see Y2Packager::Product
# @see Y2Packager::License

extend Forwardable

def_delegators :@license, :content_for, :locales, :accept!, :reject!
Expand Down
2 changes: 1 addition & 1 deletion library/packages/test/y2packager/license_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@

context "and the default language is specified" do
it "returns the given content" do
expect(license.content_for()).to eq("Some content")
expect(license.content_for).to eq("Some content")
end
end

Expand Down

0 comments on commit ed20a26

Please sign in to comment.