gringotts
Ruby style guide
Our great sponsors
gringotts | Ruby style guide | |
---|---|---|
1 | 36 | |
477 | 16,380 | |
0.4% | 0.1% | |
2.4 | 6.6 | |
3 months ago | 3 months ago | |
Elixir | ||
MIT License | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
gringotts
-
Learning Ruby: Things I Like, Things I Miss from Python
Thanks.
> Stripe, including webhooks support, actively developed
I've looked into Stripity Stripe. For some time it was unmaintained and ended up getting taken over by another maintainer. It's also not as comprehensive as the official Stripe libraries. There's also a very big difference in using an official Stripe library and hoping for the best with a random one someone developed. Just skimming the code base it looks like the Checkout module is missing features that exist in the official Stripe library in every other supported language.
According to the README file for Stripity Stripe it's also using Stripe's API version from 2019. There have been multiple major API updates since then, and there's been an open issue since November 2020 to add support for newer API versions with no replies. Personally I would be using one of those major features too.
And this really is the point I'm trying to drive home. With Ruby, Python, Go, PHP, Node, Java and .NET these are problems you don't even need to think about. You just pick the payment provider's official SDK and start coding immediately, often times there's also an abundance of resources to implement the billing code itself into your app too through blog posts, official docs, YouTube videos, and even paid products like https://spark.laravel.com/. Stuff that makes integrating billing into your app (through Stripe, BrainTree and Paddle) being something you get done in 1 day instead of 3 months.
With Elixir it becomes weeks of comprehensive research, evaluating questionable libraries, opening PRs, and becoming a full time library developer just to get to the point where you could even maybe begin to start accepting payments with just Stripe.
> the best I've found is https://github.com/aviabird/gringotts
I asked the Gringotts developers if they would be supporting PayPal about 5 hours after they announced the project ~3 years ago. He said it was coming and to stay tuned. It's now ~3 years later and PayPal support isn't there. Neither is BrainTree or Paddle. Here's the open issue for PayPal support from 2018 (not by me, I asked on another site) https://github.com/aviabird/gringotts/issues/114. The Stripe integration is also missing a ton and hasn't been touched since 2018.
By the way, the Pay gem is really good. It's a smart abstraction and supports a ton of different subscription / 1 off payment use cases. Even complex ones like the type of app I was building.
> It's definitely a few weeks work to roll your own from scratch so to be honest I'd probably just integrate with Twilio and just pay for someone else to handle this for me.
Twilio ends up being 1 potential delivery method, it's not really someone you pay to solve the problem for you.
There's wanting to show notification in the app over websockets, saving them into a database, emailing them out only if they are unread, maybe sending an SNS through Twilio, Slack and other providers.
The noticed gem handles all of this for you (and supports Twilio too).
Notifications in general is another example where other frameworks have this solved in very good ways, but it becomes another example where you have to stop developing your app and start developing a notification library with Elixir.
At this point we've only talked about payments and notifications too. There's lots of other examples.
Ruby style guide
-
An Introduction to RuboCop for Ruby on Rails
By default, RuboCop will enforce the style defined in the Ruby Community Style Guide. We can tailor it to our specific tastes and context, but let's rely on this basic set of rules to learn how to use RuboCop.
-
Code Reviewing a Ruby on Rails application.
RuboCop is a Ruby static code analyzer (a.k.a. linter) and code formatter. Out of the box it will enforce many of the guidelines outlined in the community Ruby Style Guide. Apart from reporting the problems discovered in your code, RuboCop can also automatically fix many of them for you.
- Naming conventions and style guides in programming"
-
Shine bright like a.. Ruby 💎
Read more about Ruby.
-
10 Best Practices for Ruby Programmers: Tips for Efficient, Maintainable, and Bug-Free Code
8. Use a consistent style: Consistency is key when it comes to writing readable code. Use a consistent style throughout your codebase, and follow common Ruby style guides like Ruby Style Guide.
-
It's Official: the Standard Ruby VS Code extension
The real standard is to use default rubocop configuration which is based on https://rubystyle.guide/.
-
Why I think we should adopt and use new Ruby features
It used to, before recently. It literally said, "The and and or keywords are banned."
-
Rubyme: My minimalist Ruby Handbook
rubocop/ruby-style-guide
-
Development guidelines
As you see - there are no reference to any technology or framework. There are a lot of best-practices for almost any framework, so you can choose an appropriate one. For example - if you're a rails developer, then you can check https://github.com/rubocop/ruby-style-guide and https://github.com/rubocop/rails-style-guide but if you're a golang developer - https://github.com/uber-go/guide/blob/master/style.md and https://developers.mattermost.com/contribute/more-info/server/style-guide/
- `and` and `or` control flow operators now allowed in Rubocop
What are some alternatives?
stripity_stripe - An Elixir Library for Stripe
Rails style guide - A community-driven Ruby on Rails style guide
airbrake - An Elixir notifier to the Airbrake/Errbit. System-wide error reporting enriched with the information from Plug and Phoenix channels.
RSpec style guide - RSpec Best Practices
instrumental - An Elixir client for Instrumental
fast-ruby - :dash: Writing Fast Ruby :heart_eyes: -- Collect Common Ruby idioms.
elixtagram - :camera: Instagram API client for the Elixir language (elixir-lang)
Fundamental Ruby - :books: Fundamental programming with ruby examples and references. It covers threads, SOLID principles, design patterns, data structures, algorithms. Books for reading. Repo for website https://github.com/khusnetdinov/betterdocs
forecast_io - Simple wrapper for Forecast.IO API
Best-Ruby - Ruby Tricks, Idiomatic Ruby, Refactoring and Best Practices
slack - Slack real time messaging and web API client in Elixir
contracts.ruby - Contracts for Ruby.