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

learn more… | top users | synonyms

1
vote
4answers
202 views

Until what point should I refactor? [duplicate]

What do you think until what point should a programmer refactor the code? Basically having def method do_something end Pieces of code would be handy, but they increase spaghetti code until the ...
4
votes
3answers
1k views

How can web development bootcamps deliver on their promise? [closed]

I came across the concept of web development bootcamps, these 9-10 week intensive crash courses claim to teach beginners web development and help them get 80k starting salary jobs. Many of you might ...
0
votes
0answers
112 views

Ruby Capybara HTML DOM Issue

I am trying to get the links from Google adverts that appear in a webpage in programmatic manner. I have been testing Ruby and Capybara but I have an issue where the DOM as stated by Capybara is not ...
2
votes
1answer
113 views

Storing different algorithms and using them for demonstration

I have an app for creating simple graphs (the kind with vertices and edges) and then using different algorithms on them (BFS, DFS, topsort, Prim's etc) for demonstrating how they work. I'm now ...
2
votes
2answers
93 views

Should I put the datatype of a class attribute in its name?

Most of my system's class attributes are just text, but in this case it makes more sense to place this particular class's attributes into one single hash (from a "keep the source code pretty" aspect). ...
7
votes
2answers
640 views

Is it considered bad practice to compile into Javascript as a matter of language preference? [closed]

I understand that compiling into Javascript is sometimes necessary and even in some cases results in a faster application. However I'm wondering if compiling into Javascript, for building web ...
1
vote
4answers
166 views

Efficient way of evaluating an array of strings then add to an array in Ruby

I am looking for an efficient way of evaluating an array of strings against a series of rules and then adding them to another array. For example I have an array of strings: something a 1234 #gohere ...
1
vote
2answers
337 views

Ruby: Multithreading a CSV with output

I have a script written in Ruby that has maxed out a core in my server's Xeon processor for the last 2 hours. Since it's currently only using 1 of four possible cores, I want to try and rewrite the ...
2
votes
2answers
6k views

What should I learn to be backend web developer? [closed]

I want to be a web developer and because I don't want to get into designing (and stuff like that) so I thought I should become a backend developer (also more suited because of my course i.e. b.tech in ...
2
votes
3answers
433 views

What to use in UML for included module in ruby?

I like to create simple class diagrams for my projects. Most of the time I just use composition, inheritence and associations. IMB's basic UML resource tells all about this. However I'm using ruby so ...
2
votes
1answer
260 views

How do I test this?

I've attempted test first in Ruby on Rails using Test Unit and RSpec. I'm wondering how to do test first in situations that are more closely tied to the OS/filesystem. Problem: Building a USB stick ...
2
votes
3answers
431 views

Is the Observer pattern adequate for this kind of scenario?

I'm creating a simple game development framework with Ruby. There is a node system. A node is a game entity, and it has position. It can have children nodes (and one parent node). Children are always ...
6
votes
3answers
281 views

Is there any situation in which it would be appropriate to use unless… else?

This construction is considered wrong unless #.. else #.. end This is for the general reason of double-negative confusions. It translates to: if not #.. if not not #.. end We all agree ...
1
vote
1answer
290 views

ruby-idiomatic hashes vs arrays

So I am still fairly new to ruby, though I have noticed that it is very hard to create 2d-array and that hashes seem to be more of the go to data structure than arrays. I was wondering why the Ruby ...
2
votes
1answer
113 views

How do I know when should I package my classes in Ruby?

In Ruby, I'm creating a small game development framework. Just some personal project - a very small group of friends helping. Now I am in need of handling geometric concepts. Rectangles, Circles, ...
0
votes
1answer
186 views

Algorithms for Data Redundancy and Failover for distributed storage system?

I'm building a distributed storage system that works with different storage sizes. For instance, my storage devices have sizes of 50GB, 70GB, 150GB, 250GB, 1000GB, 5 storage systems in one system. My ...
-1
votes
4answers
1k views

What can I do with Ruby beside RoR? [closed]

Beside RoR, what do people use Ruby for? Is there any use for Ruby on Windows platform? If you use ruby for scripting why not use Bash or Powershell?
-2
votes
2answers
177 views

What is the general concept name for mocks and stubs? - RSpec [closed]

Is there a common concept name for mocks and stubs? What word should I use when speaking over both of them?
7
votes
2answers
251 views

How to share control of links/domains on an open source project with many collaborators?

I'm trying to help the Rebol project re-engineer its web presence now that it is open source as Apache 2 — after nearly two decades of proprietary license! The language's creator currently has ...
0
votes
0answers
103 views

How do I test my non-Ruby website using Ruby?

I would like to build some Ruby tests to test my non-Ruby website. I love the Ruby testing tools (webrat, capybara, etc.) but they seem to be targeted to testing local sites. How can I use these ...
2
votes
1answer
144 views

How do I distinguish between things belonging to the standard library, specific gems, and those that are user-generated in Ruby?

I'm a beginning programmer, that for various reasons is using an existing Ruby codebase to learn to program. My goal is to be able to understand and eventually extend this codebase. However, I find it ...
0
votes
2answers
165 views

Why there is much more support for closed xls format in rails (and ruby) than to an open ods format?

It is little depressive, but it seems to me that there is much more support for manipulating ugly proprietary closed format like xls in rails (and ruby) in general that to documented open Open ...
0
votes
1answer
280 views

Benefits of using XML builder vs templating language like ERB?

I'm doing a lot of work with XML, our legacy XML generators use the ruby template language ERB to create the XML files. I've been experimenting with Nokogiri and the builder model of creating XML, but ...
4
votes
1answer
160 views

Order collisions in ecommerce

Suppose I have a web app where sellers add their products and set them as available for sale. Then I show a list of products in my mobile app, where I get products via my REST API. My problem: suppose ...
0
votes
3answers
426 views

Why would you want to use an array, or hash as hash key in ruby?

i'm using Ruby 1.9.3 I figured out that you can use an array, or a hash as hash key in ruby: h = Hash.new h[Array.new] = "Why?" h[Array.new] # Output: "Why?" h[Hash.new] = "It doesn't make sense" ...
3
votes
2answers
317 views

Getting practicality of PHP from Ruby or Python

I have a rather odd problem. I love the practicality of PHP - specifically that I can fairly safely assume that on any random server I'll have access to the MySQL libraries, and that I can go between ...
1
vote
1answer
3k views

Why does gmail use java? Is there really a advantage over something like php or python? [closed]

Note: I know that none of you (probably) work for google, so this is a lot more of a conceptual question. So yeah, i discovered that Gmail uses java and that got me thinking, Why? I personally never ...
1
vote
3answers
310 views

Is there any situation when there's no alternative to instanceof?

It seems to me that instanceof comes from the land of functional programming and is a watered down version of pattern matching and that the OO altenative to it should be dynamic dispatching. In OO ...
4
votes
1answer
410 views

Is it possible to write a code without class methods, globals, and class variables? [closed]

I'm designing my own programming language for fun, and I'm thinking of making it fully Object-oriented (no statics, no globals, no class variables, no class methods), so I need to find a way to ...
2
votes
1answer
275 views

How does dependency inversion principle work in languages without interfaces?

In C#/Java, the dependency inversion principle is often demonstrated by high-level classes that depends on an interface/abstraction (that it owns). Low-level classes will implement the interface, thus ...
2
votes
1answer
250 views

Attempt at understanding the double-dispatch pattern

I've been trying to grok the double-dispatch pattern and having a hard time. I finally attempted a sample program to help myself understand. Here's the gist. But then I decided to attempt it without ...
0
votes
1answer
262 views

Online stores service design

I am designing an online store service app with rails. Everyone who wants to make his/her own store can do it with this app by just signing up and choosing a domain. I want to make it as SaaS as it ...
9
votes
3answers
378 views

Is Non-Deterministic Resource-Management a Leaky Abstraction?

From what I can see, there are two pervasive forms of resource-management: deterministic destruction and explicit. Examples of the former would be C++ destructors and smart pointers or Perl's DESTROY ...
1
vote
1answer
201 views

Should an open source gem contain .rvmrc?

Using .rvmrc seems to be considered a best practice for apps. But should an open source gem contain .rvmrc in their source code on Github? I think it's not good to require everyone who wants to ...
2
votes
1answer
430 views

Ruby manager for Windows: Is Ruby's PIK alive or dying?

At first, please forgive probably offtopic and/or notconstructive question, but I truly have no idea where to ask it. At first I targetted StackOverflow there's at least some PIK-related traffic ...
1
vote
1answer
119 views

Building an RPC framework

I'm curious about what it takes to build a simple and robust RPC framework. I've only looked at a few ruby frameworks but they are all lacking in some way. What I want out of an RPC framework is some ...
2
votes
1answer
362 views

When can one call themselves a “Rubyist”? [closed]

I was wondering what that term even meant. Is it something to do with one's amount of knowledge about the Ruby language or just the plain idea of using it. When can one call themselves a "Rubyist"?
20
votes
5answers
986 views

How to avoid giant glue methods?

In my current job, I've been tasked with cleaning up old code a few times. Often the code is a labyrinth and the data behind it is even more tangled. I find myself combing out things into nice, ...
4
votes
3answers
249 views

Is there an idiom for a loop that executes some block of instructions between iterations? (In Ruby in particular)

I often need to do some operations in a loop and some other operations between the iterations. A simple example would be collecting words from an array into a string, spelled backwards and separated ...
1
vote
3answers
844 views

Setting up a simple Ruby\Rails environment

I am coming from a .NET background and beginning my journey into the Mac OSX\Ruby\Rails environment. A lot of the resources I have found such as this one have between 5-10 steps for setting up a ...
2
votes
2answers
302 views

How to fix bad fundamentals? [closed]

I am a native PHP developer, and have been for about a year or so. I love PHP and it was very easy for me to learn, but I have developed some bad habits along the way due to never having a formal ...
2
votes
1answer
263 views

Does it make sense to create a Ruby wrapper to reference a Java object that does exactly the same thing?

I am using JRuby. In my Java code, I have a class called Texture, capable of doing some graphic manipulation stuff. In my Ruby code, I will usually need to draw things, so though I should simply ...
2
votes
1answer
1k views

What is a closure and how is it implemented in Ruby?

In the context of the Ruby programming language, what is a closure and when do you use one? What are the uses for it in Rails?
2
votes
2answers
3k views

How to execute a Ruby file in Java, capable of calling functions from the Java program and receiving primitive-type results?

I do not fully understand what am I asking (lol!), well, in the sense of if it is even possible, that is. If it isn't, sorry. Suppose I have a Java program. It has a Main and a JavaCalculator class. ...
0
votes
3answers
216 views

Render Ruby object to interactive html

I am developing a tool that discovers network services enabled on host and writes short summary on them like this: init,1 └── login,1560 -- └── bash,1629 └── nc,12137 -lup 50505 { ...
-2
votes
1answer
156 views

Where can I find out about basic python usage, cli, editor and testing? [closed]

I'm coming from Ruby / Ruby on Rails to Python. Where can I find or find resources about: The command prompt, what is python's version of 'irb' info and recommendations on editors, plugins and IDE's ...
0
votes
1answer
172 views

Should tests be in the same Ruby file or in separated Ruby files?

While using Selenium and Ruby to do some functional tests, I am worried with the performance. So is it better to add all test methods in the same Ruby file, or I should put each one in separated code ...
3
votes
1answer
496 views

combining ruby and C++

I've been discussing a conceptual project with a friend of mine and the the most effective way we've seen of doing it is writing the engine in C++ while the logic would be done in Ruby. However, we ...
0
votes
2answers
205 views

Question about initial interview for job [closed]

So I feel kind of stupid having to ask this but tomorrow I have a phone interview with a good company. Phone interviews themselves not a big deal for me, but having to tell them my salary ...
8
votes
1answer
679 views

Classless tables possible with Datamapper?

I have an Item class with the following attributes: itemId,name,weight,volume,price,required_skills,required_items. Since the last two attributes are going to be multivalued, I removed them and ...