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
364 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
764 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
2answers
458 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 ...
3
votes
3answers
634 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
656 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
294 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
1answer
212 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 ...
3
votes
2answers
258 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
761 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
844 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
157 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
183 views

Splitting up a Rails/Ruby app onto multiple servers

We recently moved a large application to two machines, both running the same codebase. I. Machine A Web server for public facing application Receives web hook call backs from our ESP Handles a ...
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
475 views

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

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
337 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
620 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
4k 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 ...
2
votes
1answer
136 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
2answers
426 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
2answers
120 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
2answers
108 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
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
294 views

Questions for Architecture with Ruby and Java [closed]

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
273 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
69 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
78 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
2answers
250 views

Need advice on design in Ruby On Rails

For personal educational purposes I am making a site for a conference. One of the object that exist in a conference is a session, which has different states and in each state it has slightly different ...
2
votes
3answers
830 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
482 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
297 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
2answers
114 views

Auxiliary space complexity of map vs map!

I'm curious about the difference in space complexity between map and map! in ruby. If I have the methods: def mult_by_two(arr) arr.map {|i| i * 2 } end def mult_by_two!(arr) arr.map! {|i| i * 2 ...
2
votes
1answer
166 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
482 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
576 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
471 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
3answers
330 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
1answer
355 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
148 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
436 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
3answers
163 views

Which is the convention in Rails to perform calculations and display the results?

So I'm working on a personal project on Rails to learn more about this framework, and I wanted to add a feature in which the user choose a particular record from the view, and after some calculations ...
2
votes
4answers
469 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
69 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
536 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
121 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
1answer
177 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, ...
2
votes
1answer
142 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 ...
2
votes
1answer
198 views

Semi-securely storing data in a remote key-value store, ensuring minimal data corruption/tampering

I'm bashing around a few ideas for storing usage data (similar to google analytics) for some Javascript products that we are working on. Unfortunately as yet we don't quite know 100% what data we ...
2
votes
1answer
98 views

focusing on a language itself VS focusing on language + CS

So, I've been working on Ruby with the goal of self-employment (I'm an impoverished philosopher (not even in university!) and can't get a normal low-paying job). But there is a quandary in my road of ...