Commit 53f828c94d600cc9619baee50ecf61132672cf3f

[pt_BR] Almost finishing the A First Application chapter.

Commit diff

PortugueseBook/FirstApp/FirstApp.tex

 
605605\label{sec:Monticello}
606606
607607Agora que você conseguiu fazer o jogo Quinto funcionar, você provavelmente quer salvá-lo em algum lugar de modo a poder compartilhá-lo com seus amigos. É claro, você pode salvar sua imagem \squeak e mostrar seu primeiro programa rodando essa imagem, mas seus amigos provavelmente possuem seus próprios códigos em suas imagens, e você não os quer forçar a usar a sua imagem.
608O que você precisa é uma forma de extrair código da sua imagem \squeak para que outros programadores possam incorporar em suas imagens.
609
610The simplest way of doing this is by \emph{filing out} the code. The yellow-button menu in the System Categories pane will give you the option to file out the whole of category \scat{SBE-Quinto}.
611The resulting file is more or less human readable, but is really intended for computers, not humans.
612You can email this file to your friends, and they can file it into their own \squeak images using the file list browser.
613\seeindex{saving code}{categories}
614\seeindex{category!filing out}{file, filing out}
615\seeindex{class!filing out}{file, filing out}
616\seeindex{method!filing out}{file, filing out}
617\index{file!filing out}
618
619\dothis{Yellow-click on the \scat{SBE-Quinto} category and \menu{fileOut} the contents.}
620You should now find a file called ``SBE-Quinto.st'' in the same folder on disk where your image is saved.
621Have a look at this file with a text editor.
622
623\dothis{Open a fresh \squeak image and use the File List tool to \menu{file in} the SBE-Quinto.st fileout.
624Verify that the game now works in the new image.}
625\seeindex{category!filing in}{file, filing in}
626\seeindex{class!filing in}{file, filing in}
627\seeindex{method!filing in}{file, filing in}
628\index{file!filing in}
608O que você precisa é uma forma de extrair código da sua imagem \squeak para que outros programadores possam incorporar tais mudanças em suas imagens.
609
610A forma mais simples de fazer isso é fazer o que chamamos de \foreign{filing out} de código. O menu do botão amarelo no painel de Categorias de Sistema lhe dará a opção para fazer o \foreign{filing out} da categoria \cat{SBE-Quinto}.
611O arquivo resultante é mais ou menos legível por humanos, mas de qualquer forma ele destinado a máquinas, não humanos.
612Você pode enviar este arquivo por email para seus amigos, e eles podem então incorporar este arquivo em suas imagens \squeak usando a ferramenta \foreign{File List}.
613\seeindex{salvando código}{categorias}
614\seeindex{categoria!filing out}{arquivo, filing out}
615\seeindex{classe!filing out}{arquivo, filing out}
616\seeindex{método!filing out}{arquivo, filing out}
617\index{arquivo!filing out}
618
619\dothis{Clique com o botão amarelo na categoria \scat{SBE-Quinto} e selecione o menu \menu{fileOut}.}
620Agora você deve encontrar a categoria ``SBE-Quinto.st'' no mesmo diretório no disco rígido onde sua imagem está localizada.
621Dê uma olhada neste arquivo com um editor de textos.
622
623\dothis{Abra uma imagem \squeak nova e use a ferramenta \foreign{File List} para realizar o \menu{filein} do arquivo SBE-Quinto.st gerado anteriormente.
624Veja que o jogo funciona na nova imagem.}
625\seeindex{categoria!filing in}{arquivo, filing in}
626\seeindex{classe!filing in}{arquivo, filing in}
627\seeindex{método!filing in}{arquivo, filing in}
628\index{arquivo!filing in}
629629
630630\begin{figure}[ht]
631631\centerline {\includegraphics[width=\textwidth]{FileIn}}
632\caption{Filing in \squeak source code.
632\caption{Fazendo \foreign{file in} de código \squeak.
633633\label{fig:filein}}
634634\end{figure}
635635
636\subsection{Monticello packages}
637Although fileouts are a convenient way of making a snapshot of the code you have written, they are decidedly ``old school''.
638Just as most open-source projects find it much more convenient to maintain their code in a repository using \ind{CVS}\footnote{\url{www.nongnu.org/cvs}} or \ind{Subversion}\footnote{\url{subversion.tigris.org}},
639so \squeak programmers find it more convenient to manage their code using \ind{Monticello} packages.
640These packages are represented as files with names ending in \ct{.mcz}; they are actually zip-compressed bundles that contain the complete code of your \ind{package}.
636\subsection{Pacotes Monticello}
637Apesar do \foreign{fileout} ser uma forma conveniente de se extrair o código escrito por você, essa técnica é um tanto ``ultrapassada''.
638Assim como a maioria dos projetos open-source acha mais conveniente manter seus códigos em um repositório \ind{CVS}\footnote{\url{www.nongnu.org/cvs}} ou \ind{Subversion}\footnote{\url{subversion.tigris.org}},
639os programadores \squeak acham mais conveniente gerenciar seus códigos usando pacotes \ind{Monticello}.
640Esses pacotes são representados como arquivos cujos nomes terminam em \ct{.mcz}; na verdade eles são arquivos zip que contem o código completo do seu \ind{pacote}.
641641
642Using the Monticello package browser, you can save packages to repositories on various types of server, including FTP and HTTP servers; you can also just write the packages to a repository in a local file system directory.
643A copy of your package is also always cached on your local hard-disk in the \emph{package-cache} folder.
644Monticello lets you save multiple versions of your program, merge versions, go back to an old version, and browse the differences between versions.
645In fact, Monticello is a distributed revision control system; this means it allows developers to save their work on different places, not on a single repository as it is the case with CVS or Subversion.\damien{Mercurial, Git are examples of distributed revision control system; not sure it's worth mentioning them.}
642Usando o Monticello, você pode salvar pacotes a repositórios em diversos tipos de servidores, incluindo servidores FTP e HTTP; você também pode gravar os pacotes em um repositório situado no sistema de arquivos local.
643Uma cópia do seu pacote é sempre mantido no disco rígido, dentro do diretório \emph{package-cache}.
644O Monticello permite que você salve várias versões do seu programa, combine versões, volte para uma versão antiga e visualize as diferenças entre versões.
645Na verdade, Monticello é um sistema de controle de versões distribuído; isso significa que os desenvolvedores podem salvar seus trabalhos em diferentes locais em vez de em um único repositório central, como é o caso do CVS ou Subversion.\damien{Mercurial, Git are examples of distributed revision control system; not sure it's worth mentioning them.}
646646\seeindex{package browser}{Monticello}
647647
648You can also send a \ct{.mcz} file by email.
649The recipient will have to place it in her \emph{package-cache} folder; she will then be able to use Monticello to browse and load it.
648Você pode também enviar um arquivo \ct{.mcz} por email.
649O destinatário deverá colocar o arquivo no seu diretório \emph{package-cache}; então ele poderá usar o Monticello para localizar e carregar o arquivo.
650650%(It is also possible to load it using the file list, but there is a difference between loading a \ct{.mcz} file using a file list and using Monticello \sd{check}.)
651651
652\dothis{Open the Monticello browser by selecting \menu{World \go open\,\ldots \go Monticello browser}.}
653In the right-hand pane of the browser (see \figref{monticello1}) is a list of Monticello repositories, which will include all of the repositories from which code has been loaded into the image that you are using.
652\dothis{Abra o Monticello \foreign{browser} selecionando \menu{World \go open\,\ldots \go Monticello browser}.}
653O painel da direita do \foreign{browser} (veja \figref{monticello1}) é uma lista de repositórios Monticello, que inclui todos os repositórios que foram usados para carregar o código usado na sua imagem.
654654%In addition to SqueakSource servers, Monticello repositories can live in a variety of other places, the simplest being a directory on your local disk.
655655
656656\begin{figure}[hbt]
657657\ifluluelse
658658 {\centerline {\includegraphics[width=\textwidth]{MonticelloBrowser}}}
659659 {\centerline {\includegraphics[scale=0.7]{MonticelloBrowser}}}
660\caption{The Monticello browser.
660\caption{Monticello \foreign{browser}.
661661\label{fig:monticello1}}
662662\end{figure}
663663
toggle raw diff