Git Product home page Git Product logo

webmention-client-ruby's Introduction

webmention-client-ruby

A Ruby gem for sending and verifying Webmention notifications.

Gem Downloads Build

Key Features

  • Crawl a URL for mentioned URLs.
  • Perform endpoint discovery on mentioned URLs.
  • Send webmentions to one or more mentioned URLs (and optionally include a vouch URL).
  • Verify that a received webmention's source URL links to a target URL (and optionally verify that a vouch URL mentions the source URL's domain).

Getting Started

Before installing and using webmention-client-ruby, you'll want to have Ruby 3.0 (or newer) installed. Using a Ruby version managment tool like rbenv, chruby, or rvm is recommended.

webmention-client-ruby is developed using Ruby 3.0.0 and is tested against additional Ruby versions using GitHub Actions.

Installation

Add webmention-client-ruby to your project's Gemfile and run bundle install:

source "https://rubygems.org"

gem "webmention-client"

Usage

See USAGE.md for documentation of webmention-client-ruby's features.

Migrating to version 6

webmention-client-ruby was completely rewritten for version 6 to better support new features and future development. Some notes on migrating to the new version:

♻️ Renamed: for clarity and consistency, the Webmention.send_mention method has been renamed Webmention.send_webmention. Both methods use the same interface.

Removed: the Webmention.client method has been removed in favor of the additional module methods noted above. While the underlying Webmention::Client class still exists, its interface has changed and its direct usage is generally unnecessary.

Removed: Webmention::Client#send_all_mentions has been removed in favor of Webmention.send_webmentions. Combine Webmention.mentioned_urls and Webmention.send_webmentions to achieve similar results.

🛠 Refactored: Exception handling has been greatly improved as noted above.

Contributing

See CONTRIBUTING.md for more on how to contribute to webmention-client-ruby. Your help is greatly appreciated!

By contributing to and participating in the development of webmention-client-ruby, you acknowledge that you have read and agree to the IndieWeb Code of Conduct.

Acknowledgments

webmention-client-ruby is written and maintained by Jason Garber (@jgarber623) with help from these additional contributors. Prior to 2018, webmention-client-ruby was written and maintained by Aaron Parecki (@aaronpk) and Nat Welch (@icco).

To learn more about Webmention, see indieweb.org/Webmention and webmention.net.

License

webmention-client-ruby is freely available under the Apache License 2.0. See LICENSE for more details.

webmention-client-ruby's People

Contributors

aaronpk avatar barryf avatar dependabot[bot] avatar icco avatar jeremyf avatar jgarber623 avatar veganstraightedge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webmention-client-ruby's Issues

Migrate Test Suite to RSpec?

Open question here…

Currently, the gem relies on minitest for running the test suite.

The following is opinion-based, which is why I tagged this one as a "question" and not an "enhancement," etc.

A migration to RSpec should be fairly straightforward. The syntax is similar (e.g. describe, it) but the assertions are a bit different (e.g. expect(true).to be_a(Boolean)). I've found the syntax to be more readable (again, opinion, developer ergonomics, etc.).

RSpec will look for a .rspec file in the root of the project for some configuration flags:

--order random
--require spec_helper

My default config tends to look like that. The second line is handy in that you don't have to require spec_helper in every test file. Fun!

I also often use rubocop-rspec which is of debatable value, but tools like that have helped improve my Ruby skills more often than not.

So… feedback welcome and appreciated!

publish new version to rubygems

my first attempt at building and installing the update breaks because of an error with httparty versions. I'll need to investigate this further. Probably will need to update the library to work with a newer httparty version.

Use webmention-endpoint-ruby gem

I recently released the webmention-endpoint gem which abstracts endpoint discovery into an isolated piece of code. We should consider using this gem for endpoint discovery.

This would introduce a breaking change, though. webmention-endpoint-ruby takes an orthodox approach to endpoint discovery based on the Webmention spec. The current code in webmention-client-ruby is more liberal and supports things like rel="http://webmention.org". I'm comfortable making this break from the past, but I'd love to hear feedback on that.

I'm super-biased here, so please check my thinking on this one. 😄

Use HTTP Ruby gem

@aaronpk mentions some issues with HTTParty in #7. I've been using the http Ruby gem without issue. It works great and the API is fairly straightforward.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.