Update README.md in addons generator

This commit is contained in:
Luka Murn 2017-02-08 11:15:36 +01:00
parent 5b448a4d4c
commit 1c5c7a50fd
2 changed files with 41 additions and 2 deletions

View file

@ -176,7 +176,12 @@ class AddonGenerator < Rails::Generators::NamedBase
copy_file('.gitignore', "addons/#{@addon_name}/.gitignore")
copy_file('Gemfile', "addons/#{@addon_name}/Gemfile")
copy_file('LICENSE.txt', "addons/#{@addon_name}/LICENSE.txt")
copy_file('README.md', "addons/#{@addon_name}/README.md")
file_path = "addons/#{@addon_name}/README.md"
copy_file('README.md', file_path)
gsub_file(file_path, '${ADDON_NAME}', @addon_name)
gsub_file(file_path, '${FULL_UNDERSCORE_NAME}', @full_underscore_name)
gsub_file(file_path, '${NAME}', name)
gsub_file(file_path, '${FOLDERS_PATH}', @folders_path)
# Rakefile
file_path = "addons/#{@addon_name}/Rakefile"

View file

@ -1 +1,35 @@
# TODO
# sciNote addon - `${ADDON_NAME}`
## How to include this addon inside main sciNote application
* Inside `Gemfile`, add the following reference:
```ruby
gem '${FULL_UNDERSCORE_NAME}',
path: 'addons/${ADDON_NAME}'
```
* Inside `config/routes.rb`, add the following reference:
```ruby
mount ${NAME}::Engine => '/'
```
* If you have any addon-specific JavaScript code, add the following reference inside `app/assets/javascripts/application.js.erb`:
```js
//= require ${FOLDERS_PATH}
```
* If you have any addon-specific CSS code, add the following reference inside `app/assets/stylesheets/application.scss` (starting comment):
```css
*= require ${FOLDERS_PATH}/application
```
Then, do the following:
1. Run `make docker`,
2. Run `make cli` -> `rake db:migrate`,
3. (optional) setup any addon initializers/settings,
4. Start application (`make run`)!