![ruby](https://programming.dev/pictrs/image/f5147bff-c7bf-4228-a4ad-3292a30385c2.webp?format=webp&thumbnail=48)
Ruby
- Ruby might be faster than you think - John Hawthornwww.johnhawthorn.com Ruby might be faster than you think - John Hawthorn
I saw a project a couple weeks back which allows writing and running Crystal methods inline inside a Ruby file. It’s a neat project, and I don’t want to take away from it but something in the README example looked off to me. require 'crystalruby' require 'benchmark' module Fibonnaci crystalize [n:
> I saw a project a couple weeks back which allows writing and running Crystal > methods inline inside a Ruby file. > It’s a neat project, and I don’t want to take away from it but something in the > README example looked off to me. > require 'crystalruby' > require 'benchmark' > module Fibonnaci > crystalize [n:
- The dangers of single line regular expressionsgreg.molnar.io The dangers of single line regular expressions
The Neonify challenge on Hack The Box is a small Sinatra(a Ruby web framework) app, that generates a glowing text of the submitted value:
> The Neonify challenge on Hack The Box is a small Sinatra(a Ruby web framework) app, that generates a glowing text of the submitted value:
- Rails 8 adds Rubocop by default to new applicationsblog.saeloun.com Rails 8 adds Rubocop by default to new applications
All new applications using Rails 8 will have rubocop gem by default.
> All new applications using Rails 8 will have rubocop gem by default.
- Write Crystal code, inlined in Rubygithub.com GitHub - wouterken/crystalruby: Embed Crystal code directly in Ruby
Embed Crystal code directly in Ruby. Contribute to wouterken/crystalruby development by creating an account on GitHub.
- Learn Ruby Regular Expressions with hundreds of examples and exercises
Hello!
I am pleased to announce a new version of my "Understanding Ruby Regexp" ebook. This book will help you learn Ruby Regular Expressions step-by-step from beginner to advanced levels with hundreds of examples and exercises.
Links:
- Free PDF/EPUB: https://learnbyexample.gumroad.com/l/rubyregexp
- Web version: https://learnbyexample.github.io/Ruby_Regexp/
- Markdown source, exercise solutions, etc: https://github.com/learnbyexample/Ruby_Regexp
- Short video about the book: https://youtu.be/QNsCzVeZH78
I would highly appreciate it if you'd let me know how you felt about this book. It could be anything from a simple thank you, pointing out a typo, mistakes in code snippets, which aspects of the book worked for you (or didn't!) and so on. Reader feedback is essential and especially so for self-published authors.
Happy learning :)
- A (highly experimental; early stage) X11 window manager in pure Rubygithub.com GitHub - vidarh/rubywm: An X11 window manager in pure Ruby
An X11 window manager in pure Ruby. Contribute to vidarh/rubywm development by creating an account on GitHub.
What the title says. It's <1k lines of Ruby, and provides a basic tiling WM w/some support for floating windows. It's minimalist, likely still buggy and definitely lacking in features, but some might find it interesting.
It is actually the WM I use day to day
- Inheritance in Ruby, in picturesblog.jez.io Inheritance in Ruby, in pictures – Jake Zimmerman
A solid grasp of the tools Ruby provides for inheritance, like include and extend, helps write better code. But the concepts are often learned hastily—this post revisits them in depth.
- Reconfiguring your application live with dRubykatafrakt.me Reconfiguring your application live with dRuby | katafrakt's garden
Using dRuby to achieve simple live reconfiguration ability, without the need for constant checking an external database or restart the application.
- I Made Ruby Bindings For Whichlanggithub.com GitHub - bendangelo/whichlang-rb: Whcilang bindings for ruby
Whcilang bindings for ruby. Contribute to bendangelo/whichlang-rb development by creating an account on GitHub.
Whichlang is a rust library that detects languages. There were no Ruby bindings so I made one.
- Seth Tucker – Lose The Ruby Accent & Write Crystal Fluently | CrystalConf 2023
YouTube Video
Click to view this content.
For any ruby devs looking to use crystal as well
- Rouge Gtk Theme Loadergithub.com GitHub - vidarh/rouge-gtk_theme_loader: Load GtkSourceView themes into Rouge (Ruby syntax highlighter)
Load GtkSourceView themes into Rouge (Ruby syntax highlighter) - GitHub - vidarh/rouge-gtk_theme_loader: Load GtkSourceView themes into Rouge (Ruby syntax highlighter)
Just pushed this to Github and Rubygems. I use this for my Ruby editor. It parses the GtkSourceView style XML files if you have GtkSourceView installed, and instantiates Rouge themes for them (Rouge is used by e.g. Gitlab) so you get access to some more themes. It's not perfect because it needs to try to map token types between the GtkSourceView and Rouge lexers, but overall works pretty well.
- All Ruby, all the time (almost)
cross-posted from: https://lemmy.stad.social/post/7193
> Most of my workspaces are tiling (bspwm), but I have one where all windows are floated. > > This is showcasing my own (very minimalist; ~300 lines) unreleased desktop manager written in pure Ruby, using a Ruby font renderer and Ruby X11 client library (both on github), and showing a custom menu written in Ruby that auto-populates with actions based on directory contents, and showing my Ruby terminal showcasing double-width and double-height support (xterm has it, but few others), and a window showing me editing my Ruby text editor with itself... > > Oh, and Polybar. One of the terminals is st - the Ruby terminal is a bit wobbly in a few respects still, though I use it more and more. So there are a few non-Ruby bits left. So far. >
All of this is messy and buggy and may have dependencies on my environment that haven't been fixed yet, but I thought it'd be fun to show how much you can run on Ruby (I rely on most of these day to day)
The font renderer (used for the desktop manager, menu and the Ruby terminal, the lower left window is st using FreeType; I should've excised that from the screenshot :-) ) https://github.com/vidarh/skrift
The X11 bindings (no xlib; pure Ruby) https://github.com/vidarh/ruby-x11
X bindings for the font renderer: https://github.com/vidarh/skrift-x11
This is not what the terminal code looks like any more; that version used a C-extension, but that's the repo the current version will eventually get pushed to: https://github.com/vidarh/rubyterm
The menu is not on Github yet, but it's fed menu items from a somewhat updated version of this gist - a new version will be up at some point: https://gist.github.com/vidarh/323204137de5293bfe216ec751646525
An out-of-date-and-probably-won't-run-on-your-system version of my text editor (not least it depends on helper scripts I've not yet untangled from my personal setup). The repo will soon be updated: https://github.com/vidarh/re
- Mastodon 4.2 released, with (opt-in) search, and UX improvementsblog.joinmastodon.org Mastodon 4.2
In this massive update we've added search and removed friction. What's not to love?
cross-posted from: https://lemmy.world/post/5472500
> Lots of small improvements across the user experience, and opt-in search, make this an important release.
- Building a Commercial Game Engine using mRuby and SDL by Amir Rajan
YouTube Video
Click to view this content.
- Ruby 3.3’s YJIT is 15% Fasterrailsatscale.com Ruby 3.3's YJIT Runs Shopify's Production Code 15% Faster
The Ruby and Rails Infrastructure team at Shopify exists to help ensure that Ruby and Rails are 100-year tools that will continue to merit being our toolchain of choice.
- Ruby Outperforms C: Breaking the Catch 22 by Aaron Pattersonrailsatscale.com Ruby Outperforms C: Breaking the Catch-22
The Ruby and Rails Infrastructure team at Shopify exists to help ensure that Ruby and Rails are 100-year tools that will continue to merit being our toolchain of choice.
- My Adventure With Async Rubythoughtbot.com My Adventure With Async Ruby
I used the <code>async</code> gem to speed up a portion of my app. Here’s how it went and my thoughts on the gem.
- Any functional programming book in Ruby?
I want to polish my Ruby and functional programming skills at the same time. And I'm looking for a book that walks through functional programming concepts with code examples in Ruby. I tried searching but no results come up so far. Do you have any recommened materials out there?
PS: I want the code is written specifically in Ruby. I'm not looking for code written in another language (e.g. Scala, Clojure, Lisp).
- Best way to read ruby docs at command line?
I have been sort of flummoxed by this for a number of years, though for the most part I gave up trying to understand and just started using the yard web server. But... does there exist a modern "best-practices" way of reading ruby docs at the command line these days? In Pry? I've played around with ri and show-doc (in pry) - neither of them seem to work very well. Am I missing something?
- Help needed with rubocop
Hey guys, I use rubocop linter with vs code extension. I have a rails 6 app with ruby 3 but some files in vendor/ are symlinks from legacy code which were written in ruby 2. I have to make sure my team doesn't write any ruby 3 specific methods inside this folder cuz since it's a symlink, it's used by other apps with ruby 2 as well. How do i configure my linter for this?
- Elixir for Ruby developers: the three most important differencesphoenixonrails.com Elixir for Ruby developers: the three most important differences
Learning Elixir when you already know Ruby? Here are the three most important things you need to understand
- Proposal to deprecate "|command-here" inputs for Kernel.open() accepted
Dozens of Ruby-related CVEs have been caused by user input being passed to the top-level
Kernel.open()
method, which not only accepts paths or URIs (ifopen-uri
has been loaded), but also"|command-here"
commands which are then opened usingIO.popen()
resulting in Remote Command Execution (RCE) vulnerabilities. In the next minor Ruby version (3.3.0) a deprecation warning will be printed if a"|command-here"
input is given toKernel.open()
. Hopefully, in Ruby 4.0 this insecure feature will be removed.