Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added RelURL class (jsc#SLE-22669) #1215

Merged
merged 4 commits into from
Dec 15, 2021
Merged

Added RelURL class (jsc#SLE-22669) #1215

merged 4 commits into from
Dec 15, 2021

Conversation

lslezak
Copy link
Member

@lslezak lslezak commented Dec 14, 2021

Description

Details

  • It internally uses the File.expand_path Ruby function to convert the relative path to absolute.
  • The advantage is that it also supports going up in the tree using the parent directory notation (../)
  • The disadvantage is that some corner cases must be handled specifically, e.g. it replaces ~ with the home directory path on the local system which is not what you would expect in URLs.

Testing

  • Tested with unit tests with lots of corner cases.

@coveralls
Copy link

coveralls commented Dec 14, 2021

Coverage Status

Coverage increased (+0.07%) to 41.455% when pulling afeda91 on relurl into 15dccf7 on master.

# in an installed system.
def self.from_installation_repository(rel_url)
base_url = Yast::InstURL.installInf2Url("")
new(base_url, rel_url)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what will happen if nont relative url is called?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The result will be this non-relative URL. The caller is responsible to use a relative URL to make it work properly.

# it creates a copy of the input object and pre-processes the
# "file://" and "relurl://" URLs
def import_url(url)
ret = URI(url).dup
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how it handles exception from URI?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lslezak lslezak merged commit a544805 into master Dec 15, 2021
@lslezak lslezak deleted the relurl branch December 15, 2021 09:42
@yast-bot
Copy link
Contributor

✔️ Public Jenkins job #336 successfully finished
✔️ Created OBS submit request #940686

@yast-bot
Copy link
Contributor

❌ Internal Jenkins job #172 failed

@yast-bot
Copy link
Contributor

❌ Internal Jenkins job #173 failed

@joseivanlopez
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants