public
Description: Tradução do livro Why's (Poignant) Guide to Ruby para português.
Homepage: http://poignantguide.net/ruby/
Clone URL: git://github.com/carlosbrando/poignant-br.git
Traducao concluida em 90%. Agrademimentos a Ederson do Vale pela ajuda e 
paciencia.
hallison (author)
Tue Jul 08 06:38:51 -0700 2008
commit  82dd33926af1ca0450e623ba50d4780c240cb9f0
tree    ab575f7792a8b5b1dec461cb32b9eea89cb5ddf5
parent  0bb49f61bca183bf79ac26e2db44f6087b971293
...
7
8
9
10
11
 
 
12
13
14
...
20
21
22
23
24
25
 
 
26
27
28
...
288
289
290
291
292
293
 
 
294
295
296
...
299
300
301
302
 
303
304
305
...
307
308
309
310
311
312
313
 
 
 
 
 
314
315
316
317
318
319
320
 
 
 
321
322
323
324
 
325
326
327
 
328
329
 
330
331
332
333
334
335
336
 
 
 
 
 
 
 
 
337
338
339
340
341
 
342
343
344
...
354
355
356
357
358
 
 
359
360
361
...
365
366
367
368
369
 
 
370
371
372
...
375
376
377
378
379
380
381
382
 
 
 
 
 
383
384
385
...
394
395
396
397
398
399
400
401
 
 
 
 
 
 
402
403
 
404
405
406
...
7
8
9
 
 
10
11
12
13
14
...
20
21
22
 
 
 
23
24
25
26
27
...
287
288
289
 
 
 
290
291
292
293
294
...
297
298
299
 
300
301
302
303
...
305
306
307
 
 
 
 
308
309
310
311
312
313
314
315
316
 
 
 
317
318
319
320
321
322
 
323
324
325
 
326
327
 
328
329
330
331
332
 
 
 
333
334
335
336
337
338
339
340
341
342
343
344
 
345
346
347
348
...
358
359
360
 
 
361
362
363
364
365
...
369
370
371
 
 
372
373
374
375
376
...
379
380
381
 
 
 
 
 
382
383
384
385
386
387
388
389
...
398
399
400
 
 
 
 
 
401
402
403
404
405
406
407
 
408
409
410
411
0
@@ -7,8 +7,8 @@
0
         E agora, as histórias das Loterias Paij-ree.
0
 
0
 
0
- Em Endertromb, o pai do organista inventou a loteria. A idéia surgiu quando ele estava rezando
0
- para o Escavador Dosh.
0
+ Em Endertromb, o pai do organista inventou a loteria. A idéia surgiu quando ele estava
0
+ rezando para o Escavador Dosh.
0
 
0
 
0
         Escavador Dosh é uma espécie de Deus para eles. Mas dez vezes mais
0
@@ -20,9 +20,8 @@
0
         É mais ou menos complicado, porque o Escavador Dosh mata totalmente as pessoas. Mas
0
         eu convido você a fazer o que ele diz, ele não é tão mal. Talvez eu fale sobre isso
0
         mais tarde. É um tal de fala sobre dor, porque isso é tão assustador e ainda um dos
0
- meus amigos realmente acredita em tudo isso. Eu consigo um tipo de
0
- estrangulador -- não que eu esteja precisando, mais
0
- I get kind of choked up -- not like I'm crying, more like I'm choking.
0
+ meus amigos realmente acredita em tudo isso. Eu fico meio que chocado -- não que eu
0
+ esteja chorando, estou apenas surpreso.
0
 
0
 
0
         De qualquer forma, enquanto rezava, três números vieram para o pai do Paij-ree.
0
@@ -288,9 +287,8 @@
0
         diretamente para a definição de @objeto@._
0
 
0
 
0
- A
0
- The budding organ instructor also threw in a tricky syntax worth examining.
0
- In the ninth line, a winner has been found.
0
+ O instrutor do setor de desenvolvimento também lançou um truque na sintaxe digno
0
+ de ser examinado.
0
 
0
 
0
         <pre>
0
@@ -299,7 +297,7 @@
0
         </pre>
0
 
0
 
0
- The @||=@ syntax is a shortcut.
0
+ A sintaxe @||=@ é um atalho.
0
 
0
 
0
         <pre>
0
@@ -307,38 +305,44 @@
0
         </pre>
0
 
0
 
0
- The *double pipe* is an *or* logic. Set @winners[buyer]@ equal to @winners[buyer]@ or,
0
- if @winners[buyer]@ is nil, set it to @[]@. This shortcut is a little strange, but if you
0
- can really plant it in your head, it's a nice timesaver. You're just making sure a variable
0
- is set before using it.
0
+ O *pipe duplo* é um *ou* lógico. Coloque @vendendores[comprador]@ igual a
0
+ @vencedores[comprador]@ ou, se @vencedores[comprador]@ é nulo, ajuste-o para @[]@. Este
0
+ atalho é um pouco estranho, mas se você puder abrir sua mente, ele é um bom método para
0
+ economizar tempo. Você está se certificando que uma variável está inicializada antes de
0
+ usá-la.
0
 
