From 534f01605d60ec5977cbbe9dd1018652471d2e02 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Thu, 8 Aug 2024 08:36:01 +0200 Subject: [PATCH 1/2] README.md: 2 spaces to indent in all examples [ci skip] --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2499965a..b2000af4 100644 --- a/README.md +++ b/README.md @@ -128,9 +128,9 @@ being serialized altogether by throwing an exception: ```ruby class Symbol - def to_msgpack_ext - raise "Serialization of symbols prohibited" - end + def to_msgpack_ext + raise "Serialization of symbols prohibited" + end end MessagePack::DefaultFactory.register_type(0x00, Symbol) From d73128a2664292e56c7e2c22a1167a9868e66ae0 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Thu, 8 Aug 2024 08:48:03 +0200 Subject: [PATCH 2/2] README.md: Formatting, links, mention Bundler first --- README.md | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index b2000af4..26473dd6 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 @@ -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