Skip to content

Commit

Permalink
Merge pull request #2933 from nebulab/elia/improve-decorators-docs
Browse files Browse the repository at this point in the history
improve decorators / contributing docs
  • Loading branch information
kennyadsl authored Nov 9, 2018
2 parents 4962866 + b9c8add commit 55ab4ea
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
16 changes: 14 additions & 2 deletions guides/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
Based on [https://github.com/joshukraine/middleman-gulp](https://github.com/joshukraine/middleman-gulp)
# Solidus Guides

If you want to contribute to the Solidus documentation be sure to read the
[dedicated section](https://github.com/solidusio/solidus/blob/master/guides/source/contributing.html.md) first.

The documentation files can be found
[inside the `source/` folder](https://github.com/solidusio/solidus/tree/master/guides/source).

---

The Solidus documentation is published with [Middleman](https://middlemanapp.com),
and based on [https://github.com/joshukraine/middleman-gulp](https://github.com/joshukraine/middleman-gulp).

Requirements
------------
Expand All @@ -13,7 +24,7 @@ Usage

1. Install ruby gems `bundle install`

2. Install npm packages `npm install`
2. Install npm packages `npm install`

3. Start the Middleman server. Note that this will also invoke Webpack via the external pipeline.

Expand All @@ -26,4 +37,5 @@ $ bundle exec middleman server
```bash
$ bundle exec middleman build
```

5. Set proper `base_url` in config.rb
3 changes: 3 additions & 0 deletions guides/source/contributing.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

We hope that you will consider contributing to the Solidus documentation.

The Solidus documentation sources are hosted in the main repository
[inside the `guides/` folder](https://github.com/solidusio/solidus/tree/master/guides#readme).

We want to provide the Solidus community with consistent, easy-to-read, and
easy-to-maintain articles. If you decide to submit a pull request, please try to
follow the guidelines listed here.
Expand Down
12 changes: 5 additions & 7 deletions guides/source/developers/extensions/decorators.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ For example, if you want to add a method to the `Spree::Order` model, you could
create `/app/models/mystore/order_decorator.rb` with the following contents:

```ruby
module MyStore
module OrderDecorator
def total
super + BigDecimal(10.0)
end
module MyStore::OrderDecorator
def total
super + BigDecimal(10.0)
end
end

Spree::Order.prepend MyStore::OrderDecorator
Spree::Order.prepend self
end
```

This creates a new module called `MyStore::OrderDecorator` that prepends its
Expand Down

0 comments on commit 55ab4ea

Please sign in to comment.