I was reading about Go, and I can see that it's very good and can be a language used by many developers in some months, but I want to decide a simple thing: Learn Go or improve my Python or Ruby knowledge?
Years developing with Python: 1
Years developing with Ruby: 0.3
...
When working in interactive python, I tend to rely on the builtin help() function to tell me what something expects and/or returns, and print out any documentation that might help me. Is there a ruby equivalent to this function?
EDIT
I'm looking for something I could use in irb. For example in interactive python I could type
>>> help(1...
On unix symlinks are pointers to another file. Not only the file but also the symlink has a ctime, mtime, …. I know the symlinks time can be accessed, as ls displays it. If I use one of ruby's File#ctime, File#mtime, …, I always get the attribute of the file the symlink is pointing to, not of the symlink. How can I read this values in ru...
Greetings!
As part of Ruby learning, I am working on a project that involves procedural generation, namely terrain generation and such. It happens to be in Ruby, however after the long weeks of searching and experimenting I am turning to you lot with the question or, more accurately, a plea. This is a two-fold question.
Are there any ...
I am trying to return an intersection of datamapper collections relating to tagged topics.
Before we go any further I should point out the obvious:
@tags = Tag.all(:title => ["shim", "sham"])
@tags.topics
This returns a UNION which means I get all topics with either 'shim' or 'sham' as a tag.
What I want to do is return all articles...
I need to spend some serious time reading about changes in Ruby 1.9.1 and upcoming Rails 3/Merb. Can people suggest any articles to read?
Not really looking for one answer, just kinda looking for a compilation of resources people are using to keep up with what's coming and what currently exists, so if you stop by, let me know what you'r...
Hello everyone.
I am trying to settle on a GUI framework for Ruby and I have yet to decide which one I prefer and would like some input. I mainly want to pick the framework with the most support and community involvement. I have shied away from Shoes because the site is down and because I would like some challenge and understanding of w...
Hi there,
Chef from Opscode seems to be really useful for configuring servers and such, but trying to follow their documentation is a little difficult. Some terms are defined after they are used, and definitions sometimes reference new terms that you haven't yet encountered.
Anyone know of any GOOD tutorials/walk-throughs for getting a ...
Hi All,
I need the API integration for the following site
1] alamo car service
2] avis car service
3] thrifty car service
4] hertz car service
If any one know anything regarding any of the above please reply.
Regards,
Salil
...
Is there a cleaner built-in way to do this?
ree> Pathname.new('/path/to').children.select{|e| e.directory?}.map{|d| d.basename.to_s}
=> ["test1", "test2"]
Ideally I would like to avoid the directory? call
...
Let's say I'm using irb, and type a = 5. How do I remove the definition of a so that typing a returns a NameError?
Some context: later I want to do this:
context = Proc.new{}.binding
context.eval 'a = 5'
context.eval 'undef a' # though this doesn't work.
...
I'm a web developer proficient in HTML, CSS and Javascript, but to be able to develop my own web applications, I'd like to learn a programming language besides PHP.
I've been learning Python for a while now but it seems a general purpose language, a bit complex, and not suited for web-development I guess.
So if my focus is creating we...
I'm creating an XML document: I want to unit test at least to make sure it's well-formed.
So far, I have only been able to approximate this , by using the 'hasElements' in the REXML library.
Is there a better way ?
Preferably using built-in libraries (I mean libraries that ship with the standard Ruby 1.8.x distro).
require "test/unit"...
Hi,
I'm working on a ruby on rails project which is developed by someone else rails expert. I don't know ruby well. So while i modifying the existing project, i could not fix a bug because i didnt understand few lines code. It will be great if someone explain. Here are the codes -
on my home controller - home_controller.rb
class Home...
I use MAMP for PHP/MySQL.
What do I need for RoR?
I am using OS X Leopard. I have already installed Ruby, Gems and Rails.
...
I found that I only can @products in the views/products/ folder, I can't call the @products in other position, like views/store ..... .... If I want to use the @products in the view/store, wt should I do? apart from calling /views/products.
...
I'm developing a Ruby on Rails app where one of my database tables has 10 columns (pile_1 through to pile_10). It would be convenient to access these columns in the model as a 10-element Array.
It feels like I should be able to coerce composed_of into doing what I want, but I can't figure out how. Can anyone enlighten me, or suggest a b...
This works quite nicely - just wondered if there are any improvements to shorten it ?
if (ARGV[0].nil?) then
input=$<
else
input=File.new(ARGV[0],"r");
end
...
# Do something with the input here, for example:
input.each_line do |line|
puts line
end
...
In one of my templates I want to take a closer look at the controller object using the debug() helper.
It is said to produce YAML suitable for HTML output.
Running <%= debug(controller) %> does, however, not produce anything I call readable.
It begins with:
#<ClubsController:0x104467378 @_request=#<ActionController::Request:0x1044676...
I'm working with a Rails 2.2 project working to update it. I'm replacing existing fixtures with factories (using factory_girl) and have had some issues. The problem is with models that represent tables with lookup data. When I create a Cart with two products that have the same product type, each created product is re-creating the same pr...