First  |  Prev |  Next  |  Last
Pages: 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
Golf on CLI code
I have a registry (array) of CLI classes. Each class has a class method cli() that returns an array of strings or regular expressions to match against ARGV to see if it is the chosen cli. Eg. class FooList << CLIBase def self.cli ; ['foo', 'list'] ; end ... end So if someone puts on the command ... 13 Jul 2010 13:07
extending a core class cleanly
David Masover wrote: What kind of surprises? Coming from conventional programming environments, one might be surprised when a core class suddenly acquires new methods -- e.g. Rails/ActiveSupport's extensions to String -- so I wanted to make sure I was packaging such extensions properly. Simple enough... 6 Jul 2010 21:08
extending a core class cleanly [noobish alert]
Assume I'd like to create a statistics package designed to work on Arrays [but see P.S.]. One way to do this would be to create functions that take an array as an argument: def mean(array) return NaN unless array && array.size > 0 array.reduce(0.0) {|accum, val| accum + val} / array.size end ...... 6 Jul 2010 03:33
undefined local variable or method `code_words' for main:Ob
I have the problem: undefined local variable or method `code_words' for main:Ob I'm trying to work on an example from the Why's poignant guide to Ruby, and don't know why I'm getting the preceding error. I just made some small changes in the example, and they are not related to the syntax, just the fill outs... 6 Jul 2010 07:51
name correspondence
Thomas Sawyer wrote: Library: foo-bar Directory: lib/foo/bar Namespace: Foo::Bar Library: foo_bar Directory: lib/foo_bar Namespace: FooBar That being the case I think Ruby needs to include methods to make it easy to translate between these. In ActiveSupport these ... 5 Jul 2010 15:31
File data extraction
[Note: parts of this message were removed to make it a legal post.] Hi I have a file with the following format (example): Save Format v3.0(19990112) @begin Libraries "felles.pbl" ""; @end; @begin Objects "n_cst_xml_utils.sru" "felles.pbl"; "n_melding.sru" "felles.pbl"; @end; The data in the two b... 7 Jul 2010 05:46
How to POST Form Data?
Hello, I am trying to post the form (http) from the below html "test.html" and am using the below ruby code "submit_test.rb" to submit the form but getting html response page with message "Unhandled Request: The server is not setup to handle this type of Request:" instead of search result from keyword "technolog... 5 Jul 2010 04:33
speeding up "gem1.9 install" during development
During development, I keep running rake install. The following command often takes a minute to execute, although the gem is created in a second. gem1.9 install ../pkg/xxxx.gem Running --trace doesn't help at all since no details come after the above line. Is there any way this can be speeded up. Do others u... 5 Jul 2010 15:31
Charset Detection
Is there any existing functions or external gems that can take a generic string and parse for charset markers, converting that parts of the string to their appropriate charsets? For example, theres an email with the headers Date: Sat, 03 Jul 2010 04:00:29 EDT From: =?iso-8859-1?B?U0FU?= <CollegeBoard(a)noreply.col... 5 Jul 2010 06:42
redirect_to(user_contacts_path(@current_user)) error
[Note: parts of this message were removed to make it a legal post.] Couldn't find Contact without an ID 2010/7/4 Kenneth <ken70r(a)gmail.com> can you provide the error message??? also you can dry your code a little bit... if params[:commit] == "upload and import contact" if params[:... 4 Jul 2010 23:09
First  |  Prev |  Next  |  Last
Pages: 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63