0
 
0
         <pre>
0
          irb> SorteioLoteria.jogo.each do |vencedor, bilhetes|
0
- irb> puts vencedor + "won on " + bilhetes.length + " ticket(s)!"
0
- irb> tickets.each do |ticket, score|
0
- irb> puts "\t" + ticket.picks.join( ', ' ) + ": " + score
0
+ irb> puts vencedor + " ganhou com " + bilhetes.length + " bilhete(s)!"
0
+ irb> bilhetes.each do |bilhete, pontuacao|
0
+ irb> puts "\t" + bilhete.numeros_escolhidos.join( ', ' ) + ": " + pontuacao
0
          irb> end
0
          irb> end
0
 
0
- Gram-yol won on 2 ticket(s)!
0
+ Gram-yol ganhou com 2 bilhetes(s)!
0
              25, 14, 33: 1
0
              12, 11, 29: 1
0
- Tarker-azain won on 1 ticket(s)!
0
+ Tarker-azain ganhou com 2 bilhetes(s)!
0
              13, 15, 29: 2
0
- Bramlor-exxon won on 1 ticket(s)!
0
+ Bramlor-exxon ganhou com 2 bilhetes(s)!
0
              2, 6, 14: 1
0
         </pre>
0
 
0
 
0
- But these salad days were not to continue for Paij-ree and his father. His father often
0
- neglected to launder his uniform and contracted a moss disease on his shoulders. The disease
0
- gradually stole his equilibrium and his sense of direction.
0
+ Mas estes dias de inocência não continuaram para Paij-ree e seu pai. Seu pai, muitas vezes,
0
+ se negava em lavar seu uniforme e acabou contraíndo uma doença de mofo nos seus ombros. A
0
+ doença afetou gadualmente seu equilíbrio e seu senso de direção.
0
+
0
+
0
+ Seu pai ainda tentou futilmente manter os negócios funcionando. Ele rodou a cidade, algumas
0
+ vezes andando, de forma deplorável, passo-a-passo sobre os paralelepípedos, muitas vezes
0
+ tateando as paredes, contando os tijolos para o salão dos matemáticos e estação dos cocheiros.
0
 
0
 
0
         His father still futilely attempted to keep the business running. He spiraled through the
0
         city, sometimes tumbling leg-over-leg down the cobbled stone, most often slowly feeling the walls,
0
- counting bricks to the math parlours and coachmen stations, where he would thrust tickets
0
+ counting bricks to the math parlours and coachmen stations, <****> where he would thrust tickets
0
         at the bystanders, who hounded him and slapped him away with long, wet beets. Later, Paij-ree
0
         would find him in a corner, his blood running into the city drains alongside the juices of the
0
         dark, splattered beets, which juice weaseled its way up into his veins and stung and clotted
0
@@ -354,8 +358,8 @@
0
 
0
         <pre>
0
          irb> bilhete = BilheteLoteria.new
0
- irb> bilhete.picks = 3
0
- NoMethodError: undefined method `picks=' for #<LotteryTicket:0xb7d49110>
0
+ irb> bilhete.numeros_escolhidos = 3
0
+ NoMethodError: undefined method `numeros_escolhidos=' for #<BilheteLoteria:0xb7d49110>
0
         </pre>
0
 
0
 
0
@@ -365,8 +369,8 @@
0
 
0
 
0
         <pre>
0
- class LotteryTicket
0
- attr_accessor :picks, :purchased
0
+ class BilheteLoteria
0
+ attr_accessor :numeros_escolhidos, :data_compra
0
          end
0
         </pre>
0
 
0
@@ -375,11 +379,11 @@
0
 
0
 
0
         <pre>
0
- class LotteryTicket
0
- def picks; @picks; end
0
- def picks=(var); @picks = var; end
0
- def purchased; @purchased; end
0
- def purchased=(var); @purchased = var; end
0
+ class BilheteLoteria
0
+ def numeros_escolhidos; @numeros_escolhidos; end
0
+ def numeros_escolhidos=(var); @numeros_escolhidos = var; end
0
+ def data_compra; @data_compra; end
0
+ def data_compra=(var); @data_compra = var; end
0
          end
0
         </pre>
0
 
0
@@ -394,13 +398,14 @@
0
 
0
         <pre>
0
          class SkatingContest
0
- def the_winner; @the_winner; end
0
- def the_winner=( name )
0
- unless name.respond_to? :to_str
0
- raise ArgumentError, "The winner's name must be a String,
0
- not a math problem or a list of names or any of that business."
0
+ def o_vencedor; @o_vencedor; end
0
+ def o_vencedor=( nome )
0
+ unless nome.respond_to? :to_str
0
+ raise ArgumentError, "O nome do vencedor deve ser uma String,
0
+ não um prooblema matemático ou uma lista de nomes ou qualquer ou
0
+ coisa parecida."
0
              end
0
- @the_winner = name
0
+ @o_vencedor = nome
0
            end
0
          end
0
         </pre>

Comments

    No one has commented yet.