Does Ruby Have Enums?
Duplicate of: http://stackoverflow.com/questions/75759/enums-in-ruby I am new to Ruby from a C# background, and I want to know if you can have enums in Ruby and if so, how is it done? ...
Duplicate of: http://stackoverflow.com/questions/75759/enums-in-ruby I am new to Ruby from a C# background, and I want to know if you can have enums in Ruby and if so, how is it done? ...
I have a ruby on rails app using restful authentication and I'm looking to add a Wiki to my site. MediaWiki looks like my best option since it's full featured and I can work with the LAMP stack. However, I'm not sold on MediaWiki if there's another (preferably open source) app that will integrate better. I would like to know if anyone...
I am trying to install Ruby + WATIR to a Windows server which is in an isolated environment. Typically I would run the ruby installer followed by these two commands: 1) gem update --system 2) gem install watir This is as per the instuctions here The server I am now trying to install to does not have internet connectivity. This caus...
Hi, Is it possible in Ruby to define a new non-singleton class based on a singleton class? I tried something like this (snip): module SomeModule extend self class Singleton;end end class NonSingleton include SomeModule end nonsingleton = NonSingleton.new But of course to you gurus it's already evident that this won't work as ...
In this example, do the nukes get launched because any changes that you make to buggy_logger get applied to the 'status' string - just like using a copy of a reference to an object -> when you make a change to the copy of the reference, the change gets applied to the underlying object -> that change is, in turn, reflected in any other re...
When I run... $ script/generate I get a list of installed generators and a message saying "More are available at http://wiki.rubyonrails.org/rails/pages/AvailableGenerators." However, the indicated wiki page says "This topic does not exist yet." Does there exist some central repository of downloadable Rails generators? In particular...
I get this error with gems that I install from github. I am on a XP machine. This time I installed, giraffesoft-is_taggable gem. gem list says it's there. I created a sample rails app and added config.gem "giraffesoft-is_taggable" to the environment.rb file. Start the app and I get the error: Missing these required gems: giraff...
Every text I've read about Ruby symbols talks about the efficiency of symbols over strings. But, this isn't the 1970s. My computer can handle a little bit of extra garbage collection. Am I wrong? I have the latest and greatest Pentium dual core processor and 4 gigs of RAM. I think that should be enough to handle some Strings. ...
"foo"[0] = ?b # "boo" I was looking at the above example and trying to figure out: How "?b" implies the character 'b'? Why is it necessary? - Couldn't I just write this: "foo"[0] = 'b' # "boo" ...
class MySymbol TABLE={} def initialize(str) @str = str end def to_s() @str end def ==(other) self.object_id == other.object_id end end class String def my_intern table = MySymbol::TABLE unless table.has_key?(self) table[self] = MySymbol.new(self) end table[self] end end "foo".my_intern In the e...
Which of the following technology is easy to learn and fun for developing a website? If you could only pick one which would it be and why Clojure/Compojure+Ring/Moustache+Ring Groovy/Grails Python/Django Ruby/Rails Turbogear Cappuccino or Sproutcore Javascript/jQuery ...
Is there a gem or something to parse strings like "4h 30m" "1d 4h" -- sort of like the estimates in JIRA or task planners, maybe, with internationalization? ...
I'm trying to fill the variables parent_element_h1 and parent_element_h2. Can anyone help me use the Nokogiri Gem to get the information I need into those variables? require 'rubygems' require 'nokogiri' value = Nokogiri::HTML.parse(<<-HTML_END) "<html> <body> <p id='para-1'>A</p> <div class='block' id='X1'> ...
I've been trying to understand this example Ruby code from a blog entry which says it uses the symbols :DEFAULT, :say and :@message "to look up identifiers". But from what I can tell, it's not looking up the identifiers, but the values associated with those identifiers. I thought identifiers are names of variables, methods, etc. So the i...
I would need lexers for as many programming languages I could get, and I would need them to be written in ruby. Do you know any? ...
If you create 10,000 strings in a loop, a lot of garbage collection has to take place which uses up a lot of resources. If you do the same thing with symbols, you create objects which cannot be garbage collected. Which is worse? ...
Hello. I want to create a class that has one method that calls all other methods that are not in the super class. Is there a way I can use obj.methods to only get the non-ancestral methods? Or is there another way to do it entirely. Thank you ...
What's the best way to delete duplicate records in a mysql database using rails or mysql queries? ...
I'm wanting to submit build results to hudson via a ruby script. What little documentation I can find says the data within the tag is in "hexBinary" format. How do I take a simple ruby string like "Hello, world" and convert it to that format? ...
Hi and good evening, hope someone can help. I am trying to get some sort of scripting support going. I have the following code, which executes a ruby method and returns the result. However, it is returning a "method not found error" from IronRuby itself. var engine = IronRuby.Ruby.CreateEngine(); returnvalue = engine.Operations.Invoke...