Skip to content

Commit

Permalink
Updated README and bit of cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Yamolov committed Jan 12, 2015
1 parent c59b033 commit ca1a1e7
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 25 deletions.
58 changes: 46 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,51 @@
# Rencoder

TODO: Write a gem description
Rencoder is pure Ruby implementation of Rencoder serialization format encoding/decoding.

Rencoder is *FULLY* compliant with Python implementation, and uses all optimizations (by-type-offset integers, strings, arrays, hashes) both in encoding and decoding.

## Usage

### Serialization

```ruby
require 'rencoder'

Rencode.dump("Hello World") # Strings

Rencode.dump(100) # Integer

Rencoder.dump(1.0001) # Floats

Rencoder.dump({ hello: "world" }) # Hashes

Rencoder.dump(["hello", :world, 123]) # Arrays
```

**Float precion notice**
Rencoder uses 64-bit precision by default.
It's highly recommended to stay that way.
If there is strong reason to use 32-bit precision, then please specify
``float32: true`` option for ``Rencoder.dump``:

```ruby
Rencoder.dump(1.000001, float32: true)
```
***Using 32-bit precision is highly NOT recommended***

### Deserialization

```ruby
require 'rencoder'

Rencoder.load(hash_data)
# => { 'hello': 'world' }

Rencoder.load(string_data)
# => "Hello World"

# etc
```

## Installation

Expand All @@ -18,14 +63,3 @@ Or install it yourself as:

$ gem install rencoder

## Usage

TODO: Write usage instructions here

## Contributing

1. Fork it ( https://github.com/[my-github-username]/rencoder/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
2 changes: 0 additions & 2 deletions Rakefile

This file was deleted.

1 change: 0 additions & 1 deletion lib/rencoder/coder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ def initialize(options = {})

include Rencoder::Encoder
include Rencoder::Decoder

end
end
19 changes: 9 additions & 10 deletions rencoder.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'rencoder/version'

Gem::Specification.new do |spec|
spec.name = "rencoder"
spec.name = 'rencoder'
spec.version = Rencoder::VERSION
spec.authors = ["Igor Yamolov"]
spec.email = ["[email protected]"]
spec.summary = %q{TODO: Write a short summary. Required.}
spec.description = %q{TODO: Write a longer description. Optional.}
spec.homepage = ""
spec.license = "MIT"
spec.authors = ['Igor Yamolov']
spec.email = ['[email protected]']
spec.summary = %q{Rencoder is pure Ruby implementation of Rencoder serialization format encoding/decoding.}
spec.description = %q{Rencoder is implementation of Rencoder encoding/decoding.}
spec.homepage = 'https://github.com/t3hk0d3/rencoder'
spec.license = 'MIT'

spec.files = `git ls-files -z`.split("\x0")
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.add_development_dependency "bundler", "~> 1.7"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "rspec", "~> 3.1.0"
spec.add_development_dependency 'bundler', '~> 1.7'
spec.add_development_dependency 'rspec', '~> 3.1.0'
end

0 comments on commit ca1a1e7

Please sign in to comment.