Skip to content
100644 85 lines (63 sloc) 3.54 KB
6e67b50 @jimweirich Updated README with more instructions.
1 # The Gilded Rose Code Kata
3 This is a Ruby version of the Gilded Rose Kata, found
0319bd4 @jimweirich Fixed bad URLs in README
4 [here](
6e67b50 @jimweirich Updated README with more instructions.
6 This is a refactorying kata, so you will be starting with a legacy
7 code base. To work the Kata, clone this git repository and checkout
8 the tag 'start-here'. Read the description below for the "rules"
9 involving this kata.
11 ## Changes from the original
13 This Ruby version follows the original code very closely, but has the
14 following changes:
16 * The original had no tests. Since this is a refactoring kata, I felt
17 the tests were important and provide a fairly complete test suite.
18 Just delete the tests if you wish to "go it alone".
20 * The original used a hard coded set of "items", presumably for
21 testing the code. Since I a test suite, the hard coded values were
22 not of much use. I also changed the interface to accept a list of
23 items as a parameter rather than a hard coded constant.
25 You can read
0319bd4 @jimweirich Fixed bad URLs in README
26 [the original kata article]( for more details.
34eb349 @jimweirich Added branch info to readme
28 ## Git Branches
30 * The 'master' branch contains the starting point for the kata. It is
31 also tagged as 'start-here'.
33 * The 'solution1' branch is my first solution for this kata.
6e67b50 @jimweirich Updated README with more instructions.
35 Hope you enjoy this. -- Jim Weirich
38 # Original Description of the Gilded Rose
65c5a9f Initial Ruby version (with working tests)
Jim Weirich authored
40 Hi and welcome to team Gilded Rose. As you know, we are a small inn
41 with a prime location in a prominent city ran by a friendly innkeeper
42 named Allison. We also buy and sell only the finest
43 goods. Unfortunately, our goods are constantly degrading in quality as
44 they approach their sell by date. We have a system in place that
45 updates our inventory for us. It was developed by a no-nonsense type
46 named Leeroy, who has moved on to new adventures. Your task is to add
47 the new feature to our system so that we can begin selling a new
48 category of items. First an introduction to our system:
50 - All items have a SellIn value which denotes the number of days we
51 have to sell the item
52 - All items have a Quality value which denotes how valuable the item
53 is
54 - At the end of each day our system lowers both values for every item
56 Pretty simple, right? Well this is where it gets interesting:
58 - Once the sell by date has passed, Quality degrades twice as fast
59 - The Quality of an item is never negative
60 - "Aged Brie" actually increases in Quality the older it gets
61 - The Quality of an item is never more than 50
62 - "Sulfuras", being a legendary item, never has to be sold or
63 decreases in Quality
64 - "Backstage passes", like aged brie, increases in Quality as it's
65 SellIn value approaches; Quality increases by 2 when there are 10
66 days or less and by 3 when there are 5 days or less but Quality
67 drops to 0 after the concert
69 We have recently signed a supplier of conjured items. This requires an update to our system:
71 - "Conjured" items degrade in Quality twice as fast as normal items
73 Feel free to make any changes to the UpdateQuality method and add any
74 new code as long as everything still works correctly. However, do not
75 alter the Item class or Items property as those belong to the goblin
76 in the corner who will insta-rage and one-shot you as he doesn't
77 believe in shared code ownership (you can make the UpdateQuality
78 method and Items property static if you like, we'll cover for
79 you). Your work needs to be completed by Friday, February 18, 2011
80 08:00:00 AM PST.
82 Just for clarification, an item can never have its Quality increase
83 above 50, however "Sulfuras" is a legendary item and as such its
84 Quality is 80 and it never alters.
Something went wrong with that request. Please try again.