Rspec, how to expect to receive with only a subset of key value pair?
I have a spec that expects a class to receive a method with some arguments. I only want to check for a subset of key/value pair from the argument hash : it 'calls Stripe::Checkout::Session#create with...
View ArticleWhy do we need is_current_comment here?
Why we need is_current_comment?Why the comment could be not...
View ArticleBundler Error - Cannot Find rake-13.0.1 even though it is installed
I have a Rails import job that run as a cron job setup through the whenever gem. It was running correctly until I recently updated the app. Now we are seeing the following Error in the logs when the...
View ArticleSolution to develop ruby on rails from phone [closed]
I've blocked from quora due to censorship.What is the best solution to develop ruby on rails remotely from phone?
View ArticleFlash message view component rendering :type as a :message?
I have followed this post https://reinteractive.com/articles/how-to-create-flash-messages-in-Rails-7 to add nice flash messages with tailwind, which got me into View Components. Everything works apart...
View Articleconvert csv file with json data inside to a column, rows table in 2nd csv file
Ruby newbtard here...I have an csv file (logevents.csv) that has a "message" column.The "message" column contains rows of json data.Using Ruby, I'd like to convert the json data's name:value pairs to...
View ArticleHow to tell rspec to run without pending tests output?
Is there a way (maybe some key) to tell rspec to skip pending tests and don't print information about them?I have some auto generated tests like pending "add some examples to (or delete) #{__FILE__}"I...
View ArticleHow to increment the number in a string while keeping the appropriate...
I'm curious as to how accounting softwares enable incrementing "invoice number" ie from INV-001 increments to INV-002. Let's dissect by only focusing on "001".I've done some "Googling" and found the...
View ArticleRuby gem list google-auth lists the gem but gem which google-auth can't find...
According to Google Gemini the gem googleauth is deprecated due to OOB security issues and the code has been transferred to the gem google-auth. I am using ruby 2.7.0p0 (2019-12-25 revision 647ee6f091)...
View ArticleCocoapods installation failed and can't change ruby local version
MacBook Pro, macOS Catalina 10.15.7Having 2 main issues when trying to install cocoapods, first one I'm getting the error when trying to change the ruby version to 2.7.5, because im able to change it...
View ArticleSyntax for `apply` pandas function in ruby
I need to convert a python script into ruby. I use for that the gems Pandas and Numpy which make the work quite simple.For example I have these kind of lines:# python# DF is a dataframe from...
View ArticleCannot load file mysql2 on AWS Lambda
Trying to have a Lambda connect to an RDS database but can't get the mysql2 gem to load. Tried the pristine instruction but that didn't resolve the issue.I've got the built mysql2 gem in the vendor...
View ArticleRuby class constructor using `()` rather than `.new()`
Please do not ask me "why do you want to do this?" I'm just exploring the nooks and crannies of Ruby, with no specific goals in mind.Some Ruby classes can be instantiated with just parentheses rather...
View Articleafter update of Rails6
describe 'display' do let(:user1) { create(:investor_user) } # error occurs here already it do # something end endspec/factories/users.rbFactoryBot.define do factory :user do first_name 'Mr' last_name...
View ArticleRails How To List all Images in a Folder using the image_tag?
Im trying to take all the images in the 'app/assets/images/slide' folder and put them withing tags (in order). So, it will look like this :<img src="1.jpg"><img src="2.jpg"><img...
View ArticleHow do I debug the appengine gem?
I'm deploying a ruby on rails website to Google Cloud's app engine. I've configured the CloudSQL database (more or less) and simply want to migrate the database. Google recommends I run the following...
View Articlewhen bsearch matches first element in array with 2 values it returns nil. Why?
I don't understand why bsearch method returns nil, when array has 2 values.arr = [1, 2]arr.bsearch { |el| el < 2 }
View ArticleHow to communicate with threads in Ruby?
I'm building a real time game, mostly chat based, and I need to have many of these chats running concurrently, receiving and sending data through web sockets.I have been told that instead of spawning...
View ArticleRuby backslash to continue string on a new line?
I'm reviewing a line of Ruby code in a pull request. I'm not sure if this is a bug or a feature that I haven't seen before:puts "A string of Ruby that"\"continues on the next line"Is the backslash a...
View Article