Skip to content

Commit efaea0c

Browse files
committed
minor: fix README for yardoc code formatting issues
1 parent c1f00f6 commit efaea0c

File tree

1 file changed

+51
-18
lines changed

1 file changed

+51
-18
lines changed

README.md

Lines changed: 51 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ has a link to API Documentation for the current release.
1818

1919
If you have the source, you can generate the matching documentation by typing
2020

21-
$ rake docs
21+
```sh
22+
$ rake docs
23+
```
2224

2325
Once generated, the API documentation can be found in the docs/ folder.
2426

@@ -73,16 +75,22 @@ Note that if you're on 1.8.7, be sure that you're using a patchlevel >= 249. The
7375

7476
### Gems
7577

76-
$ gem update --system
77-
$ gem install mongo
78+
```sh
79+
$ gem update --system
80+
$ gem install mongo
81+
```
7882

7983
For a significant performance boost, you'll want to install the C extension:
8084

81-
$ gem install bson_ext
85+
```sh
86+
$ gem install bson_ext
87+
```
8288

8389
Note that bson_ext isn't used with JRuby. Instead, we use some native Java extensions are bundled with the bson gem. If you ever need to modify these extensions, you can recompile with the following rake task:
8490

85-
$ rake compile:jbson
91+
```sh
92+
$ rake compile:jbson
93+
```
8694

8795
### From the GitHub source
8896

@@ -91,7 +99,9 @@ You can either clone the git repository or download a tarball or zip file.
9199
Once you have the source, you can use it from wherever you downloaded it or
92100
you can install it as a gem from the source by typing:
93101

94-
$ rake install
102+
```sh
103+
$ rake install
104+
```
95105

96106
# Examples
97107

@@ -140,7 +150,7 @@ timeout for waiting for old connections to be released to the pool.
140150
To set up a pooled connection to a single MongoDB instance:
141151

142152
```ruby
143-
@client = MongoClient.new("localhost", 27017, :pool_size => 5, :pool_timeout => 5)
153+
@client = MongoClient.new("localhost", 27017, :pool_size => 5, :pool_timeout => 5)
144154
```
145155

146156
Though the pooling architecture will undoubtedly evolve, it currently owes much credit
@@ -208,6 +218,7 @@ database. The idea here is that whenever a record is inserted, the
208218
returned will be inserted.
209219

210220
Here is a sample primary key factory, taken from the tests:
221+
211222
```ruby
212223
class TestPKFactory
213224
def create_pk(doc)
@@ -216,10 +227,12 @@ class TestPKFactory
216227
end
217228
end
218229
```
230+
219231
Here's a slightly more sophisticated one that handles both symbol and string
220232
keys. This is the PKFactory that comes with the MongoRecord code (an
221233
ActiveRecord-like framework for non-Rails apps) and the AR Mongo adapter code
222234
(for Rails):
235+
223236
```ruby
224237
class PKFactory
225238
def create_pk(doc)
@@ -286,44 +299,64 @@ request.
286299

287300
Before running the tests, make sure you install all test dependencies by running:
288301

289-
$ gem install bundler; bundle install
302+
```sh
303+
$ gem install bundler; bundle install
304+
```
290305

291306
To run all default test suites (without the BSON extensions) just type:
292307

293-
$ rake test
308+
```sh
309+
$ rake test
310+
```
294311

295312
If you want to run the default test suite using the BSON extensions:
296313

297-
$ rake test:ext
314+
```sh
315+
$ rake test:ext
316+
```
298317

299318
These will run both unit and functional tests. To run these tests alone:
300319

301-
$ rake test:unit
302-
$ rake test:functional
320+
```sh
321+
$ rake test:unit
322+
$ rake test:functional
323+
```
303324

304325
To run any individual rake tasks with the BSON extension disabled, just pass BSON_EXT_DISABLED=true to the task:
305326

306-
$ rake test:unit BSON_EXT_DISABLED=true
327+
```sh
328+
$ rake test:unit BSON_EXT_DISABLED=true
329+
```
307330

308331
If you want to test replica set, you can run the following task:
309332

310-
$ rake test:replica_set
333+
```sh
334+
$ rake test:replica_set
335+
```
311336

312337
To run a single test at the top level, add -Itest since we no longer modify LOAD_PATH:
313338

314-
$ ruby -Itest -Ilib test/bson/bson_test.rb
339+
```sh
340+
$ ruby -Itest -Ilib test/bson/bson_test.rb
341+
```
315342

316343
To run a single test from the test directory, add -I. since we no longer modify LOAD_PATH:
317344

318-
$ ruby -I. -I../lib bson/bson_test.rb
345+
```sh
346+
$ ruby -I. -I../lib bson/bson_test.rb
347+
```
319348

320349
To run a single test from its subdirectory, add -I.. since we no longer modify LOAD_PATH:
321350

322-
$ ruby -I.. -I../../lib bson_test.rb
351+
```sh
352+
$ ruby -I.. -I../../lib bson_test.rb
353+
```
323354

324355
To fix the following error on Mac OS X - "/.../lib/bson_ext/cbson.bundle: [BUG] Segmentation fault":
325356

326-
$ rake compile
357+
```sh
358+
$ rake compile
359+
```
327360

328361
# Release Notes
329362

0 commit comments

Comments
 (0)