similar to: why can''t I call this without parentheses?

Displaying 20 results from an estimated 6000 matches similar to: "why can''t I call this without parentheses?"

2007 Jan 02
4
allow stubbing of previously defined methods such as "id"
On my current project I needed to create a stub that responded correctly to the id message. Here''s the change I put into my copy of head. Index: lib/mocha/mock_methods.rb =================================================================== --- lib/mocha/mock_methods.rb (revision 1114) +++ lib/mocha/mock_methods.rb (working copy) @@ -68,6 +68,7 @@ method_names =
2006 Jul 21
3
[Slightly OT] CSS with wildcard?
Sorry if this is a simple question, I''m a CSS noob. I have a rails app that is displaying posts, I am having it generate each post with its own div like "post_19", "post_20", etc. I could make it so it puts another div around that div (i need the individual post div''s for deletion with AJAX) but would rather not. Is there some way to use CSS to do
2006 Jan 06
6
Help with TextSearch :all and MySQL
Hi, I really need help with making the ''searches_on :all'' in Duane Johnson''s TextSearch work with MySQL (not sure if it works with other db''s). http://wiki.rubyonrails.com/rails/pages/TextSearch I realize that there are other search packages out there. But this particular solution best fits my small needs of searching a small database. I''ve gotten
2019 Feb 20
3
branching in extensions.conf?
Is there any less cumbersome way of doing conditionalized/branching in extensions.conf other than something like: exten => s,n,GotoIf($["${SIP}" = "PJSIP" ]?pjsip) exten => s,n,Dial(${ARG2},20,TtWw) exten => s,n,Goto(afterdial) exten => s,n(pjsip),Dial(${PJSIP_DIAL_CONTACTS(${STRREPLACE(ARG2,"PJSIP/","")})},20,TtWw) exten =>
2002 Jun 06
1
Dealing with data of varying format
I'm trying read some data files into data frames, but the formatting of their headers is creating problems when I try to reference certain columns. For instance...below I've pasted four of the headers to give an idea how they vary slightly. A 90404001 POLARSTERN GERMANY MIZEX A 819300 HUDSON CANADA
2016 Jan 04
1
deparse with parentheses for SUBSET
Hi, maybe there?s a reason for it, but the discrepancy between the handling of `[` and `$` in deparsing seems odd to me: > substitute(a[1], list(a = quote(x * y))) x * y[1] > substitute(a$b, list(a = quote(x * y))) (x * y)$b The former is still executed in the right order (`*` first, then `[`), which is not what you?d expect looking at the deparse result. Some code that shows the execution
2005 Dec 16
13
How to pass a collection to paginate?
There must be a better way to write this code: @project_pages, @projects= paginate :project, :per_page => 10, :conditions => ["account_id = ?", account] ?! If only I could pass the sub-collection account = ... @projects = account.project to paginate, instead of letting it extract it with a find :all + sql conditions Alain. -- Posted via
2005 Jan 25
2
Tall free number via FWD over IXA2
I've setup my IAX2 over FWD and it is working I can receive a test call and I can call out. Though I cannot figure out how to dial 1-800 numbers over FWD When I dial 1-800 it hangs up on me. Here is a typical session: Called xxxxx:xxxxxxx@iax2.fwdnet.net/18007425877 -- Call accepted by 65.39.205.121 (format ULAW) -- Format for call is ULAW -- Hungup
2007 Mar 12
10
using mocha with rspec
Hi folks. I''ve just started using rspec and I have to say it''s very nice. The thing is, I prefer mocha''s mocking dialect. So I thought a simple require ''mocha'' would set me up. Unfortunately, rspec does all its goodness using do/end blocks in anonymous classes, so it wasn''t quite that obvious. Anyway, here is the incantation I ended up
2019 Feb 20
2
branching in extensions.conf?
On Wed, 2019-02-20 at 11:46 -0700, John Kiniston wrote: > Use the IF function to evaluate and change the dial command directly. Thanks for taking the time, but that doesn't actually answer the question I asked. It in fact answers the caveat I specifically mentioned: > Granted the particular above example could probably be better > written to simply modify $ARG2 based on ${SIP}
2007 Mar 30
7
problem with using any_instance
Hey all, I have a question with using mocha in my tests. In the same test file, I have two tests, <code> def test_a klass.any_instance.stubs(:method_name).returns("something") klass.new.method_name ... end def test_b ... klass.new.method_name ... end </code> where klass is some class when the tests run, test _a passes, but test_b had an error like this:
2006 Jan 04
11
Query Mixin by Duane Johnson
Hello At the start of October, Duane Johnson announced the Query mixin plugin on this list. The code was attached to the announcement email. Unfortunately, I''ve not been able to locate the attached code. Goggle has not helped me this time. Could somebody forward it to me? Thanks in advance Harvey This e-mail has been scanned for all viruses by MessageLabs.
2006 Apr 20
11
dynamic mock object anyone?
Hi guys, got this problem with creating such a thing... hope anyone could help.. the problem: ok, now i have this mock object that would simulate a external rpc call. eg require ''models/xmlrpc_agent'' class XmlrpcAgent def create(params) 200 end end but the value of the value returned is fixed. which is quite hard for me to test the controller when different
2006 Aug 06
2
help with method_missing in ActiveRecord
I am serializing a data object (FooData) into an ActiveRecord column (Foo). I''d like to be able to do delegate methods to the data class if the Foo class doesn''t have that attribute. So instead of: f = Foo.new f.data.item1 I''d like to do: f = Foo.new f.item1 I was hoping that I could add a method_missing method to my Foo class and call methods in the FooData class
2006 Aug 09
2
How do you define a method
Hi all, I was wondering if anybody could help me figure why a view cannot find a method that I defined in another class. I do this in the view: (let''s say index.rhtml) <%= check_box("item_search_page", "method_name") Here, item_search_page is a variable in the view''s controller, which creates a new ItemSearchPage object. And I defined
2007 Mar 04
4
Rails functional testing and Mocha
I''ve always wanted to be able to do stuff like this in my functional tests c = customers(:customer_1) c.expects(:great_customer_service) post :service_customer, :id => c.id This of course fails because inside the rails action a different instance of customer is used. Some of the time setting your expectation/stubbing on Customer.any_instance works, but it''s not
2008 Nov 20
2
[Obo-relations] Discussion summary on "original" biological parts
mejino at u.washington.edu wrote: > > >>> A canonical human body will have canonical parts and those canonical >>> parts will >>> have canonical subparts and so on. >> >> ... and? >> >>> Can't think of anyone who would fit that >>> description. >> >> is this considered an argument for that there cannot possibly an
2007 Dec 08
6
Rails 2.0 ActionMailer breaks my redmine render_message
I am using ''redmine'' (v 0.6) as my major project manager, seems running fine w Rails 2.0 (slight modifs for paginations..) but I am stuck with a major error when sending a confirmation email : mailer.rb class Mailer < ActionMailer::Base .... # Renders a message with the corresponding layout def render_message(method_name, body) layout =
2013 Jun 19
3
[LLVMdev] Building a stable bitcode format for PNaCl - based on LLVM IR
> From the provided documentation I understood that in memory data > structures of a PNaCl program are incompatible to the host program because > ABIs are different (e.g. PNaCl pointers are always 32-bit even when running > on x86_64 platform). > So PNaCl program can't access any data structures of the host program > directly. The only communication way is by using syscalls,
2009 Apr 13
4
Creating Methods in the Model?
Hey Everyone. First day diving in to ROR and Ruby... My question is how do you define methods with in the model class and/or should I even be doing this? It is my understanding that you should put as much of the business logic into the model as possible. I want to do some data manipulation before I things are submitted to the database IE (Create a variable out of two submitted via form, as