Skip to main content

Questions tagged [ruby]

Questions about Ruby, dynamic, reflective, general-purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.

4 votes
1 answer
361 views

I'm reading the book The Secret Life of Programs by Jonathan E. Steinhart. In it, he mentions in passing: many consider the handling of whitespace in Ruby to be a replay of of a mistake in the ...
tsvallender's user avatar
-1 votes
1 answer
877 views

I'm working a project where I found another developer wrote a method as you see it below. How would I clean those IF statements and refactor this method. Also is it ok ti set a variable to nil ? def ...
egyamado's user avatar
  • 117
6 votes
3 answers
4k views

Currently working on a Ruby-on-Rails codebase, testing is done with Rspec. We use BuildKite to run tests. We are in a situation where sometimes tests will fail, and upon a retry or two, pass. AKA, we ...
Julien Chien's user avatar
1 vote
1 answer
247 views

I am building a simple application built in Rails that allows the client to connect to a third party api to sync customer data. The customer inputs their username and password and my application ...
Joe Ainsworth's user avatar
-1 votes
1 answer
780 views

I am building the initial set of unit tests for my team's legacy API client system. We have been writing integration tests, but have no unit tests. It's a Sinatra server that accepts requests from our ...
Eric's user avatar
  • 107
2 votes
2 answers
163 views

Maybe that's simple, but it confuses me. I have such a code now: describe VarnishLogExaminer::Entry do let(:entry) do file_string = File.read('./spec/assets/varnish_example.xml') ...
Karol Selak's user avatar
0 votes
0 answers
103 views

We have several Rails applications using the same ActiveRecord, Book. For simplicity let us assume we have only these two: BookWarehouseApp (that deals how new book are added, or other inventory ...
sunless's user avatar
  • 151
-4 votes
1 answer
192 views

How to tell if we have unused require expressions? For example: require 'colorize' require_relative './helpers' puts 'Hello, world!' This is a very simple example but there can be larger/complex ...
MauricioRobayo's user avatar
1 vote
0 answers
31 views

I'm trying to figure out the best way to "partially" use the validates_uniqueness_of validator for a particular case of problem. Let's say I have a Book class with multiple comments, with the Comment ...
dtynan's user avatar
  • 19
-1 votes
1 answer
80 views

I am writing an implementation of a binary search tree and in doing this I need a method that splits an array in two. I am unsure where it is appropriate to place this method. What I mean by "where ...
fossegrim's user avatar
  • 123
1 vote
1 answer
355 views

I built an audio processing web app using Rails. The user uploads a song to the website. The song is then decomposed into individual elements and then modified and recombined. I am using a an open ...
musicjackx's user avatar
1 vote
2 answers
941 views

Maybe that's simple, but I'm a little confused. I have such a Ruby code: def my_function(found_objects) # ... if found_objects.second return CoreObjectFactory.get_object(found_objects.second,...
Karol Selak's user avatar
0 votes
0 answers
53 views

I am working on a little project which essentially allows me as the administrator to upload new products to the app (each product would be a video explaining product) which would have its own specific ...
justlivinglife's user avatar
9 votes
2 answers
472 views

I am working on a project where clients are able to create objects in a database. Each of these objects has a description string that describes the object. Let's assume we are looking at an object ...
wsg's user avatar
  • 199
1 vote
1 answer
84 views

I have a class that looks like this: class MyClass # takes an array of actions def initialize(actions) @actions = actions end def act @actions.each {|a| a.do} end end class ...
ivanibash's user avatar
  • 143

15 30 50 per page
1
2 3 4 5
20