CINXE.COM

Documentação

<!DOCTYPE html> <html> <head><script type="text/javascript" src="/_static/js/bundle-playback.js?v=HxkREWBo" charset="utf-8"></script> <script type="text/javascript" src="/_static/js/wombat.js?v=txqj7nKC" charset="utf-8"></script> <script>window.RufflePlayer=window.RufflePlayer||{};window.RufflePlayer.config={"autoplay":"on","unmuteOverlay":"hidden"};</script> <script type="text/javascript" src="/_static/js/ruffle/ruffle.js"></script> <script type="text/javascript"> __wm.init("https://web.archive.org/web"); __wm.wombat("https://www.ruby-lang.org/pt/documentation/","20240802231833","https://web.archive.org/","web","/_static/", "1722640713"); </script> <link rel="stylesheet" type="text/css" href="/_static/css/banner-styles.css?v=S1zqJCYt" /> <link rel="stylesheet" type="text/css" href="/_static/css/iconochive.css?v=3PDvdIFv" /> <!-- End Wayback Rewrite JS Include --> <meta charset="utf-8"> <title>Documentação</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta itemprop="image" content="https://web.archive.org/web/20240802231833im_/https://www.ruby-lang.org/images/header-ruby-logo@2x.png"> <meta name="description" content=""> <link rel="stylesheet" type="text/css" href="/web/20240802231833cs_/https://www.ruby-lang.org/stylesheets/normalize.css"> <link rel="stylesheet" type="text/css" href="/web/20240802231833cs_/https://www.ruby-lang.org/stylesheets/main.css"> <link rel="stylesheet" type="text/css" href="/web/20240802231833cs_/https://www.ruby-lang.org/stylesheets/pygments.css"> <link rel="stylesheet" type="text/css" href="/web/20240802231833cs_/https://www.ruby-lang.org/stylesheets/mobile.css"> <link rel="stylesheet" type="text/css" href="/web/20240802231833cs_/https://www.ruby-lang.org/stylesheets/print.css"> <link href="https://web.archive.org/web/20240802231833cs_/https://fonts.googleapis.com/css?family=Noto+Sans:400,700,400italic,700italic&amp;subset=latin,cyrillic,greek,vietnamese" rel="stylesheet" type="text/css"> <link rel="canonical" href="https://web.archive.org/web/20240802231833/https://www.ruby-lang.org/pt/documentation/"> <link rel="shortcut icon" type="image/x-icon" href="/web/20240802231833im_/https://www.ruby-lang.org/favicon.ico"> <link href="/web/20240802231833/https://www.ruby-lang.org/pt/feeds/news.rss" rel="alternate" title="Em português" type="application/rss+xml"> <script type="text/javascript" src="/web/20240802231833js_/https://www.ruby-lang.org/javascripts/jquery.min.js"></script> <script type="text/javascript" src="/web/20240802231833js_/https://www.ruby-lang.org/javascripts/page.js"></script> </head> <body> <div id="header"> <div id="header_content" class="container"> <a href="/web/20240802231833/https://www.ruby-lang.org/pt/"> <h1>Ruby</h1> <h2>O melhor amigo do programador</h2> </a> <div class="site-links"> <a href="/web/20240802231833/https://www.ruby-lang.org/pt/" class="home">Início</a> <a href="/web/20240802231833/https://www.ruby-lang.org/pt/downloads/">Downloads</a> <a href="/web/20240802231833/https://www.ruby-lang.org/pt/documentation/">Documentação</a> <a href="/web/20240802231833/https://www.ruby-lang.org/pt/libraries/">Módulos</a> <a href="/web/20240802231833/https://www.ruby-lang.org/pt/community/">Comunidade</a> <a href="/web/20240802231833/https://www.ruby-lang.org/pt/news/">Notícias</a> <a href="/web/20240802231833/https://www.ruby-lang.org/pt/security/">Segurança</a> <a href="/web/20240802231833/https://www.ruby-lang.org/pt/about/">Sobre Ruby</a> <a href="#" class="menu selected">Menu</a> </div> <div id="search-box"> <form id="search-form" action="https://web.archive.org/web/20240802231833/https://www.google.com/cse"> <table class="fieldset"> <tr> <td> <input class="field" type="text" name="q" size="31" style="background: white url(//web.archive.org/web/20240802231833im_/https://www.google.com/coop/intl/pt/images/google_custom_search_watermark.gif) left no-repeat" onfocus="this.style.background='white'" onblur="if (/^\s*$/.test(this.value)) this.style.background='white url(//www.google.com/coop/intl/pt/images/google_custom_search_watermark.gif) left no-repeat'"/> </td> <td> <input type="hidden" name="cx" value="013598269713424429640:g5orptiw95w"/> <input type="hidden" name="ie" value="UTF-8"/> <input class="button" type="submit" name="sa" value="Procurar"/> </td> </tr> </table> </form> </div> </div> </div> <div id="page"> <div id="main-wrapper" class="container"> <div id="main"> <div id="content-wrapper"> <h1>Documentação</h1> <div id="content"> <p class="summary">Aqui você encontrará vários endereços para manuais, tutoriais e referências que serão úteis quando você sentir que gosta de programar em Ruby.</p> <h3>Instalando o Ruby</h3> <p>A menos que você queira testar o Ruby no seu navegador (veja os links abaixo), você precisará ter o Ruby instalado no seu computador. Você pode verificar se o Ruby já está instalado abrindo o terminal e digitando</p> <figure class="highlight"><pre><code class="language-sh" data-lang="sh">ruby <span class="nt">-v</span></code></pre></figure> <p>Isso deve imprimir algumas informações sobre a versão do Ruby instalada. Se não imprimir, consulte a <a href="installation/">página de instalação</a> para conhecer as diversas maneiras de obter o Ruby.</p> <h3>Primeiros Passos</h3> <dl> <dt><a href="https://web.archive.org/web/20240802231833/https://try.ruby-lang.org/">Try Ruby!</a></dt> <dd>Um tutorial interativo que permite que você teste o Ruby diretamente no seu browser. Este tutorial de 15 minutos é destinado para iniciantes que queiram ter uma ideia de como é a linguagem.</dd> <dt><a href="https://web.archive.org/web/20240802231833/https://rubykoans.com/">Ruby Koans</a></dt> <dd>Os Koans te conduzem pelo caminho da iluminação de modo a aprender Ruby. O objetivo é aprender a linguagem, sintaxe, estrutura algumas funções e bibliotecas comuns do Ruby. Também ensinamos cultura.</dd> <dt><a href="https://web.archive.org/web/20240802231833/http://why.carlosbrando.com/">O Guia (Comovente) de Ruby do Why</a></dt> <dd>UM livro inconveniente, porém interessante, que te ensinará Ruby através de histórias, humor e quadrinhos. Originalmente criado por <em>why the lucky stiff</em>, esse guia permanece um clássico para os aprendizes de Ruby.</dd> <dt><a href="/web/20240802231833/https://www.ruby-lang.org/pt/documentation/quickstart/">Ruby em Vinte Minutos</a></dt> <dd>Um bom tutorial que cobre o básico de Ruby. Desde o início ao fim, não deverá levar mais de vinte minutos.</dd> <dt><a href="/web/20240802231833/https://www.ruby-lang.org/pt/documentation/ruby-from-other-languages/">Ruby a Partir de Outras Linguagens</a></dt> <dd>Chegou ao Ruby por outra linguagem? Quer seja C, C++, Java, Perl, PHP ou Python, este artigo é para você!</dd> <dt><a href="https://web.archive.org/web/20240802231833/http://www.techotopia.com/index.php/Ruby_Essentials">Ruby Essentials</a></dt> <dd>Ruby Essentials é um livro digital gratuito projetado para prover um guia conciso e fácil de seguir para o aprendiz de Ruby.</dd> <dt><a href="https://web.archive.org/web/20240802231833/http://aprendaaprogramar.rubyonrails.com.br/">Aprenda a Programar</a></dt> <dd>Pequeno e maravilhoso tutorial por Chris Pine para novatos em programação. Se não sabe programar, comece aqui.</dd> <dt><a href="https://web.archive.org/web/20240802231833/https://learncodethehardway.org/ruby/">Learn Ruby the Hard Way</a></dt> <dd>Um ótimo conjunto de exercícios com explicações que o conduzem do básico do Ruby por todo o caminho até a OOP e o desenvolvimento para a web.</dd> </dl> <h3>Manuais</h3> <dl> <dt><a href="https://web.archive.org/web/20240802231833/http://www.ruby-doc.org/docs/ProgrammingRuby/">Programming Ruby</a></dt> <dd>Trabalho seminal de Ruby em inglês, a primeira edição do <a href="https://web.archive.org/web/20240802231833/http://pragmaticprogrammer.com/titles/ruby/index.html">Pragmatic Programmers’ book</a> está disponível gratuitamente online.</dd> <dt><a href="https://web.archive.org/web/20240802231833/http://en.wikibooks.org/wiki/Ruby_programming_language">The Ruby Programming Wikibook</a></dt> <dd>Manual online gratuito, com conteúdo para iniciantes e intermediário, além de uma referência completa para a linguagem.</dd> </dl> <h3>Documentação de Referência</h3> <dl> <dt><a href="https://web.archive.org/web/20240802231833/http://www.ruby-doc.org/core">Ruby Core Reference</a></dt> <dd>Vindo diretamente do código-fonte através de <a href="https://web.archive.org/web/20240802231833/https://ruby.github.io/rdoc/">RDoc</a>, esta referência documenta todas as classes e módulos do <em>core</em> (como String, Array, Symbol, etc…).</dd> <dt><a href="https://web.archive.org/web/20240802231833/http://www.ruby-doc.org/stdlib">Ruby Standard Library Reference</a></dt> <dd>Também vindo do código-fonte através do RDoc, esta referência explora documentos da biblioteca padrão.</dd> <dt><a href="https://web.archive.org/web/20240802231833/http://www.rubydoc.info/">RubyDoc.info</a></dt> <dd>O website essencial para documentação de referência sobre as Gems do Ruby e projetos Ruby hospedados no GitHub.</dd> <dt><a href="https://web.archive.org/web/20240802231833/http://rubydocs.org/">Ruby &amp; Rails Searchable API Docs</a></dt> <dd>Documentação do Ruby e do Rails com busca inteligente.</dd> <dt><a href="https://web.archive.org/web/20240802231833/http://apidock.com/">APIdock</a></dt> <dd>Documentação do Ruby, Rails e RSpec com notas de usuários.</dd> </dl> <h3>Editores e IDEs</h3> <p>Para programar em Ruby, você pode usar o editor padrão do seu sistema operacional. A propósito, para programar mais eficazmente, pode valer a pena escolher um editor de código fonte com suporte básico a Ruby (por exemplo, que colore a sintaxe, lista os arquivos, etc.) ou um ambiente integrado de desenvolvimento com funcionalidades avançadas (como completar o código, refatorar, suporte a testes, etc.).</p> <p>Segue aqui uma lista das ferramentas populares utilizadas por programadores Ruby:</p> <ul> <li>Ferramentas para Linux e outras plataformas: <ul> <li><a href="https://web.archive.org/web/20240802231833/http://www.aptana.com/">Aptana Studio</a></li> <li><a href="https://web.archive.org/web/20240802231833/http://www.gnu.org/software/emacs/">Emacs</a> com <a href="https://web.archive.org/web/20240802231833/http://www.emacswiki.org/emacs/RubyMode">Ruby mode</a> e <a href="https://web.archive.org/web/20240802231833/http://rsense.github.io/">Rsense</a></li> <li><a href="https://web.archive.org/web/20240802231833/http://www.geany.org/">Geany</a></li> <li><a href="https://web.archive.org/web/20240802231833/http://projects.gnome.org/gedit/screenshots.html">gedit</a></li> <li><a href="https://web.archive.org/web/20240802231833/http://www.vim.org/">Vim</a> com o plugin <a href="https://web.archive.org/web/20240802231833/https://github.com/vim-ruby/vim-ruby">vim-ruby</a> e <a href="https://web.archive.org/web/20240802231833/http://rsense.github.io/">Rsense</a></li> <li><a href="https://web.archive.org/web/20240802231833/http://www.jetbrains.com/ruby/">RubyMine</a></li> <li><a href="https://web.archive.org/web/20240802231833/http://www.scintilla.org/SciTE.html">SciTe</a></li> <li><a href="https://web.archive.org/web/20240802231833/https://netbeans.org/">NetBeans</a></li> <li><a href="https://web.archive.org/web/20240802231833/http://www.sublimetext.com/">Sublime Text</a></li> <li><a href="https://web.archive.org/web/20240802231833/https://atom.io/">Atom</a></li> <li><a href="https://web.archive.org/web/20240802231833/https://code.visualstudio.com/">Visual Studio Code</a></li> </ul> </li> <li>No Windows: <ul> <li><a href="https://web.archive.org/web/20240802231833/http://notepad-plus-plus.org/">Notepad++</a></li> <li><a href="https://web.archive.org/web/20240802231833/http://www.e-texteditor.com/">E-TextEditor</a></li> <li><a href="https://web.archive.org/web/20240802231833/http://www.sapphiresteel.com/">Ruby In Steel</a></li> </ul> </li> <li>No macOS: <ul> <li><a href="https://web.archive.org/web/20240802231833/http://macromates.com/">TextMate</a></li> <li><a href="https://web.archive.org/web/20240802231833/https://www.barebones.com/products/bbedit/">BBEdit</a></li> <li><a href="https://web.archive.org/web/20240802231833/http://kapeli.com/dash">Dash</a> (navegador de documentação)</li> </ul> </li> </ul> <h3>Leitura Complementar</h3> <p><a href="https://web.archive.org/web/20240802231833/http://ruby-doc.org/">Ruby-Doc.org</a> mantém uma lista completa de fontes de documentação em inglês. Se você tiver perguntas sobre Ruby, a <a href="/web/20240802231833/https://www.ruby-lang.org/pt/community/mailing-lists/">lista de e-mails</a> é um ótimo lugar para começar.</p> </div> </div> <hr class="hidden-modern"/> <div id="sidebar-wrapper"> <div id="sidebar"> <div class="navigation"> <h3><strong>Primeiros passos</strong>, é fácil!</h3> <ul class="menu"> <li><a href="https://web.archive.org/web/20240802231833/https://try.ruby-lang.org/">Try Ruby! (in your browser)</a></li> <li><a href="/web/20240802231833/https://www.ruby-lang.org/pt/documentation/quickstart/">Ruby em Vinte Minutos</a></li> <li><a href="/web/20240802231833/https://www.ruby-lang.org/pt/documentation/ruby-from-other-languages/">Ruby a partir de outras linguagens</a></li> </ul> </div> <div class="navigation"> <h3><strong>Explore</strong> um novo mundo…</h3> <ul class="menu"> <li><a href="/web/20240802231833/https://www.ruby-lang.org/pt/documentation/">Documentação</a></li> <li><a href="/web/20240802231833/https://www.ruby-lang.org/pt/libraries/">Bibliotecas</a></li> <li><a href="/web/20240802231833/https://www.ruby-lang.org/pt/documentation/success-stories/">Histórias de sucesso</a></li> </ul> </div> <div class="navigation"> <h3><strong>Participe</strong> de uma comunidade simpática e em crescimento.</h3> <ul> <li><a href="/web/20240802231833/https://www.ruby-lang.org/pt/community/mailing-lists/">Listas de E-mail</a>: Fale sobre Ruby com programadores de todo o mundo.</li> <li><a href="/web/20240802231833/https://www.ruby-lang.org/pt/community/user-groups/">Grupos de Usuários</a>: Entre em contato com colegas da sua área.</li> <li><a href="/web/20240802231833/https://www.ruby-lang.org/pt/community/weblogs/">Weblogs</a>: Leia sobre o que está acontecendo agora na comunidade Ruby.</li> <li><a href="/web/20240802231833/https://www.ruby-lang.org/pt/community/ruby-core/">Ruby Core</a>: Ajude a polir as arestas da última versão do Ruby.</li> <li><a href="https://web.archive.org/web/20240802231833/https://bugs.ruby-lang.org/">Issue Tracking</a>: Informe ou ajude a resolver problemas do Ruby.</li> </ul> </div> <h3>Feeds de notícias (RSS)</h3> <p><a href="/web/20240802231833/https://www.ruby-lang.org/pt/feeds/news.rss">Em português</a></p> </div> </div> <hr class="hidden-modern"/> </div> </div> </div> <div class="container"> <div id="footer"> <div class="site-links"> <a href="/web/20240802231833/https://www.ruby-lang.org/pt/" class="home">Início</a> <a href="/web/20240802231833/https://www.ruby-lang.org/pt/downloads/">Downloads</a> <a href="/web/20240802231833/https://www.ruby-lang.org/pt/documentation/">Documentação</a> <a href="/web/20240802231833/https://www.ruby-lang.org/pt/libraries/">Módulos</a> <a href="/web/20240802231833/https://www.ruby-lang.org/pt/community/">Comunidade</a> <a href="/web/20240802231833/https://www.ruby-lang.org/pt/news/">Notícias</a> <a href="/web/20240802231833/https://www.ruby-lang.org/pt/security/">Segurança</a> <a href="/web/20240802231833/https://www.ruby-lang.org/pt/about/">Sobre Ruby</a> </div> <p> Este site em outros idiomas: <a href="/web/20240802231833/https://www.ruby-lang.org/bg/">Български</a>, <a href="/web/20240802231833/https://www.ruby-lang.org/de/">Deutsch</a>, <a href="/web/20240802231833/https://www.ruby-lang.org/en/">English</a>, <a href="/web/20240802231833/https://www.ruby-lang.org/es/">Español</a>, <a href="/web/20240802231833/https://www.ruby-lang.org/fr/">Français</a>, <a href="/web/20240802231833/https://www.ruby-lang.org/id/">Bahasa Indonesia</a>, <a href="/web/20240802231833/https://www.ruby-lang.org/it/">Italiano</a>, <a href="/web/20240802231833/https://www.ruby-lang.org/ja/">日本語</a>, <a href="/web/20240802231833/https://www.ruby-lang.org/ko/">한국어</a>, <a href="/web/20240802231833/https://www.ruby-lang.org/pl/">polski</a>, <a href="/web/20240802231833/https://www.ruby-lang.org/pt/">Português</a>, <a href="/web/20240802231833/https://www.ruby-lang.org/ru/">Русский</a>, <a href="/web/20240802231833/https://www.ruby-lang.org/tr/">Türkçe</a>, <a href="/web/20240802231833/https://www.ruby-lang.org/vi/">Tiếng Việt</a>, <a href="/web/20240802231833/https://www.ruby-lang.org/zh_cn/">简体中文</a>, <a href="/web/20240802231833/https://www.ruby-lang.org/zh_tw/">繁體中文</a>. </p> <p><a href="/web/20240802231833/https://www.ruby-lang.org/pt/about/website/">Este website</a> é mantido com orgulho por membros da comunidade Ruby.</p> </div> </div> </body> </html> <!-- FILE ARCHIVED ON 23:18:33 Aug 02, 2024 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 08:06:16 Dec 11, 2024. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). --> <!-- playback timings (ms): captures_list: 0.734 exclusion.robots: 0.056 exclusion.robots.policy: 0.023 esindex: 0.014 cdx.remote: 11.221 LoadShardBlock: 109.348 (3) PetaboxLoader3.datanode: 77.407 (4) PetaboxLoader3.resolve: 136.192 (2) load_resource: 156.08 -->

Pages: 1 2 3 4 5 6 7 8 9 10