/cowsay-ruby-sinatra

Projeto desenvolvido com Ruby e Sinatra que interage com o programa Cowsay no terminal Linux. Project developed with Ruby Sinatra that interacts with the Cowsay program in the Linux terminal.

Primary LanguageRubyMIT LicenseMIT

Cowsay Web App

Thanks to @nwildner for introducing me to the cowsay app in its most coherent form (https://github.com/nwildner/cowsay-ancap). Thanks!

Instructions in English

This project is a simple Sinatra-based web application that uses the cowsay program to generate text messages with ASCII characters. The user can provide a message and select a character. The application then displays the message generated by cowsay with the chosen character.

Application screenshot

Prerequisites

  • Ruby 3.2 or higher
  • Bundler
  • Cowsay (For running locally without Docker. Check how to install Cowsay on your Linux distribution or see more information on the official website: https://cowsay.diamonds)

Running the project without Docker

  1. Clone the repository:

Clone over SSH

git clone git@github.com:efrj/cowsay-ruby-sinatra.git

Clone over HTTPS

git clone https://github.com/efrj/cowsay-ruby-sinatra.git

  1. Go to the directory you just cloned

cd cowsay-ruby-sinatra

  1. Install dependencies:

bundle install

  1. Run the application:

ruby app.rb

  1. Access the application in your browser at http://localhost:4567.

Running the project with Docker

  1. Clone the repository:

Clone over SSH

git clone git@github.com:efrj/cowsay-ruby-sinatra.git

Clone over HTTPS

git clone https://github.com/efrj/cowsay-ruby-sinatra.git

  1. Go to the directory you just cloned

cd cowsay-ruby-sinatra

  1. Copy the .env-example file and save as .env

cp .env-example .env

  1. Build the Docker image:

docker-compose build

  1. Run the container:

docker-compose up

  1. Access the application in your browser at http://localhost:4567.

Personalization

If you want to map port 4567 to another port when running the project with Docker, modify the value of the PORT_MAPPING variable in the .env file. For example, to map port 4567 to port 8080, change the value to PORT_MAPPING=8080.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Instruções em Português

Este projeto é uma aplicação web simples baseada no Sinatra que utiliza o programa cowsay para gerar mensagens de texto com personagens ASCII. O usuário pode fornecer uma mensagem e selecionar um personagem. A aplicação, então, exibe a mensagem gerada pelo cowsay com o personagem escolhido.

Captura de tela da aplicação

Pré-requisitos

  • Ruby 3.2 ou superior
  • Bundler
  • Cowsay (Para execução local sem Docker. Verifique como instalar o Cowsay na sua distribução Linux ou veja mais informações no site oficial: https://cowsay.diamonds)

Executando o projeto sem Docker

  1. Faça o clone do repositório:

Clonar via SSH

git clone git@github.com:efrj/cowsay-ruby-sinatra.git

Clonar via HTTPS

git clone https://github.com/efrj/cowsay-ruby-sinatra.git

  1. Entre no diretório:

cd cowsay-ruby-sinatra

  1. Instale as dependências:

bundle install

  1. Execute a aplicação:

ruby app.rb

  1. Acesse a aplicação em seu navegador em http://localhost:4567.

Executando o projeto com Docker

  1. Faça o clone do repositório:

Clonar via SSH

git clone git@github.com:efrj/cowsay-ruby-sinatra.git

Clonar via HTTPS

git clone https://github.com/efrj/cowsay-ruby-sinatra.git

  1. Entre no diretório:

cd cowsay-ruby-sinatra

  1. Copie o arquivo .env-example e salve como .env

cp .env-example .env

  1. Construa a imagem do Docker:

docker-compose build

  1. Execute o contêiner:

docker-compose up

  1. Acesse a aplicação em seu navegador em http://localhost:4567.

Personalização

Se você deseja mapear a porta 4567 para outra porta ao executar o projeto com Docker, modifique o valor da variável PORT_MAPPING no arquivo .env. Por exemplo, para mapear a porta 4567 para a porta 8080, altere o valor para PORT_MAPPING=8080.

Licença

Este projeto está licenciado sob a Licença MIT - consulte o arquivo LICENSE para obter detalhes.