Project

Reverse Dependencies for rspec

The projects listed here declare rspec as a runtime or development dependency

0.0
No release in over 3 years
<!-- TABLE OF CONTENTS --> <details open="open"> <summary>Table of Contents</summary> <ol> <li> <a href="#about-the-project">About The Project</a> <ul> <li><a href="#built-with">Built With</a></li> </ul> </li> <li> <a href="#getting-started">Getting Started</a> <ul> <li><a href="#prerequisites">Prerequisites</a></li> <li><a href="#installation">Installation</a></li> </ul> </li> <li><a href="#usage">Usage</a></li> <li><a href="#roadmap">Roadmap</a></li> <li><a href="#contributing">Contributing</a></li> <li><a href="#license">License</a></li> <li><a href="#contact">Contact</a></li> <li><a href="#acknowledgements">Acknowledgements</a></li> </ol> </details> <!-- ABOUT THE PROJECT --> ## About The Project [![Product Name Screen Shot][Screenshot of gameplay and test list]](https://www.dropbox.com/s/mu1rrbx2mqowjkn/studio-game.png?dl=0) This game is a project built following the [Pragmatic Studio Ruby Course](https://online.pragmaticstudio.com/courses/ruby/). I absolutely adored going through this course, because it was unlike other courses in that the main focus wasn't syntax, but how to build a principle-driven, object-oriented program that contains many of the skills we'd need to build real-world projects. The instructors purposefully created exercises to let us build a program using the skills they demonstrated by building a different program. This wasn't a copy and paste kind of course. This game was actually my second run-through, where I test-drove everything from the start based on the objectives only. Skills I valued developing further with this project: - Test-driven development (50+ tests). - Using inheritance to model "is-a" relationships. For example, a clumsy player *is a* kind of player. - Using mixins (modules) to reuse behaviours that are common between classes, but should not be modeled with an inheritance relationship. A good tip was to look for 'able' behaviors in a class to extract, like 'playable', 'printable', 'taxable' etc. - Using a file block which lets you add in class usage examples that are only run when you run the class file specifically. - Overriding default methods (like sort, and renaming things so that they keep a specific format) Things I struggled with: - Testing behaviour that uses blocks. I had a lightbulb moment when I realised I should test the behaviour performed inside the block on a single item. Testing the output of an entire block is like testing Ruby syntax works. Alternatively, test the before and after state of something that changes as a result of using a block. Cooool. - Puts. It felt wrong to use puts to show the output in the console. I'd like to learn how to seperate the view logic for a command-line project later. Things I did to make it my own: - Wrote a lot more tests for my second run-through. - Noticed and extracted further 'able' behaviours into modules (like printing stats, formatting output and handling csv files). ### Built With * [Ruby (language)](https://www.ruby-lang.org/en/) * [RSpec (framework)](https://rspec.info/) * [Vim (text-editor)](https://www.vim.org/) <!-- GETTING STARTED --> ## Getting Started To get a local copy up and running follow these steps: ### Prerequisites This is an example of how to list things you need to use the software and how to install them. * gem ```sh npm install npm@latest -g ``` ### Installation 1. Install the gem ```sh gem install studio_game_2021 ``` <!-- USAGE EXAMPLES --> ## Usage To play a game from the command-line, open a new command project and run the command-line script like so: ```sh studio_game ``` Or, if you'd like to use the game as a library, here's an example of how to use it in `irb`. You can also check the bottom of each class or module file for further usage instructions ``` >> require 'studio_game/game' => true >> game = StudioGame::Game.new("Knuckleheads") => #<StudioGame::Game:0x007fdea10252d8 @title="Knuckleheads", @players=[]> >> player = StudioGame::Player.new("Moe", 90) => I'm Moe with health = 90, points = 0, and score = 90. >> game.add_player(player) => [I'm Moe with health = 90, points = 0, and score = 90.] >> game.play(1) ``` <!-- ROADMAP --> ## Roadmap I plan to customize this game further now that I have a solid foundation to explore from. It'll be fun to let the players interact with each other more, like swapping treasures, and maybe add some kind of board game with it's own features. That's my next focus. ## Contributing Feel free to fork this project and play around with it. Open to feedback-related pr requests. <!-- LICENSE --> ## License Distributed under the MIT License. See `LICENSE` for more information. <!-- CONTACT --> ## Contact Becca - [@becca9941](https://twitter.com/Becca9941) - becca@essentialistdev.com Project Link: [https://gitlab.com/EssentialistDev/studio-game](https://gitlab.com/EssentialistDev/studio-game) <!-- ACKNOWLEDGEMENTS --> ## Acknowledgements - [Pragmatic Studio](https://online.pragmaticstudio.com/courses/ruby/) for empowering me with awesome new development skills. - [Best-README-Template](https://github.com/Becca9941/Best-README-Template) for helping me write a README for this project.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Popularity
0.0
No release in over 3 years
This is just a simple gem, created during a Ruby online course for learning purposes.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Popularity
0.0
No release in over 3 years
A simple text-based game from one of Pragmatic Studio's ruby courses.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Popularity
0.0
No release in over 3 years
# Studio Game App This gem runs a simple game with user input. You can input the number of rounds you want to play and type 'quit' when finished playing. The app will print game stats after quitting.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Popularity
0.0
No release in over 3 years
virtual dice game
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Popularity
0.0
No release in over 3 years
Studio Game
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Popularity
0.0
No release in over 3 years
Game from pragmaticstudios course
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Popularity
0.0
No release in over 3 years
This is an example application developed by Abhinav Katoch as part of The Pragmatic Studio's Ruby Programming course, as described at http://pragmaticstudio.com This code is Copyright 2012 The Pragmatic Studio. See the LICENSE file.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Popularity
0.0
No release in over 3 years
Players embark on a journey to score the highest out of all their friends. Along the way, players will encounter danger and assistance, and find many treasures, increasing their points. Good Luck and Happy Playing!!!
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Popularity
0.0
No release in over a year
My first Ruby gem!!
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Popularity
0.0
No release in over 3 years
Gem file from Pragmatic Studio Ruby Course
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Popularity
0.0
No release in over 3 years
# StudioGame (Alec) Jogo de terminal em Ruby com **jogadores, dados, tesouros e variações de jogadores** (Clumsy e Berserk), empacotado como gem. > Nome do gem (exemplo): `studio_game_alec` --- ## 🚀 Instalação e execução ### Rodando direto do código-fonte No diretório do projeto: ```bash ruby bin/studio_game ``` Se você não passar um arquivo de jogadores via CLI, o script usa o `players.csv` que fica em `bin/` por padrão. Também funciona passando um CSV na linha de comando: ```bash ruby bin/studio_game my_favorite_players.csv ``` ### Como gem (local) Empacote e instale localmente: ```bash gem build studio_game.gemspec gem install studio_game_alec-<versao>.gem ``` Depois rode: ```bash studio_game ``` > No Windows, o executável será resolvido pelo RubyGems. Se preferir, rode: `ruby bin/studio_game`. --- ## 📁 Estrutura do projeto ``` games/ ├─ bin/ │ ├─ studio_game # script principal (tem shebang) │ └─ players.csv # CSV padrão (nome,vida) ├─ lib/ │ └─ studio_game/ │ ├─ auditable.rb │ ├─ berserk_player.rb │ ├─ clumsy_player.rb │ ├─ die.rb │ ├─ game.rb │ ├─ game_turn.rb │ ├─ loaded_die.rb │ ├─ playable.rb │ ├─ player.rb │ └─ treasure_trove.rb ├─ spec/ │ └─ studio_game/ # specs RSpec ├─ LICENSE ├─ README.md └─ studio_game.gemspec ``` - **Namespace:** todo o código vive dentro do módulo `StudioGame` para evitar colisões. - **bin/studio_game:** script CLI com shebang (`#!/usr/bin/env ruby`). Faz _fallback_ do `$LOAD_PATH` para `lib` quando usado fora da gem. - **lib/studio_game/**: código da biblioteca (classes/módulos). - **spec/**: testes RSpec. --- ## 🧩 Conceitos principais - **Player** (`player.rb`): representa um jogador com `name`, `health`, coleta tesouros e calcula `score` (= `health` + `points`). Inclui o mixin **Playable**. - **Playable** (`playable.rb`): mixin com `w00t`, `blam` e `strong?` (altera/consulta `health` via getters/setters). - **TreasureTrove** (`treasure_trove.rb`): define `Treasure = Struct.new(:name,:points)` e a constante `TREASURES`; possui `.random`. - **Die/LoadedDie** (`die.rb`, `loaded_die.rb`): rolam valores (o carregado favorece 1,1,2,5,6,6). Ambos incluem **Auditable**. - **Auditable** (`auditable.rb`): imprime “Rolled a X (DieClass)” após cada rolagem. - **Game** (`game.rb`): agrega jogadores, carrega CSV, executa rodadas, soma pontos e salva _high scores_. - **GameTurn** (`game_turn.rb`): executa a lógica de um turno para um jogador (rola dado, aplica `blam/w00t/skip` e concede tesouro). - **ClumsyPlayer / BerserkPlayer**: variações de `Player` que modificam comportamento de `w00t` e de coleta de tesouros. --- ## 🧪 Testes Rode todos os testes: ```bash rspec ``` Principais coisas testadas: - Ordenação de jogadores por `score` (usa `<=>` em `Player`). - Cálculo de `points` e `score` (soma de tesouros + vida). - Efeitos de `w00t`/`blam` e força (`strong?`). - Lógica de turno com _stubs_ de dado (`allow_any_instance_of(LoadedDie).to receive(:roll).and_return(n)`). - Comportamentos de `ClumsyPlayer` e `BerserkPlayer`. --- ## 📦 CSVs e caminhos - `bin/studio_game` resolve o CSV padrão assim: ```ruby default_player_file = File.join(File.dirname(__FILE__), 'players.csv') game.load_players(ARGV.shift || default_player_file) ``` - Você pode passar um arquivo `.csv` via CLI como primeiro argumento. Formato do CSV: ``` Moe,100 Larry,60 Curly,125 ``` --- ## 🧾 High Scores Após sair do loop, o jogo grava `high_score.txt` com as entradas ordenadas. Cada linha é formatada por `Game#high_score_entry`: ``` <nome com padding de pontos> <score> ``` --- ## 🛠️ Dicas de desenvolvimento - Use `require 'studio_game/arquivo'` quando a gem estiver instalada. - No script binário, o `begin/rescue LoadError` faz _fallback_ para `$LOAD_PATH` local, útil fora da gem. - Para debugar I/O em testes, o spec redireciona `STDOUT` (`$stdout = StringIO.new`). --- ## 📚 Licença MIT – veja o arquivo `LICENSE`.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Popularity
0.0
No release in over 3 years
# GAMING
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Popularity
0.0
No release in over 3 years
A simple text-based game from one of Pragmatic Studio's ruby courses.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Popularity
0.0
No release in over 3 years
# Play a game with multiple players, roll a die, a player gets blammed or w00ted and finds treasures and points # to run ./studio_game
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Popularity
0.0
No release in over 3 years
This is the game from the Pragmatic Studio's Ruby course.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Popularity
0.0
No release in over 3 years
Players start with a given score. Throughout the game they can find treasures which increase their score. The object of the game is to accumulate as many points as possible as the rounds continue. Whoever has the highest amount of points wins.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Popularity
0.0
No release in over 3 years
This is an example application used in The Pragmatic Studio's Ruby Programming course, as described at http://pragmaticstudio.com This code is Copyright 2012 Chip Ashby. See the LICENSE file.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Popularity
0.0
No release in over 3 years
My first Ruby gem. Made a game to get the hang of Ruby once again. Game generate a number of users and they battle it out by finding treasure, blamming and w00ting each other.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Popularity
0.0
No release in over 3 years
Hey! This is my first rubygem and I made it with the tutorial at pragmaticstudio.com.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Popularity