Ruby GUI real time refresh entry with glimmer-libui
im making a GUI in ruby with the glimer dsl for libui and im using the multiline entry as read only as LOG. Where i open a txt file to read ir and then show it on the GUI multiline but it shows the...
View ArticleHow to map values in the array of arrays based on the second value in each array
I have the following data in the array of arrays:[['apples', 2020], ['pears', 2020], ['apples', 2021], ['melons', 2020], ['peaches', 2021], ['pears', 2019]]What I want as a result is this:{ 2019 =>...
View ArticleRuby issues on Mac M1
I'm having trouble installing Ruby and using homebrew on my M1 Mac.I'm trying to install Ruby so that I can launch a website through Jekyll. I'm following the installation guide on the Jekyll website...
View ArticleHow to enforce Ruby code to break long lines with multiple arguments into one...
I'm currently using RuboCop in a Ruby on Rails project, and I have a question regarding code style enforcement for long lines with multiple arguments. We have set a line length maximum of 100...
View ArticleSidekiq Worker vs Job
What is the difference between a worker and a job in the sidekiq context? I was looking and I didn't really find a clear answer. Are they just the same?
View ArticleRuby on Rails Multi-lingual multi-tenant thread problem
We have a Ruby on Rails application that has the concept of multiple brands / multiple domains. The look and feel changes based on the requested domain. In addition, the site currently supports two...
View ArticleHow to install the Ruby LSP extension in a devcontainer without root user
I'm developing a ruby app in a devcontainer in VScode. In the container I am a non-root user. Now I want to install the Ruby LSP extension in the devcontainer, but I get following errors:Failed to...
View ArticleTo block google calendar of the users after creating an event in ROR(Ruby on...
I am working at an ed-tech platform where we need to integrate Google Calendar services. We are using Ruby on Rails (RoR) for this integration. While we are able to create events, we are facing issues...
View ArticleA Regex to ensure that a string contains at least two words
Given a string of one or more words, I need a regex which returns true if the string contains two or more words - any words.My current solution is:([\w\']+ ){1,}which works on the basis that a one-word...
View ArticleJekyll templates using django-like liquid blocks / inheritance
I'm getting into Jekyll in a big way and would like to use it as a general front-end development platform, but am running up against the limitations of the Liquid templating language, specifically its...
View ArticleSecure method to download files in Ruby
A common way to download files in Ruby is using the open-uri library and simply calling open(url). However, it has been pointedout that this passes input along to Kernel#open, which is not safe to call...
View ArticleHow to create a Ruby DateTime from existing Time.zone for Rails?
I have users entering in dates in a Ruby on Rails website. I parse the dates into a DateTime object with something like:date = DateTime.new(params[:year].to_i, params[:month].to_i, params[:day].to_i,...
View ArticleRuby Axlsx Gem Unlocking style on whole column
Using Ruby with the gem axlsx I've been trying to figure out how to set a style for an entire column and I haven't yet found it. The only way I've been able to do this is in a loop, setting each cell...
View ArticleHow to access URL helper from rails module
I have a module with a function. It resides in /lib/contact.rb:module Contact class << self def run(current_user) ... end endendI want to access the URL helpers like 'users_path' inside the...
View ArticleShould I still bother to recompile my ruby executable with `jemalloc` on ruby...
It's been a quite while since I've worked with Ruby, and this used to be a standard step in my dev environment setup.I don't seem to see any references to recompiling with jemalloc that are from the...
View ArticleSetting App prices using Price Point Id (Appstore Connect API) for new Apps
I am building a script to upload new apps to store via fastlane. However, fastlane currently faces issues with setting prices for newly created apps.SO I created ruby scripts to do it manually via...
View ArticleC Compiler error with Lion and Newly Installed/Updated XCode
I am trying to set up RVM with Ruby 1.9.3-p0 and when I run$rvm install 1.9.3I get:ERROR: Error running ' ./configure --prefix=/Users/zkidd/.rvm/rubies/ruby-1.9.3-p0 --enable-shared...
View ArticleRuby Exerb: missing File class
I this working Ruby code that i want to make an executable from with exerb on a windowspc.When i compile hello_world.rb there is no problem running the executable but with this code Exerb creates my...
View ArticleShare Models between 2 Rails API's (Separate Applications)
I'm currently building 2 API's using Ruby on Rails. One if for reading (finding objects, querying) and the other one is for actually writing to it, involving a kind of complicated process with queues...
View ArticleWhy is there no "returnif " that could replace (and optimize) the pattern...
I often find myself typing this pattern for a variety of reasons:return <expr> if <expr>Not only does this seem wasteful, but if has any sort of evaluation time, then it makes more sense to...
View Article