Commit ea944f06 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Our markdown renderer doesn't like those newlines

parent 92a4c59b
...@@ -75,12 +75,11 @@ There are a few gotchas with it: ...@@ -75,12 +75,11 @@ There are a few gotchas with it:
- when the original implementation contains a guard clause (e.g. - when the original implementation contains a guard clause (e.g.
`return unless condition`), we cannot easily extend the behaviour by `return unless condition`), we cannot easily extend the behaviour by
overriding the method, because we can't know when the overridden method overriding the method, because we can't know when the overridden method
(i.e. calling super in the overriding method) would want to stop early. (i.e. calling `super` in the overriding method) would want to stop early.
In this case, we shouldn't just override it, but update the original method In this case, we shouldn't just override it, but update the original method
to make it call the other method we want to extend, like a [template method to make it call the other method we want to extend, like a [template method
pattern](https://en.wikipedia.org/wiki/Template_method_pattern). pattern](https://en.wikipedia.org/wiki/Template_method_pattern).
For example, given this base: For example, given this base:
``` ruby ``` ruby
class Base class Base
def execute def execute
...@@ -91,10 +90,8 @@ There are a few gotchas with it: ...@@ -91,10 +90,8 @@ There are a few gotchas with it:
end end
end end
``` ```
Instead of just overriding `Base#execute`, we should update it and extract Instead of just overriding `Base#execute`, we should update it and extract
the behaviour into another method: the behaviour into another method:
``` ruby ``` ruby
class Base class Base
def execute def execute
...@@ -111,9 +108,8 @@ There are a few gotchas with it: ...@@ -111,9 +108,8 @@ There are a few gotchas with it:
end end
end end
``` ```
Then we're free to override that `do_something` without worrying about the
Then we're free to override that `do_something` without worrying the guards: guards:
``` ruby ``` ruby
module EE::Base module EE::Base
def do_something def do_something
...@@ -121,7 +117,6 @@ There are a few gotchas with it: ...@@ -121,7 +117,6 @@ There are a few gotchas with it:
end end
end end
``` ```
This would require updating CE first, or make sure this is back ported to CE. This would require updating CE first, or make sure this is back ported to CE.
When prepending, place them in the `ee/` specific sub-directory, and When prepending, place them in the `ee/` specific sub-directory, and
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment