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

3
votes
2answers
818 views

How to match responses from a server with their corresponding requests?

There is a server that responds to requests on a socket. The client has functions to emit requests and functions to handle responses from the server. The problem is that the request sending function ...
3
votes
3answers
2k views

Ruby IDE code completion [closed]

I just started writing some ruby in my spare time and am currently using Netbeans 7 with the Ruby and Rails plugin v0.111. I'm primarily a Java programmer coming from IntelliJ and Eclipse. One ...
3
votes
2answers
331 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 ...
3
votes
1answer
480 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 ...
3
votes
3answers
593 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?
3
votes
3answers
559 views

Do mixins create coupling with Ruby?

Let's say I have the following architecture: module Keyring @keyring = Keyring.new class Keyring def key def add_key def update_key def remove_key class ...
3
votes
1answer
277 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 ...
3
votes
2answers
234 views

Managing constants in application

Our application is having 2 parts a web app running ROR and a web service running Sinatra. The application communicates with the mobile device for which we use different constants depending on the ...
3
votes
3answers
718 views

API Development - Sinatra?

I've been tasked to create a mobile application as well as an accompanying website. Both the application and website will interact with the same database. To make things easy, I figure creating an API ...
3
votes
1answer
587 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 ...
3
votes
1answer
130 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 ...
3
votes
0answers
47 views

Is this code solid? If it's not why not? And how should the dependencies be managed? [closed]

I am very interested in following the SOLID principles of writing code, but for the life of me I consistently run into more questions than answers. One of the questions I have now related to the code ...
2
votes
3answers
1k views

Which framework should a ruby beginner start with: rails or sinatra? [closed]

What is the best framework for start: rails or sinatra? I heard that sinatra is more flexible but rails has a lot of documentation and tutorials. What's your choice?
2
votes
4answers
452 views

Will I be majorly disadvantaged learning Ruby with Rails version prior to 3?

I'm on a shared hosting account which runs cPanel, pretty standard unless you have your own VM. cPanel currently doesn't support Rails 3. My flat mate who has been working with ROR for the last year ...
2
votes
5answers
1k views

Ruby and Enterprise. Any future? [closed]

After Heroku acquisition by SalesForce, is there any chance for Ruby being adopted in enterprise development? If you know any good examples already, please point to them.
2
votes
2answers
2k views

Ruby - when to use instance variables vs parameters between methods?

I'm writing several methods that call other methods. To pass the information I have a couple of choices: Pass the information as parameters Set instance variables so that other methods can access ...
2
votes
2answers
321 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
5answers
2k views

Ruby freelancing: realistic expectations?

I'm in a situation where I only need $100 to live at a place. How is this relevant to programming? Well, I would like to hear the opinions of those on this site if it is at all realistic to expect a ...
2
votes
3answers
599 views

Starting my first RoR project, what JS library is good to go with it?

I'm starting my first Ruby on Rails project as I've been excited about the language for quite a while now and I'm sick of writing PHP. I've gathered that rails is pretty much an automation framework ...
2
votes
1answer
127 views

How to create html pages which don't change very much and not very often?

I have a Rails server that connects to a json API on another server to get data to build the pages dynamically. These pages, however, don't change very much and not very often. I was thinking I could ...
2
votes
1answer
318 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
2k 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
1answer
632 views

Good resources for learning Rails? [duplicate]

Possible Duplicate: Is there a canonical book on Ruby on Rails? I just finished working through Peter Cooper's "Beginning Ruby". So now I've got a reasonable grounding in the Ruby language ...
2
votes
2answers
114 views

How to check robustness in a service that includes multiple points of failure in workflow, including FTP

As part of my workflow, I need to do all these steps in one transaction - I need to ftp files to 2 different FTP servers. - There is also a spreadsheet that gets generated which needs to be FTP'ed. ...
2
votes
3answers
186 views

Is there a reason for the crossover from the Ruby community to the Clojure Community?

When we look at the the overlap between the Ruby Community - we see the following overlaps: Think Relevance (now Cognitect) has switched from Ruby to Clojure Jay Fields has switched from Ruby to ...
2
votes
2answers
97 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). ...
2
votes
2answers
203 views

Questions for Architecture with Ruby and Java

I am in the research phase of a project that needs to make use of 3rd party libraries that are in Java so I am stuck using Java to at least a small degree. I am considering implementing Ruby as the ...
2
votes
3answers
251 views

Recomendations for Front-End to Programming Transition

I am a front-end developer seeking to add programming to my skillset. As with all things, I'm sure that practice and practical application will aid me most, but I am currently having trouble wrapping ...
2
votes
1answer
45 views

BloomFilter in ruby should have k hash functions

I am reading the Bloom Filter implementation written in ruby. It should have k hash functions, but it looks like the same hash function is being used with different seed values. Is this a common way ...
2
votes
2answers
135 views

What kind of exception to ask for out of range arguments?

What type of exception should I throw? I have a console class which describes rectangle of cells which a user can index by passing in a coordinate: width, height = 80, 25 console = ...
2
votes
3answers
560 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
3answers
451 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 ...
2
votes
1answer
267 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 ...
2
votes
1answer
50 views

Is a guardfile part of the private developers environment or the public OSS project?

Let us say I have an open source project on github. Now I wish to include tools required to develop the project so others can easily contribute. It is hard for me to tell when these tools should be ...
2
votes
1answer
487 views

Is there a representation for mixins or traits on UML?

Is there a representation for modern programming constructs that are becoming common in modern OOP/hybrid languages like mixins/traits/categories/partial classes ?
2
votes
2answers
10k 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
1answer
153 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 ...
2
votes
1answer
459 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 ...
2
votes
1answer
415 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"?
2
votes
1answer
317 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
2answers
416 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 ...
2
votes
3answers
300 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 ...
2
votes
2answers
903 views

Ruby Drag-n-Drop IDE and Ruby programming related [closed]

I am writing a small desktop GUI application using Ruby and Gtk2. I am using RubyMine 3 on Linux (Fedora). I created a simple class to create a Gtk Window but now I feel it takes more time to just ...
2
votes
1answer
337 views

Are Blocks Second-Class Citizens in Objective-C (vs. Ruby)?

Feeling slightly witty the other day, I wrote an eachWithIndex: method in a NSArray category. It has a typedef like this: typedef void (^processItem)(id item, int index); and the method looks like ...
2
votes
1answer
142 views

What comes first, the ruby chicken or the homebrew egg?

Whilst installing Ruby on OsX I noticed I could do so by using a package manager called Homebrew. This seemed like an easy option, so I took it. Everything worked smoothly. Life was good. Being a ...
2
votes
2answers
416 views

Is a Ruby 'Web App' designed differently than a PHP 'Web Site'?

From my understanding, Ruby is a language that can be used to creat desktop applications. How does this get converted into a 'Web App' - and is a 'Web App' really any different than a Web Site with ...
2
votes
4answers
288 views

Test Doubles, Mocks and Stubs - when not to use & why, for Ruby, Rspec

I've learned about mocking and stubbing and I've seen how they can help me create great test suites that run blindingly fast and thus speed up my development process hugely. However I've also seen ...
2
votes
1answer
67 views

scoping concern when dealing with coupling

I'm learning ruby (and OOP in the process) and I find keep having to write the same patterns when logging progress so I want to wrap this up in a logging library that my other code can then just pass ...
2
votes
1answer
380 views

Rails: Useful example of delegate and Law of Demeter

I am currently learning about delegate and the Law of Demeter. I understand the Law of Demeter, but I can't seem to find a good example of where using delegate to avoid breaking the law would actually ...
2
votes
1answer
116 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 ...