Skip to content

Commit

Permalink
README.md: Formatting, links, mention Bundler first
Browse files Browse the repository at this point in the history
  • Loading branch information
olleolleolle authored Aug 8, 2024
1 parent 534f016 commit d73128a
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,24 @@ and typical short strings only require an extra byte in addition to the strings
If you ever wished to use JSON for convenience (storing an image with metadata) but could
not for technical reasons (binary data, size, speed...), MessagePack is a perfect replacement.

require 'msgpack'
msg = [1,2,3].to_msgpack #=> "\x93\x01\x02\x03"
MessagePack.unpack(msg) #=> [1,2,3]
```ruby
require 'msgpack'
msg = [1,2,3].to_msgpack #=> "\x93\x01\x02\x03"
MessagePack.unpack(msg) #=> [1,2,3]
```

Add msgpack to your Gemfile to install with Bundler:

```ruby
# Gemfile
gem 'msgpack'
```

Use RubyGems to install:
Or, use RubyGems to install:

gem install msgpack

or build msgpack-ruby and install:
Or, build msgpack-ruby and install from a checked-out msgpack-ruby repository:

bundle
rake
Expand All @@ -27,11 +36,11 @@ or build msgpack-ruby and install:

* Create REST API returing MessagePack using Rails + [RABL](https://github.com/nesquena/rabl)
* Store objects efficiently serialized by msgpack on memcached or Redis
* In fact Redis supports msgpack in [EVAL-scripts](http://redis.io/commands/eval)
* In fact Redis supports msgpack in [EVAL-scripts](https://redis.io/docs/latest/commands/eval/)
* Upload data in efficient format from mobile devices such as smartphones
* MessagePack works on iPhone/iPad and Android. See also [Objective-C](https://github.com/msgpack/msgpack-objectivec) and [Java](https://github.com/msgpack/msgpack-java) implementations
* Design a portable protocol to communicate with embedded devices
* Check also [Fluentd](http://fluentd.org/) which is a log collector which uses msgpack for the log format (they say it uses JSON but actually it's msgpack, which is compatible with JSON)
* Check also [Fluentd](https://www.fluentd.org) which is a log collector which uses msgpack for the log format (they say it uses JSON but actually it's msgpack, which is compatible with JSON)
* Exchange objects between software components written in different languages
* You'll need a flexible but efficient format so that components exchange objects while keeping compatibility

Expand Down Expand Up @@ -276,8 +285,8 @@ If this directory has Gemfile.lock (generated with MRI), remove it beforehand.

## Updating documents

Online documents (http://ruby.msgpack.org) is generated from gh-pages branch.
Following commands update documents in gh-pages branch:
Online documentation (https://ruby.msgpack.org) is generated from the gh-pages branch.
To update documents in gh-pages branch:

bundle exec rake doc
git checkout gh-pages
Expand Down

0 comments on commit d73128a

Please sign in to comment.