Skip to content

Commit

Permalink
[DOC] Added information on the "multi_json" usage into README and web…
Browse files Browse the repository at this point in the history
…site
  • Loading branch information
karmi committed Jun 4, 2011
1 parent 9e2b1f6 commit 8b4401b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ To test-drive the core _ElasticSearch_ functionality, let's require the gem:
Please note that you can copy these snippets from the much more extensive and heavily annotated file
in [examples/tire-dsl.rb](http://karmi.github.com/tire/).

Also, note that we're doing some heavy JSON lifting here. _Tire_ uses the
[_multi_json_](https://github.com/intridea/multi_json) gem as a generic JSON wrapper,
which allows you to use your preferred JSON library. We'll use the
[_yajl-ruby_](https://github.com/brianmario/yajl-ruby) gem in the full on mode here:

```ruby
require 'yajl/json_gem'
```

OK. Let's create an index named `articles` and store/index some documents:

```ruby
Expand Down
8 changes: 8 additions & 0 deletions examples/tire-dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@
# gem install tire
#
require 'rubygems'

# _Tire_ uses the [_multi_json_](https://github.com/intridea/multi_json) gem as a generic JSON library.
# We want to use the [_yajl-ruby_](https://github.com/brianmario/yajl-ruby) gem in its full on mode here.
#
require 'yajl/json_gem'

# Now, let's require the _Tire_ gem itself, and we're ready to go.
#
require 'tire'

#### Prerequisites
Expand Down

0 comments on commit 8b4401b

Please sign in to comment.