26
1
submitted 7 months ago by mac@programming.dev to c/ruby@programming.dev
27
3
submitted 8 months ago by mac@programming.dev to c/ruby@programming.dev
28
5
submitted 8 months ago by mac@programming.dev to c/ruby@programming.dev
29
6
submitted 8 months ago by mac@programming.dev to c/ruby@programming.dev
30
7
submitted 9 months ago by morrowind@lemmy.ml to c/ruby@programming.dev

For any ruby devs looking to use crystal as well

31
1

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.

32
1

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

33
1
submitted 10 months ago by morrowind@lemmy.ml to c/ruby@programming.dev

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.

34
1
submitted 11 months ago by morrowind@lemmy.ml to c/ruby@programming.dev
35
3
submitted 11 months ago by morrowind@lemmy.ml to c/ruby@programming.dev
36
3
37
2
submitted 11 months ago by morrowind@lemmy.ml to c/ruby@programming.dev
38
2
submitted 11 months ago* (last edited 11 months ago) by h_a_r_u_k_i@programming.dev to c/ruby@programming.dev

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).

39
1

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?

40
1

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?

41
1
42
1

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 (if open-uri has been loaded), but also "|command-here" commands which are then opened using IO.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 to Kernel.open(). Hopefully, in Ruby 4.0 this insecure feature will be removed.

43
1
44
1
45
1

Heya! I thought I'd mention that I've been doing a bunch of development on the optical Timex Datalink watches! I have been carefully sniffing data from the original Timex software with a logic analyzer, and have fully reverse engineered every Datalink protocol, the serial Notebook Adapter, and even the CRT syncing graphics! This means that every Datalink device, including every Timex and Motorola watch, all PDAs, and the funny e-BRAIN talking toy is supported!

For those that aren't familiar, the Timex Datalink is a watch that was introduced in 1994 that is essentially a small PDA on your wrist. The early models (supported by this software) have an optical sensor on the top of the face that receives data via visible light.

The original data transfer method involves drawing patterns of lines on a CRT monitor for the watch to receive with the optical sensor. CRTs use electron beams that draw scan lines one-by-one from top to bottom, then it returns to the top and repeats for the next frame. This means that the electron guns turn on when its drawing a white line, and and turn off when its drawing the black background. This produces flashing light as the graphics are drawn, which is ultimately received by the optical sensor and decoded by the Timex Datalink device.

For laptop users, Timex also offered the Datalink Notebook Adapter. Instead of using a CRT monitor, the Notebook Adapter simply flashed a single LED light. This adapter is fully supported by the Timex Datalink software, and sends the same data as a CRT.

However, Notebook Adapters are rare and expensive now, so I reverse-engineered one! Here's my timex_datalink_client Ruby library communicating with my DIY Datalink Notebook Adapter to emit data to a Timex Datalink watch!

And if you want to try the reverse-engineered CRT graphics, I got you covered! I reverse-engineered that, too!

As a fun tidbit, these watches are flight certified by NASA and is one of four watches qualified by NASA for space travel! Here's a shot of James H. Newman wearing a Datalink watch on the Space Shuttle for STS-88!

Here is my Ruby library with all options for all watches reverse-engineered into a tidy model-based syntax!

Here is a Notebook Adapter emulator that is fully compatible with all Timex software on old and new machines, and also works with my library too!

And if you have an anchor that happens to contain an electron beam and wanna try it, here's my library for drawing graphics to a CRT to transfer data!

This has all been done over months of careful effort with lots of VMs, Pentium machines, Windows 98SE, logic analyzers, and solving data puzzles little by little. On July 4th, 2023, I'm proud to announce that I have reverse-engineered every Datalink device with 100% feature compatibility! This is definitely a passion project by all means, and I thought I'd pop in and share this passion with y'all!

Enjoy!

46
1
Rails upgrade led to Ruby bug (evgeniydemin.medium.com)
47
1

A little different from the "what are you building" pattern of posts. I found myself wanting to learn different aspects of Ruby on Rails outside of work, and I am curious what people are learning themselves.

Currently, I am learning Hotwire since I don't do much frontend work and we don't use it at work. In the past I've used Stimulus Reflex, and I am not sure which one I like more. That said, I am not sure if Stimulus Reflex still has a place given Hotwire's ascension in the RoR world.

I am also revisiting View Components as well and trying to decide if I want to use them over partials in my side project.

48
1
submitted 1 year ago by ollien@beehaw.org to c/ruby@programming.dev

Hi all!

What do you guys use for completions in VSCode? I'm driving into ruby right now and have been a bit underwhelmed by what I've tried.

49
1
50
1

Meet Iteration, an extension for ActiveJob that makes your jobs interruptible and resumable, saving all progress that the job has made (aka checkpoint for jobs).

view more: ‹ prev next ›

Ruby

518 readers
4 users here now

A community for discussion and news about Ruby programming.

Learning Ruby?

Tools

Documentation

Books

Screencasts

News and updates

founded 1 year ago
MODERATORS