Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Using RTFM, you can declaratively create nice, standard man pages for your Ruby projects using a slick, maintainable DSL. It also includes rake tasks to aid in debugging, generating, and installing your man files.
You might say: "but wait, aren't man pages already written in a DSL?", and you'd be right! However, here's an example of it:
.It Fl p
Acts mostly same as -n switch, but print the value of variable
.Li "$_"
at the each end of the loop. For example:
.Bd -literal -offset indent
% echo matz | ruby -p -e '$_.tr! "a-z", "A-Z"'
MATZ
.Ed
.Pp
.It Fl r Ar library
Causes Ruby to load the library using require. It is useful when using
.Fl n
or
.Fl p .
That's from the Ruby manfile. This is using the groff
macro language,
which is awfully spiffy. However, it makes man files extremely tedious to
maintain. It even spits out errors if you put a blank line in your manfile!
Now, manfiles are long and complex, and contain a lot of information. Chances are, your RTFM-based manfile isn't actually going to be too much shorter than your normal groff-based entry. The difference is that by using the RTFM DSL, it should be very, very simple to maintain. Which is a huge win for your users.
RTFM::ManPage.new("testing", 2) do |page|
page.summary = "testing man page"
page.option :verbose, "The verbose flag does a lot of stuff."
page.option :silliness, "Set how silly the application should be.", :argument => "n"
page.option :input, "The input flag takes a filename", :argument => "<input>"
page.description do |desc|
desc.body = "This is a small, temporary description of the testing " +
"man page."
end
page.see_also do |also|
also.reference "rails", 1
also.reference "ruby"
end
page.bugs = "There are a few bugs, but nothing too serious."
page.history = "This program has a storied history that I am too " +
"lazy to include here."
page.authors do |authors|
authors.add "Michael Edgar", "adgar@carboni.ca"
end
end
The weird thing about making manfiles is that each section has its own semantics - sometimes, macros even change their meanings slightly. There are idioms and "best practices" for each. The cool part of RTFM is that we can try to match the idioms for you - you just provide the information we need.
An example: in the "SEE ALSO" section, you can provide a list of other manual pages that are related to yours. In the example above, you see a couple of simple references. If you read the deep, dark documentation on the subject, you'll know that these references should be sorted by manual section, and then alphabetically within sections. RTFM will do that for you. It's the little things that count.
Hopefully we can get some of this integrated into RubyGems, though that's a long shot - it's a long-standing, cross-platform project. But it's nice to dream.
I hope to add the ability to insert raw groff if you are an advanced user and want some really spiffy formatting.
Copyright (c) 2010 Michael Edgar. See LICENSE for details.
FAQs
Unknown package
We found that rtfm 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.