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

0
votes
0answers
330 views

Online stores service design [duplicate]

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
4answers
501 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
214 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
479 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
173 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
510 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
1k 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
278 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
971 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
332 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
438 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 ...
4
votes
1answer
3k 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?
5
votes
2answers
6k 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
249 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 { ...
0
votes
1answer
240 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
778 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 ...
8
votes
1answer
817 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 ...
6
votes
6answers
977 views

Is it okay to define a [] method in ruby's NilClass?

Ruby by default does not include the method [] for NilClass For example, to check if foo["bar"] exists when foo may be nil, I have to do: foo = something_that_may_or_may_not_return_nil if foo ...
1
vote
1answer
195 views

How do global cancel/exit commands work in bash?

As I have done multiple times before, I've written bash scripts, and just general commands that go nowhere. They just blink the little command line cursor at me for infinity until I control+C the ...
5
votes
3answers
651 views

What can procs and lambdas do that functions can't in ruby

I've been working in Ruby for the last couple weeks, and I've come to the subject of procs, lambdas and blocks. After reading a fair share of examples from a variety of sources, I don't how they're ...
1
vote
1answer
2k views

Ruby: how to step through ruby code [closed]

I'm trying to learn how to step through Ruby code (written by more experienced programmers) in order to improve my knowledge of Ruby. Problem is that I don't really know how to do it well. Googling ...
6
votes
2answers
869 views

How relevant is UTF-7 when it comes to parsing emails?

I recently implemented incoming emails for an application and boy, did I open the gates of hell? Since then every other day an email arrives that makes the app fail in a different way. One of those ...
1
vote
2answers
671 views

What is faster and preferable way for variable assignment in ruby? [closed]

I am a RoR developer and want to clarify some doubt about ruby variable assignment. In ruby we have two ways for variable assignment. str, arr, num = "Hi", [1, 2], 3 and str = "Hi" arr = [1, 2] ...
9
votes
3answers
15k views

Can we create desktop application with Ruby? [closed]

I know the Ruby on Rails framework is only for web development and not suitable for desktop application development. But if a ruby programmer wants to develop a desktop application, is it suitable and ...
2
votes
2answers
447 views

Should I prefer instance methods over class methods in Ruby?

I'm working on a rails application, and I've been pulling functionality out of my rails code and into pure ruby classes in lib/. I've found myself often writing classes like this: class ...
1
vote
2answers
977 views

Is it worth converting a Django project to Rails?

I have a project I shelved a while back- it was essentially a working web app built in django but I stopped working on it to work on something else. I plan on starting it up again in my spare time, ...
2
votes
2answers
1k views

How do I read API documentation?

I've been trying to read through the RoR API to try to learn things that the tutorial missed, and I haven't been able to follow it at all. The only time I've read documentation was when I needed to ...
2
votes
3answers
324 views

What is a legitimate reason to use Cucumber?

I've worked in several contracts where the client used Cucumber and I've often felt that the testing suite didn't really have a place in our stack. From what I understand, business ...
1
vote
3answers
272 views

Ruby/RoR development: desktop or server [closed]

Our company has started development of own systems "in-house". We already got couple of developers, who will be responsible for writing code in Ruby/RoR. We are currently discussing infrastructure, ...
3
votes
1answer
206 views

Is it possible to use RubyGnome2's/QtRuby's HTML renderers to make UI for a Ruby script?

I'd like to make a graphical user interface for my script, instead of running it from the console. I'm aware there's a wealth of UI libraries for Ruby, but I'm quite familiar with HTML and CSS and I'd ...
2
votes
7answers
8k views

How much Ruby should I learn before moving to Rails? [closed]

Just a quick question.. I can never get a definitive answer when googling this, either. Some people say you can learn Rails without knowing any Ruby, but at some point you'll run into a brick wall and ...
30
votes
7answers
5k views

Explanation on how “Tell, Don't Ask” is considered good OO

This blogpost was posted on Hacker News with several upvotes. Coming from C++, most of these examples seem to go against what I've been taught. Such as example #2: Bad: def ...
1
vote
2answers
116 views

Cataloging events, projects and tasks: Is SQL appropriate?

I have this idea for a database: it would hold everything I "need to remember", and allow future coding projects to access the information. These future projects include a day-planner and historical ...
2
votes
1answer
141 views

How to identify a PDF classification problem?

We are crawling and downloading lots of companies' PDFs and trying to pick out the ones that are Annual Reports. Such reports can be downloaded from most companies' investor-relations pages. The PDFs ...
1
vote
1answer
243 views

Ruby using the Gosu framework: why it runs slow first time?

I'm creating a Ruby game using the Gosu framework. All good. Sometimes, when I run the game, it has some kind of slow startup, and probably it will be rather slow during the whole game. So I close it ...
1
vote
4answers
273 views

If I use Ruby Migrations, do I have to use the rest of Ruby on Rails?

I'm currently trying to come up with a database migrations strategy for my organization. This includes getting the database scripts into source control, managing versioning, managing releases to QA / ...
1
vote
1answer
715 views

When to use mixins in Ruby

I am wondering when to use mixins? I have read about them. Many authors compare them to interfaces, abstract classes, etc. Mixins are modules that are mixed-in and modules are a way to group similar ...
-1
votes
1answer
810 views

What is the difference between class level attributes, Class constants and singleton methods?

What the difference given they all exist 'once per class'. When should I use one over another, i.e. for what purpose? I use Ruby.
1
vote
1answer
729 views

rails fake data, considering switch from faker to forgery, any advantages or pitfalls?

With Ruby on Rails I've usually used Forgery for generating dummy data for testing. I've noticed recently that several clients and tutorials are using Faker They both seem fairly similar in use ...
3
votes
1answer
575 views

Is the puts function of ruby a method of an object?

I'm trying to understand how the puts function fits in Ruby's "Everything is an object" stance. Is puts is the method of a somehow hidden class/object? Or is it a free-floating method, with no ...
23
votes
5answers
8k views

Return random `list` item by its `weight`

I have, for example, this table +-----------------+ | fruit | weight | +-----------------+ | apple | 4 | | orange | 2 | | lemon | 1 | +-----------------+ I need to return random ...
3
votes
1answer
150 views

Rails solution for mobile-specific content filter?

To note, I'm not interested in simply 'hiding' content for mobile devices, I want to filter out that content completely. I'm also not trying to address the issue by building a mobile specific ...
1
vote
3answers
845 views

Backtracking with Killer Sudoku

I'm developing a Killer Sudoku solver for a school project. I've programmed 10 human strategies showing what they are doing in order to be the most educational possible. It can solve hard Killer ...
1
vote
2answers
406 views

Ruby workflow in Windows

I've done some searching and quite haven't come across the answer I am looking for. I do not think this is a duplicate of this question. I believe Windows could be a suitable development environment ...
1
vote
4answers
137 views

Depend on built technology, or build your own [duplicate]

Possible Duplicate: How to decide between using an existing eCommerce solution and building your own? I am starting a ecomm business and my site idea is pretty similar in functionality to ...
12
votes
5answers
3k views

Is monkeypatching considered good programming practice?

I've been under impression, that monkeypatching is more in quick and dirty hack category, rather than standard, good programming practice. While I'd used from time to time to fix minor issues with 3rd ...
1
vote
1answer
354 views

Am I experienced enough to learn and develop immediately using Ruby on Rails? [closed]

General Question I understand that discussions revolving around questions of this form run the risk of becoming too specific to help others. So, perhaps a better, general question would be: What ...
3
votes
3answers
626 views

Why rails use yaml to config database instead of plain ruby code?

Most of configuration files in ruby such as Gemfile, gemspec, are just ruby code itself. Why database configuration file in rails is the exception?
12
votes
2answers
2k views

How does using a LGPL gem affect my MIT licensed application?

I am developing an open source ruby application under the MIT license. I am using this license because I don't want to place any restrictions on the users of the application. Also I can actually ...
6
votes
1answer
1k views

Ruby Shoes for non-trivial apps [closed]

I've been taking a look at Ruby Shoes for GUI development with Ruby. So far, it's been a pretty good experience for making simple apps. However, I am quite worried about being able to write large ...