[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Anomaly in first example of Needles, an Aspect-Oriented Programming tool

RichardOnRails

12/1/2006 3:50:00 AM

Hi All,

I intend to use Needle in my future Ruby and RoR development, so I
want to got through it tutorial at
http://needle.rubyforge.org/chap... in detail.

Following is a test of the first example. It works great except for
one anomaly: There is an output line with "nil" between the two debug
line surround the "real" body of the method. What could be the cause
of it?

Thanks in advance,
Richard

========= Test.rb ==========
# http://needle.rubyforge.org/chap...
# Log method without 'Nails'
# Class Logger: http://www.ruby-doc.org/core/classes/L...

require "logger.rb" # (In
K:\_Utilities\Ruby_1.8.2-15\ruby\lib\ruby\1.8)

def foo( arg1, arg2 )
@log = Logger.new(STDOUT)
@log.level = Logger::DEBUG
@log.debug("Created logger")

@log.debug( "in foo with #{arg1} and #{arg2}" ) if @log.debug?
result = arg1 + arg2 # The "real" body of the method "foo"
@log.debug( "finishing foo with #{result}" ) if @log.debug

return result

rescue Exception => e
@log.debug( "foo raised exception #{e.message} (#{e.class})" ) if
@log.debug?
raise
end

foo(1,2)

