mini_sanity Build Status

In-line sanity checks, written as extensions to core Ruby objects. See API listing below, or browse the full documentation.

Example

require "json"
require "pathname"

path = Pathname.new("hosted_files.json").assert!(&:exist?)

hosted_files = JSON.parse(path.read).assert!(Array)

urls = hosted_files.flat_map do |file_info|
  file_info.fetch("mirror_urls").refute!(&:empty?)
end

domains = urls.map do |url|
  url.assert!(%r"^https?://").split("/")[2]
end.uniq

API

Installation

Install the gem:

$ gem install mini_sanity

Then require in your Ruby code:

require "mini_sanity"

Contributing

Run rake test to run the tests.

License

MIT License