Skip to content

Commit 05e84bd

Browse files
committed
Update documentation
1 parent 12efebe commit 05e84bd

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

README.md

+21-13
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
# Platforms::Core
2+
23
This is a Ruby library which brings together open source and (at least
34
initially) Microsoft platforms. There are various gems out there to
45
do OAuth2 authentication, REST calls, and so on. However, this brings
56
everything together in one easy-to-use package.
67

78
The goal is to create a minimal representation of the external data service in order to build fuller integrations.
8-
There is no particular integration in mind, so Platforms::Core should be as generic as possible to enable
9-
different platforms together.
9+
There is no particular integration in mind, so Platforms::Core should be as generic as possible to enable a variety of different integration types.
1010

1111
## Usage
1212

1313
The Core gem is typically not used on its own. Instead use it in conjunction with one (or more!) platform-specific
1414
libraries. Those should require Platforms::Core themselves.
1515

1616
## Installation
17+
1718
Add this line to your application's Gemfile:
1819

1920
```ruby
@@ -32,16 +33,16 @@ Or install it yourself as:
3233
$ gem install platforms-core
3334
```
3435

35-
Once the gem is installed, from your Rails directory you will can run the following generator to complete the installation:
36+
Once the gem is installed, from your Rails directory you can run the following generator to complete the installation:
3637

3738
```bash
3839
$ rails generate platforms:core:install
3940
```
4041

4142
This will:
4243

43-
* Copy a basic initializer to `config/initializers/platforms_core.rb`; and
44-
* Install the gem's migrations into your application.
44+
* Add a basic initializer to `config/initializers/platforms_core.rb`; and
45+
* Copy the gem's migrations into your application.
4546

4647
## Configuration
4748

@@ -55,24 +56,32 @@ Your application needs to have at least `Network` and `User` models. These can b
5556
```bash
5657
$ rails generate platform:core:network foo some_info:string
5758
$ rails generate platform:core:user bar user more_info:string
59+
$ rake db:migrate
5860
```
5961

60-
Most of the options for the regular ActiveRecord model generator are available, including namespacing and indexing.
62+
Most of the options for the regular [ActiveRecord model generator](https://guides.rubyonrails.org/active_record_migrations.html#model-generators) are available, including namespacing and indexing for columns.
6163

62-
This is roughly equivalent to calling the standard Rails model generators (`rails g model foo some_info:string`), however by using the above version the resulting models are configured by Platforms::Core as the `Network` or `User` models.
64+
The above commands are roughly equivalent to calling the regular ActiveRecord model generators (`rails g model foo some_info:string`), but also configure the models in Platforms::Core as the `Network` or `User` models.
6365

64-
Typically these would be called "Network" and "User", but here we have called them "Foo" and "Bar".
66+
Typically these would actually be called "Network" and "User", but here we have called them "Foo" and "Bar".
6567

6668
### Adding to an Existing App
6769

68-
If you already have `Network` and `User` models (which let's assume are called "Foo" and "Bar" respectively), you can add the relevant configuration by using the generator with the `--existing-model` flag:
70+
If you already have `Network` and `User` models (which let's assume are called "Foo" and "Bar" respectively), you can configure them for Platforms::Core by using the generator with the `--existing-model` flag:
6971

7072
```bash
7173
$ rails generate platform:core:network foo --existing-model
7274
$ rails generate platform:core:user bar --existing-model
75+
$ rake db:migrate
7376
```
7477

75-
This will add the relevant concerns to the models, and update the initializer, without needing to create models from scratch.
78+
This will skip the model creation, but will still:
79+
80+
* Create migrations for the Foo and Bar models;
81+
* Add the relevant concerns to each models; and
82+
* Update the `platforms_core` initializer.
83+
84+
Again, this accepts the standard naming convention for Rails files, so use `admin/my_foo` if you model is Admin::MyFoo.
7685

7786
### Manual Configuration
7887

@@ -84,7 +93,7 @@ Finally, if you don't want to use the built-in generators then you can always cr
8493
class Network < ApplicationRecord
8594
include Platforms::Core::AppNetwork
8695

87-
# This requires an integer database column called
96+
# This module expects an integer database column called
8897
# 'platforms_network_id'
8998

9099
# ...
@@ -99,7 +108,7 @@ and for a `User`:
99108
class User < ApplicationRecord
100109
include Platforms::Core::AppUser
101110

102-
# This requires an integer database column called
111+
# This module expects an integer database column called
103112
# 'platforms_user_id'
104113

105114
# ...
@@ -130,7 +139,6 @@ If not everything is documented, check this with:
130139
$ yard stats --list-undoc
131140
```
132141

133-
134142
## Contributing
135143

136144
Please see [CONTRIBUTING.md](CONTRIBUTING.md).

0 commit comments

Comments
 (0)