Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gilded Rose #1

Open
wants to merge 52 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
465dc7f
move first logical branch into its own method, decrement_quality
Apr 4, 2016
d540a68
rename to step 1
Apr 4, 2016
93c3f32
extract step_2 method
Apr 4, 2016
9785a6b
extract step 3 method
Apr 4, 2016
d1df195
actually call step 3
Apr 4, 2016
7940116
extract class QualityAdjuster
Apr 4, 2016
659a0d4
remove unrequired argument item from QualityAdjuster class
Apr 4, 2016
8dfd6d4
change class to decorator of item
Apr 4, 2016
c91736d
rename decorator class to better handle its purpose
Apr 4, 2016
7b063db
call process only inside update_quality loop
Apr 4, 2016
89072b1
begin sulfuras extraction using new DecoratorFactory class
Apr 4, 2016
43d1d35
extract the stuff sulfuras cares about into step 1, 2, and 3
Apr 4, 2016
e1e7a2e
As it turns out, sulfuras does nothing, so lets just no-op the proces…
Apr 4, 2016
692e138
We no longer care about sulfuras checks in our initial decorator
Apr 4, 2016
3563396
New Pass evaluator class for the backstage passes
Apr 4, 2016
5e81a82
override step 1
Apr 4, 2016
308c378
copy step 1 over
Apr 4, 2016
eaf22cf
refactor step 1
Apr 4, 2016
6d8c52f
extract step 2
Apr 4, 2016
d1c18a4
name in pass evaluator definitely not equal to aged brie
Apr 4, 2016
b826779
simplify step 3
Apr 4, 2016
2bf42f1
refactor step 1 in pass evaluator to remove redundant additional cond…
Apr 4, 2016
4a490cf
refactor our original item evaluator to discount backstage pass cases
Apr 4, 2016
3b127ca
decouple passevaluator from ItemEvaluator
Apr 4, 2016
a820967
create agedbrie evaluator
Apr 4, 2016
e8d6d3b
copy over step 1
Apr 4, 2016
39daa9c
accidentally a class map
Apr 4, 2016
f9af533
refactor step 1 in aged brie evaluator
Apr 4, 2016
a0be90f
copy over step 2
Apr 4, 2016
18ce506
copy over step 3
Apr 4, 2016
201fdc4
decouple from item evaluator
Apr 4, 2016
0eda73b
refactor step 3 to be aged brie specific
Apr 4, 2016
961eb4d
refactor item delegator to ignore aged brie cases
Apr 4, 2016
6bd98a7
all classes should implement process
Apr 4, 2016
4d3a21f
additional conjured evaluator class and passing specs
Apr 4, 2016
f5438dd
additional conjured evaluator class and passing specs
Apr 4, 2016
1f628e6
additional conjured item methods
Apr 4, 2016
9ee86b3
Refactor item evaluator with method extraction
Apr 4, 2016
cdc4fa0
add expired? method to item evaluator
Apr 4, 2016
cfc36f6
Fold into process
Apr 4, 2016
f1f8dbe
method extract decrement sell in
Apr 4, 2016
e67adbb
Accentally a greater than
Apr 4, 2016
5ab1a42
extract method in pass evaluator
Apr 4, 2016
8bd6a4e
method extraction
Apr 4, 2016
2f23d61
Move moving methods to private
Apr 4, 2016
d010269
method extraction on aged brie evaluator
Apr 4, 2016
bf1306c
Refactor aged brie evaluator
Apr 4, 2016
78bd6f3
slight refactoring to conjured evaluator
Apr 4, 2016
d1d2e74
accidentally a swap file
Apr 4, 2016
2875bed
Module extraction for perish functionality
Apr 4, 2016
fab01f1
Move expired? to perishable module
Apr 4, 2016
8e93a7b
Remove unrequired decrement sell in references
Apr 4, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rename decorator class to better handle its purpose
  • Loading branch information
ridget committed Apr 4, 2016
commit c91736da692bd808e7ad519085fcba531e77946e
Binary file modified .gilded_rose.rb.swp
Binary file not shown.
4 changes: 2 additions & 2 deletions gilded_rose.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
def update_quality(items)
items.each do |item|
quality_adjuster = QualityAdjuster.new(item)
quality_adjuster = ItemEvaluator.new(item)
quality_adjuster.step_1
quality_adjuster.step_2
quality_adjuster.step_3
end
end

class QualityAdjuster < SimpleDelegator
class ItemEvaluator < SimpleDelegator
def step_1
if name != 'Aged Brie' && name != 'Backstage passes to a TAFKAL80ETC concert'
if quality > 0
Expand Down