Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
= relative
== DESCRIPTION: The relative library enhances Ruby's core and standard libraries to support naming, opening, and reading files relative to the Ruby file currently being interpreted (the contents of the __ FILE __ identifier). This functionality is especially useful in embedded Ruby (eruby, erb, erubis, etc.) where absolute paths or paths relative to the interpreter's current working directory are problematic (due to file system structures and working directories varying across platforms and web servers).
== FEATURES
== PROBLEMS: None (known).
== SYNOPSIS: ======examples/example.rb: #!/usr/bin/env ruby require 'rubygems' require 'relative'
relative_path = "../Rakefile"
print("====================================================================\n") print("The absolute path of #{relative_path} (relative to #{FILE}):\n") print("#{File.expand_path_relative_to_caller(relative_path)}\n") print("====================================================================\n") print("The Pathname of #{relative_path} (relative to #{FILE}):\n") print("#{Pathname.new(relative_path).expand_path_relative_to_caller()}\n") print("====================================================================\n") print("The contents of #{relative_path} (relative to #{FILE}):\n") print("#{IO.read(PathRelativeToCaller.new(relative_path))}") print("====================================================================\n")
This example shows the use of File.expand_path_relative_to_caller to expand +../Rakefile+ relative to the path of the example script, +examples/example.rb+. It also illustrates how Pathname#expand_path_relative_to_caller can return an expansion of the receiver Pathname (+../Rakefile+) relative to +examples/example.rb+. Finally, it demonstrates that a PathRelativeToCaller object can be passed into ordinary File and IO methods, within which it will evaluate to an absolute expansion of +../Rakefile+ (the path with which it was initialized) relative to +examples/example.rb+ (the source file that constructed the PathRelativeToCaller instance).
== RECOMMENDATIONS: This gem works very well with the erbextensions gem (http://erbextensions.rubyforge.org). The erbextensions gem provides a method to include the expanded contents of one erb file within another erb file; it often is best to use a path relative to the containing erb file to refer to the erb file to be included.
== REQUIREMENTS: Hoe is required but only for running the tests.
== INSTALL: sudo gem install relative
== AUTHORS: === Designing Patterns
== SUPPORT: Please post questions, concerns, or requests for enhancement to the forums on the project page. Alternatively, direct contact information for Designing Patterns can be found on the project page for this gem.
== ENHANCEMENTS: Please feel free to contact us with any ideas; we will try our best to enhance the software and respond to user requests. Of course, we are more likely to work on a particular enhancement if we know that there are users who want it. Designing Patterns provides contracting and consulting services, so if there is an enhancement that must get done (and in a specified time frame), please inquire about retaining our services!
== LICENSE: The license text can be found in the +LICENSE+ file at the root of the distribution.
This package is licensed with an MIT license:
Copyright (c) 2008-2009 Designing Patterns
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
== SHARE AND ENJOY!
FAQs
Unknown package
We found that relative demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.