Skip to content

Starting code for the GildedRose Refactoring Kata in many programming languages.

License

Notifications You must be signed in to change notification settings

obean/GildedRose-Refactoring-Kata

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gilded Rose Refactoring Kata

This Kata was originally created by Terry Hughes (http://twitter.com/TerryHughes). It is already on GitHub here. See also Bobby Johnson's description of the kata.

Run the program

  • clone this repo
  • install gems
$ cd ruby
$ bundle
  • run in irb
$ irb -r './lib/gilded_rose.rb'

Testing

  • from the root file run:
rspec

Test Linting

  • from root file run:
 $ rubocop

Specification

User Stories

As a user
So that I can keep track of stock quality
I want a program to do that for me
As an inkeeper
So that I can add new products
I want it to be easily modifiable
As an inkeeper
Due to buying new products which are conjured
I want the code to degrade my new product type twice as fast as a normal item

Aim

  • implement a new item type condition in the GildedRose class
    • new type is conjuring
      • Every day, an item of this type's quality will degrade by 2 if the sell_in value is 0 or above
      • after this, it will decrease by 4 every time.
  • refactor existing code to make it easier to implement new features
  • provide a solid test base with high coverage

Rubocop

Although linting was initially done with rubocop, I disagreed with the use of an if else statement over a case statement in the update_quality method. I found it less readable so have opted for the case statement. Due to this, rubocop does have active offences on this program.

About

Starting code for the GildedRose Refactoring Kata in many programming languages.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 75.2%
  • XSLT 2.0%
  • Ruby 1.9%
  • Pascal 1.7%
  • C# 1.4%
  • PLpgSQL 1.1%
  • Other 16.7%