Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Spacejam is a ruby library for checking on the status of a website. You can use it to check if a page or site is online. I wrote it to keep an eye on the website for Space Jam. I wrote a Twitter bot that checks the status of the website multiple times a day.
The library is basically a very simple wrapper around Curl. Here's how it works:
Spacejam.online?('http://muffinlabs.com')
=> true
x = Spacejam::HTTPCheck.new('http://muffinlabs.com')
x.online?
=> true
Instead of just passing a URL, you can pass a hash with the URL and an expected response code:
x = Spacejam::HTTPCheck.new(url:'http://muffinlabs.com/missing_file.html', response_code:200)
x.online?
=> false
You can also check non-200 response codes. Admittedly, looking for a 404 seems a little odd, but it still has it's uses.
x = Spacejam::HTTPCheck.new(url:'http://muffinlabs.com/missing_file.html', response_code:404)
x.online?
=> true
Also, you can check the body content of the page:
x = Spacejam::HTTPCheck.new(url:'http://muffinlabs.com/', body:"A string to check for")
x.online?
=> true
Both body and response_code attributes can be a regex:
x = Spacejam::HTTPCheck.new(
url:'http://muffinlabs.com/',
response_code:/20?/,
body:/muffinlabs/)
x.online?
=> true
If the request isn't successful, Spacejam can give you some information about what went wrong via the reason attribute:
x.reason
=> :response_code
The possible values are:
Add this line to your application's Gemfile:
gem 'spacejam'
And then execute:
$ bundle
Or install it yourself as:
$ gem install spacejam
Please do! Pull requests are welcomed.
Copyright (c) 2014 Colin Mitchell. MIT License. Keep Circulating The Tapes.
FAQs
Unknown package
We found that spacejam 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.