===== Output =======
D, [2006-11-30T22:46:41.609000 #280] DEBUG -- : Created logger
D, [2006-11-30T22:46:41.609000 #280] DEBUG -- : in foo with 1 and 2
D, [2006-11-30T22:46:41.609000 #280] DEBUG -- : nil
D, [2006-11-30T22:46:41.609000 #280] DEBUG -- : finishing foo with 3

5 Answers

Joseph Taylor

12/1/2006 10:45:00 AM

0

> @log.debug( "finishing foo with #{result}" ) if @log.debug

You forgot a question mark.

RichardOnRails

12/1/2006 4:28:00 PM

0

Hi Joseph,

Thank you very much!

Best wishes,
Richard

Joseph Taylor wrote:
> > @log.debug( "finishing foo with #{result}" ) if @log.debug
>
> You forgot a question mark.

Behringer

10/5/2010 1:20:00 AM

0


"Beam Me Up Scotty" <Then-Destroy-Everything@Blackhole.NebulaX.com> wrote in
message news:4CAA7ADF.4030609@Blackhole.NebulaX.com...
> On 10/4/2010 8:54 PM, Tab182 wrote:
>> On Oct 4, 8:33 pm, Harry Hope <riv...@ix.netcom.com> wrote:
>>> http://www.huffingtonpost.com/2010/10/04/barbour-cornyn-can......
>>>
>>> 10- 4-10
>>>
>>> Barbour, Cornyn, Cantor Lower Expectations For GOP Congress
>>>
>>> By Sam Stein
>>>
>>> With the elections approaching and the conservative base getting drunk
>>> on the idea of retaking both chambers of Congress, top leaders in the
>>> Republican Party have begun the process of trying to temper
>>> expectations for the next legislative session.
>>>
>>> The effort seemed more obvious than before last week, when National
>>> Republican Senatorial Committee Chair John Cornyn (R-Tex.) threw a bit
>>> of cold water on the idea that the new Congress would suddenly be able
>>> to rid the country of the president's health care
>>> law.http://www.huffingtonpost.com/2010/09/30/cornyn-we-need-to-......
>>>
>>> ...........................................................................?.................................
>>>
>>> On Monday, another prominent GOP leader joined the chorus of the
>>> sober-minded.
>>>
>>> House Minority Whip Eric Cantor, speaking to the Wall Street Journal's
>>> economic editor Steve Moore, offered his hope of avoiding a government
>>> shutdown -- the very same type of political brinksmanship that others
>>> in the GOP tent have
>>> cheered.http://online.wsj.com/article/SB100014240527487044830045755......
>>>
>>> ...........................................................................?..............
>>>
>>> Together, Cornyn and Cantor's comments suggest a concern within the
>>> Republican tent over what type of reality the party will confront
>>> after November.
>>>
>>> While activist enthusiasm has fueled the GOP's electoral hopes, it's
>>> also put lawmakers in a rather untenable position -- promising the
>>> base the type of dramatic political confrontations it craves despite
>>> knowing that those confrontations could take a serious toll.
>>> _________________________________________________________
>>>
>>> Hmmmmmmmmmmmm
>>>
>>> Harry
>>
>> LMFAO just imagine how hard it will be for Mitch the Bitch and
>> CantWHORE and Jimmy Demented and especially Old Drug Rush to explain
>> to the base how the Dems still have control of both the Senate and the
>> House on the 5th!
>
> Since 60% of the Nation disagree with the Democrats it will be a tough
> sell to the General population

Tough sell? Wrecking America for a Legacy? Anyone who votes Pug this Fall
is insane.



Beam Me Up Scotty

10/5/2010 1:41:00 AM

0

On 10/4/2010 9:19 PM, Behringer wrote:
> "Beam Me Up Scotty" <Then-Destroy-Everything@Blackhole.NebulaX.com> wrote in
> message news:4CAA7ADF.4030609@Blackhole.NebulaX.com...
>> On 10/4/2010 8:54 PM, Tab182 wrote:
>>> On Oct 4, 8:33 pm, Harry Hope <riv...@ix.netcom.com> wrote:
>>>> http://www.huffingtonpost.com/2010/10/04/barbour-cornyn-can......
>>>>
>>>> 10- 4-10
>>>>
>>>> Barbour, Cornyn, Cantor Lower Expectations For GOP Congress
>>>>
>>>> By Sam Stein
>>>>
>>>> With the elections approaching and the conservative base getting drunk
>>>> on the idea of retaking both chambers of Congress, top leaders in the
>>>> Republican Party have begun the process of trying to temper
>>>> expectations for the next legislative session.
>>>>
>>>> The effort seemed more obvious than before last week, when National
>>>> Republican Senatorial Committee Chair John Cornyn (R-Tex.) threw a bit
>>>> of cold water on the idea that the new Congress would suddenly be able
>>>> to rid the country of the president's health care
>>>> law.http://www.huffingtonpost.com/2010/09/30/cornyn-we-need-to-......
>>>>
>>>> ...........................................................................­.................................
>>>>
>>>> On Monday, another prominent GOP leader joined the chorus of the
>>>> sober-minded.
>>>>
>>>> House Minority Whip Eric Cantor, speaking to the Wall Street Journal's
>>>> economic editor Steve Moore, offered his hope of avoiding a government
>>>> shutdown -- the very same type of political brinksmanship that others
>>>> in the GOP tent have
>>>> cheered.http://online.wsj.com/article/SB100014240527487044830045755......
>>>>
>>>> ...........................................................................­..............
>>>>
>>>> Together, Cornyn and Cantor's comments suggest a concern within the
>>>> Republican tent over what type of reality the party will confront
>>>> after November.
>>>>
>>>> While activist enthusiasm has fueled the GOP's electoral hopes, it's
>>>> also put lawmakers in a rather untenable position -- promising the
>>>> base the type of dramatic political confrontations it craves despite
>>>> knowing that those confrontations could take a serious toll.
>>>> _________________________________________________________
>>>>
>>>> Hmmmmmmmmmmmm
>>>>
>>>> Harry
>>>
>>> LMFAO just imagine how hard it will be for Mitch the Bitch and
>>> CantWHORE and Jimmy Demented and especially Old Drug Rush to explain
>>> to the base how the Dems still have control of both the Senate and the
>>> House on the 5th!
>>
>> Since 60% of the Nation disagree with the Democrats it will be a tough
>> sell to the General population
>
> Tough sell? Wrecking America for a Legacy? Anyone who votes Pug this Fall
> is insane.

Do you really think I'm going to read the 5,000 pages of Leftist written
laws and try to guess what this Socialist Junta will do with all that
government power, and risk my principal on a business? Do you think I
should pay a lawyer to read the 5000 pages ad tell me what I can legally
do so that I'm not fined or jailed? Will the lawyer know what the
Regulators will be adding into that 5000 pages?

If I still had a running business, I would gut the business to get the
money out of it, and then run as fast as I can, away from 5,000 pages of
economic job killing, Nation wrecking pages of Socialist laws. My family
members have all sold and gutted all the businesses we had... that was
a dozen or more jobs that are gone.

You've never risked your own money to start a wealth generating company
that employs useless Socialists that like to sit on their ass and do
nothing and want to get paid for it, have you?

It will never happen, I'll never invest in your FAKE government
controlled virtual economy. "You" start a business and get rich and
hire your Socialist pals..... I need a laugh.




Tab182

10/5/2010 2:17:00 AM

0

On Oct 4, 9:09 pm, Beam Me Up Scotty <Then-Destroy-
Everyth...@Blackhole.NebulaX.com> wrote:
> On 10/4/2010 8:54 PM, Tab182 wrote:
>
>
>
>
>
> > On Oct 4, 8:33 pm, Harry Hope <riv...@ix.netcom.com> wrote:
> >>http://www.huffingtonpost.com/2010/10/04/barbour-cornyn-can......
>
> >> 10- 4-10
>
> >> Barbour, Cornyn, Cantor Lower Expectations For GOP Congress
>
> >> By Sam Stein
>
> >> With the elections approaching and the conservative base getting drunk
> >> on the idea of retaking both chambers of Congress, top leaders in the
> >> Republican Party have begun the process of trying to temper
> >> expectations for the next legislative session.
>
> >> The effort seemed more obvious than before last week, when National
> >> Republican Senatorial Committee Chair John Cornyn (R-Tex.) threw a bit
> >> of cold water on the idea that the new Congress would suddenly be able
> >> to rid the country of the president's health care law.http://www.huffingtonpost.com/2010/09/30/cornyn-we-need-to-......
>
> >> ............................................................................­­.................................
>
> >> On Monday, another prominent GOP leader joined the chorus of the
> >> sober-minded.
>
> >> House Minority Whip Eric Cantor, speaking to the Wall Street Journal's
> >> economic editor Steve Moore, offered his hope of avoiding a government
> >> shutdown -- the very same type of political brinksmanship that others
> >> in the GOP tent have cheered.http://online.wsj.com/article/SB100014240527487044830045755......
>
> >> ............................................................................­­..............
>
> >> Together, Cornyn and Cantor's comments suggest a concern within the
> >> Republican tent over what type of reality the party will confront
> >> after November.
>
> >> While activist enthusiasm has fueled the GOP's electoral hopes, it's
> >> also put lawmakers in a rather untenable position -- promising the
> >> base the type of dramatic political confrontations it craves despite
> >> knowing that those confrontations could take a serious toll.
> >> _________________________________________________________
>
> >> Hmmmmmmmmmmmm
>
> >> Harry
>
> > LMFAO just imagine how hard it will be for Mitch the Bitch and
> > CantWHORE and Jimmy Demented and especially Old Drug Rush to explain
> > to the base how the Dems still have control of both the Senate and the
> > House on the 5th!
>
> Since 60% of the Nation disagree with the Democrats it will be a tough
> sell to the General population, that they really wanted the wild
> spending assholes that passed huge bills through congress without
> reading them and using bribes and extortion and we the people really
> wanted them.

Hey SHIT FOR BRAINS remember all them "SUPPLEMENTAL"spending bills
You Repugs used to keep passing in order to keep the wars off budget?
If you Fuckers had bee hinest and added them into the budget between
2004 and 2008 AWOL Georgie would have been a trillion dollars in the
hole (times four) for his entire second term!