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:
- when the original implementation contains a guard clause (e.g.
`return unless condition`), we cannot easily extend the behaviour by
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
to make it call the other method we want to extend, like a [template method
pattern](https://en.wikipedia.org/wiki/Template_method_pattern).
For example, given this base:
``` ruby
class Base
def execute
......@@ -91,10 +90,8 @@ There are a few gotchas with it:
end
end
```
Instead of just overriding `Base#execute`, we should update it and extract
the behaviour into another method:
``` ruby
class Base
def execute
......@@ -111,9 +108,8 @@ There are a few gotchas with it:
end
end
```
Then we're free to override that `do_something` without worrying the guards:
Then we're free to override that `do_something` without worrying about the
guards:
``` ruby
module EE::Base
def do_something
......@@ -121,7 +117,6 @@ There are a few gotchas with it:
end
end
```
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
......
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