Skip to content

Commit

Permalink
Add zipfile support to README
Browse files Browse the repository at this point in the history
And enhance CHANGELOG.

[#12]
  • Loading branch information
gonzedge committed Jan 19, 2017
1 parent 55667c0 commit 249f5c6
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
- Add `Serializers` to dump trie into/load trie from disk
[#10][github_issue_10] by [@gonzedge][github_user_gonzedge]

- Supported formats include Ruby's `Marshal` (`.marshal`) and `YAML`
(`.yaml` or `.yml`)
- The format to use is determined by the filepath extension and
`Marshal` is used when a format isn't recognized.

``` ruby
# Save `your_trie` into a file
Rambling::Trie.dump your_trie, 'a filename'
Expand All @@ -23,6 +28,12 @@
trie = Rambling::Trie.load 'a filename'
```

- Add `Serializers::Zip` to handle zip files by
[@gonzedge][github_user_gonzedge]

Automatically detects `.marshal` and `.yaml` files, as well as any
configured `Serializer` based on filepath extension

- Add ability to configure `rambling-trie` [#11][github_issue_11]
by [@gonzedge][github_user_gonzedge]

Expand All @@ -44,6 +55,8 @@
Contained in `Rambling::Trie::Comparable` module. Two nodes are equal to
each other if they have the same letter, they are both either terminal or
non-terminal and their children tree is the same
- Add changelog by [@gonzedge][github_user_gonzedge]
- Add contributing guide by [@gonzedge][github_user_gonzedge]

#### Minor

Expand Down Expand Up @@ -349,7 +362,8 @@
[@gonzedge][github_user_gonzedge]
- Replace instance variables with attr accessors/writers by
[@gonzedge][github_user_gonzedge]
Including `#letter`, `#children`, `#terminal`

Including `#letter`, `#children`, `#terminal`

#### Minor

Expand All @@ -364,6 +378,7 @@
- Remove deprecated `Rambling::Trie.new` entry point by
[@gonzedge][github_user_gonzedge]
- Remove deprecated methods by [@gonzedge][github_user_gonzedge]

Includes `#has_branch_for?`, `#is_word?` and `#add_branch_from`

### Enhancements
Expand Down Expand Up @@ -401,6 +416,7 @@
- Add `Enumerable` capabilities [#5][github_issue_05] by
[@gonzedge][github_user_gonzedge]
- Restructure file/directory tree again by [@gonzedge][github_user_gonzedge]

Files now live under `lib/rambling/trie` instead of `lib/rambling-trie`

#### Minor
Expand Down
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,32 @@ Currently, these formats are supported to store tries on disk:
- Ruby's [binary (Marshal)][marshal] format
- [YAML][yaml]

When dumping into or loading from disk, the format is determined automatically based on the file extension.
> When dumping into or loading from disk, the format is determined
> automatically based on the file extension, so `.yml` or `.yaml` files will be
> handled through `YAML` and `.marshal` files through `Marshal`.
Optionally, you can use a `.zip` version of the supported formats. In order to do so, you'll have to install the [`rubyzip`][rubyzip] gem:

``` bash
gem install rubyzip
```

Or, include it in your `Gemfile` and bundle it:

``` ruby
gem 'rubyzip'
```

Then, you can load contents form a `.zip` file like this:

``` ruby
require 'zip'
trie = Rambling::Trie.load trie, '/path/to/file.zip'
```

> For `.zip` files, the format is also determined automatically based on the
> file extension, so `.yml.zip` or `.yaml.zip` files will be handled through
> `YAML` after decompression and `.marshal.zip` files through `Marshal`.
### Configuration

Expand Down Expand Up @@ -236,6 +261,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
[rbenv]: https://github.com/sstephenson/rbenv
[rubydoc]: http://rubydoc.info/gems/rambling-trie
[rubydoc_github]: http://rubydoc.info/github/gonzedge/rambling-trie
[rubyzip]: https://github.com/rubyzip/rubyzip
[rvm]: https://rvm.io
[travis_ci_badge]: https://travis-ci.org/gonzedge/rambling-trie.svg
[travis_ci_link]: https://travis-ci.org/gonzedge/rambling-trie
Expand Down

0 comments on commit 249f5c6

Please sign in to comment.