Ruby Warrior: one action per turn and a profile directory from 2009
GitHub describes it as Game written in Ruby for learning Ruby.. The repository metadata lists Ruby as its primary language. The metadata lists the MIT license. This article stays within the project description and details documented in the GitHub repository README.
At a glance
- What is it?
- A Ruby teaching game whose API is defined by punctuation, where code is frozen for the length of a level, and where the most recent commit landed on 2024-03-27 with no GitHub releases behind it.
- Who is it for?
- Ruby Warrior still fits as a way to practise Ruby conditionals, method calls on returned objects, and state you have to remember between turns, and it fits badly as a project to build on. The gem tracks Ruby 3.3 as of version 0.2.0, the repository has no GitHub releases at all, and the most recent commit is dated 2024-03-27, so treat the gem version as the only release signal.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Probably not. The repository last received commits 32 months ago, on March 27, 2024.
- What is it written in?
- Mainly Ruby, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- ryanb/ruby-warrior3,892 ★ · +2
| Repository | 2026-08-13 | 2026-11-15 |
|---|---|---|
| ryanb/ruby-warrior | 3.9k | 3.9k |
2 Stars in the last 94 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The exclamation mark is the whole API contract
Every method on the warrior falls into one of two groups, and the punctuation is how you tell them apart. Actions change the state of the level: walk!, attack!, rest!, bind!, rescue!. Each takes a direction argument and defaults to forward. Senses only report: feel returns a Space, health returns an integer, distance returns how many spaces away the stairs are, listen returns an array of every occupied space on the floor. Senses cost nothing and can run as often as you like within a turn. Only one action can be performed per turn, so the entire design pressure of the game sits in a single statement that mutates the world, surrounded by any number of calls that merely look at it. That constraint is what forces a real method body rather than a one liner, because the interesting part is deciding which single action to commit to once several senses disagree.
warrior.rest!
Gain 10% of max health back, but do nothing more.Code is frozen once the level starts
The turn loop calls your play_turn method and then calls each enemy's, and there is no hook for changing your code in between. Whatever logic you write has to anticipate everything the floor might contain, because the file cannot be edited until the level resolves. Failure is not punitive in the sense of lost progress: dropping to zero health fails the level, and the fix is to open player.rb, improve the code, and run the command again. Passing a level means reaching the stairs, after which the profile README is rewritten for the next floor and the same file is reused. The generated profile README is also where the current level's abilities are documented, so the ability list is not static documentation you can read once. It is regenerated per level, which means the API surface you program against grows as you climb rather than being fixed at install time.
Scoring rewards clearing a floor, not just surviving it
Reaching the stairs is the minimum. Four separate mechanisms add points: defeating an enemy adds that enemy's maximum health to the score, rescuing a captive is worth a flat 20 points, passing within the bonus time awards whatever seconds remain, and defeating every enemy while rescuing every captive triggers a 20 percent bonus on the level. The flat 20 for a captive is the only one of the four with a number the game states outright. Scores accumulate across levels and are added to a running total on each pass. The game also acknowledges that early perfection is not the goal, since the tower can be re-run once the top is reached so a warrior can be tuned for a high score. That re-run mode is referred to from the scoring section as the Epic Mode below, which is worth noting when comparing the sections this document walks through.
The profile layout changed once, in 2009, and the note never left
The first block after the introduction is a migration note rather than lore: the player directory structure changed on July 18, 2009, and anyone still holding a profile in the level-00* structure has to move the contents of the last level into the parent directory. Seventeen years later this is still the first thing the file tells you, ahead of the installation command, which tells you something about how often the instructions above it get read. The current layout is produced by the setup step. Running the rubywarrior command creates a rubywarrior directory in the current location containing a player.rb stub with an empty play_turn method, and that stub is the only file the player is expected to edit by hand. Everything else the game knows about a floor lives in the repository, not in the profile.
Gem installation is the only command, and Ruby 3.3 is the boundary
The whole getting started path is one install command and then the game binary, with no bundler step and no lockfile mentioned anywhere in the document.
gem install rubywarriorThe version note attached to it is the part that matters for anyone on an older interpreter: as of version 0.2.0 the gem was updated to work with Ruby 3.3, and the advice given for difficulty running it on an older Ruby is to fall back to an older version of the gem. That inverts the usual compatibility expectation, where a newer gem drops old interpreters. Here the gem moved forward onto Ruby 3.3 and the escape hatch is backwards in time, which also means the two ends of that advice are not interchangeable. Level content is not fetched at install time, and the repository layout supports that: towers/ holds the tower data, templates/ holds what gets copied into a profile, and the game logic sits in lib/ with bin/ providing the entry point.
The golem paragraph ends mid-word and leaves its cost unstated
Golems arrive partway up the tower as a second unit the player also controls, and their turn handling is passed as a block rather than through a method of its own:
warrior.form! do |golem|
golem.attack! if golem.feel.enemy?
endThe block is described as a place for the same kind of complex logic that belongs in play_turn, with the suggestion to move it into its own class or to write several classes for different golem types, and multiple golems per level are said to be possible. The sentence explaining what each additional golem costs stops after each one will take half of th. The rest of the file, which follows, is not present here, so the halved quantity is left unstated in what is visible: whether it is health, score, or something else cannot be read off the page. The practical consequence is that golem levels have to be played by experimenting rather than by planning from the documentation, which sits awkwardly beside the scoring section's claim that a 20 point captive and a 20 percent clear bonus make the reward structure knowable in advance.
No releases, a master branch, and a last commit in March 2024
The repository has no GitHub releases, so the version numbers people install from RubyGems have no matching tags in this tree to compare against. The default branch is master. The most recent commit is dated 2024-03-27, which is the fact to plan around: the gem's stated compatibility with Ruby 3.3 and its support for that interpreter are established as of that point rather than being refreshed on a schedule. The top level carries a Rakefile, a Gemfile, a gemspec, cucumber.yml, and a .rspec, with features/ for the end to end suite and spec/ for units, so the test layout is conventional for a project of this age and size. The practical difference between an unversioned tutorial repository and a released library shows up exactly at an upgrade: with no tags, the only handle a user has on what changed is the changelog in the tree and the version the gem manager resolved.
Editorial conclusion
Ruby Warrior still fits as a way to practise Ruby conditionals, method calls on returned objects, and state you have to remember between turns, and it fits badly as a project to build on. The gem tracks Ruby 3.3 as of version 0.2.0, the repository has no GitHub releases at all, and the most recent commit is dated 2024-03-27, so treat the gem version as the only release signal. Before starting, check that your Ruby is 3.3 or newer, and if an old profile directory from the level-00 layout still exists, move its last level contents into the parent directory first.
Frequently asked questions
Does Ruby Warrior work on Ruby 3.3 and newer?
As of version 0.2.0 the gem was updated to work with Ruby 3.3. The documented fallback for difficulty on an older Ruby is to use an older version of the gem, since the compatibility moved forward with the interpreter rather than the gem falling back on its own.
Can I edit player.rb while a Ruby Warrior level is running?
No. Code cannot be changed in the middle of a level, so every possibility on that floor has to be handled in advance. Losing all health fails the level without penalty beyond that, and the fix is to improve player.rb and run the rubywarrior command again.
What does the gem install and how do I start Ruby Warrior?
The gem is installed with gem install rubywarrior, then the rubywarrior command creates a rubywarrior directory in the current location with a player.rb stub containing an empty play_turn method. Running the same command again starts the level, and the profile README is rewritten with the next level's abilities after a floor is passed.
Why is my Ruby Warrior warrior not doing anything?
The generated player.rb stub has an empty play_turn method, so nothing happens until commands are written into it. Only one action ending in an exclamation mark runs per turn, while senses such as feel, health, distance, and listen can be called as often as needed, and the level's available abilities are listed in the profile README for that level.
Is Ruby Warrior still being worked on?
The repository has no GitHub releases, and the most recent commit is dated 2024-03-27 on the master branch. The gem version is therefore the only release signal available, with the changelog in the tree as the other reference point.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/ryanb-ruby-warrior)Star history chart for your README
[](https://hysenlabs.com/projects/ryanb-ruby-warrior)Was this useful?