-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
113 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
library/packages/src/lib/y2packager/licenses_fetchers/dummy.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# ------------------------------------------------------------------------------ | ||
# Copyright (c) 2018 SUSE LLC, All Rights Reserved. | ||
# | ||
# This program is free software; you can redistribute it and/or modify it under | ||
# the terms of version 2 of the GNU General Public License as published by the | ||
# Free Software Foundation. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
# ------------------------------------------------------------------------------ | ||
|
||
require "y2packager/licenses_fetchers/base" | ||
|
||
module Y2Packager | ||
module LicensesFetchers | ||
# FIXME: Finish implementation | ||
class Dummy < Base | ||
def initialize(product_name, options = {}) | ||
super | ||
@content = options[:content] | ||
end | ||
# Return the license text to be confirmed | ||
# | ||
# It will return the empty string ("") if the license does not exist or if | ||
# it was already confirmed. | ||
# | ||
# @param lang [String] Language | ||
# @return [String,nil] Product's license; nil if the product was not found. | ||
def license_content(_lang) | ||
@content | ||
end | ||
|
||
# Return available locales for product's license | ||
# | ||
# @return [Array<String>] Language codes ("de_DE", "en_US", etc.) | ||
def license_locales | ||
[License::DEFAULT_LANG] | ||
end | ||
|
||
# Determine whether the license should be accepted or not | ||
# | ||
# @return [Boolean] true if the license acceptance is required | ||
def license_confirmation_required? | ||
false | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
library/packages/src/lib/y2packager/licenses_handlers/dummy.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# ------------------------------------------------------------------------------ | ||
# Copyright (c) 2018 SUSE LLC, All Rights Reserved. | ||
# | ||
# This program is free software; you can redistribute it and/or modify it under | ||
# the terms of version 2 of the GNU General Public License as published by the | ||
# Free Software Foundation. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
# ------------------------------------------------------------------------------ | ||
|
||
module Y2Packager | ||
module LicensesHandlers | ||
class Dummy | ||
attr_reader :product_name | ||
|
||
# Constructor | ||
# | ||
# @param product_name [String] Product's name | ||
def initialize(product_name) | ||
@product_name = product_name | ||
end | ||
|
||
# Determine whether the license should be accepted or not | ||
# | ||
# @return [Boolean] true if the license acceptance is required | ||
def license_confirmation_required? | ||
end | ||
|
||
# Set the license confirmation for the product | ||
# | ||
# @param confirmed [Boolean] true if it should be accepted; false otherwise | ||
def license_confirmation=(confirmed) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters