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