
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
= dump-parser
I found my self doing this serveral times:
Goal of this gem is to provide a clean DSL to parse strings (CSV fields) into usable objects.
== Example
require 'dump-parser'
DumpParser.register :dd_mm_yyyy_date_time do nil_if_empty require_format %r(\A(\d{2}).(\d{2}).(\d{4})\Z) begin DateTime.new(match[3].to_i,match[2].to_i,match[1].to_i) rescue ArgumentError error 'is invalid date' end end
DumpParser.register :required_integer do require_format %r(\A\d+\Z) value.to_i(10) end
DumpParser.execute :dd_mm_yyyy_date_time, "" # returns nil DumpParser.execute :dd_mm_yyyy_date_time, "10.01.1901" # returns DateTime.new(1901,01,10) DumpParser.execute :dd_mm_yyyy_date_time, "invalid" # raises DumpParser::ParseException.new('dd_mm_yyyy_date: value "invalid" does not match required format') DumpParser.execute :dd_mm_yyyy_date_time, "31.02.2011" # raises DumpParser::ParseException.new('dd_mm_yyyy_date: value "31.02.2011" is invalid date')
== Contributing to dump-parser
== Copyright
Copyright (c) 2011 Markus Schirp. See LICENSE.txt for further details.
FAQs
Unknown package
We found that dump-parser 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
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.