Skip to content

Commit

Permalink
minor [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
bodrovis committed Nov 22, 2022
1 parent 9179947 commit 22544e7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Changelog

## Unreleased
## 2.1.0 (22-Nov-2022)

* `pou` and `pretty_output` are now available inside class methods
* `DICTIONARY_CONF` now contains an instance of the `Config` class that takes care of all configuration options
* Added `lazy` option that enables lazy loading
* Added `on_key_missing` option which is set to `:raise` by default. You can pass a proc or a lambda to this option in order to provide a custom handler that fires when a given key cannot be found.
* Added `file_loader` option to handle custom file loading

## 2.0.0 (22-Nov-2022)
## 2.0.0 (21-Nov-2022)

This is a major re-write of the gem. All core features stay the same and there should not be any breaking changes, except for one thing: you should not use "destructive" methods when transforming your messages.

Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
messages_dictionary (2.0.0)
messages_dictionary (2.1.0)
hashie (~> 5.0)
zeitwerk (~> 2.4)

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class MyOtherClass
def greet
pretty_output(:welcome)
# Or simply
pou(:welcome)
pou :welcome
end
end
```
Expand All @@ -111,7 +111,7 @@ the "Further Customization" section for more info.
So by saying `pretty_output(:show_result, result: result)` you are fetching a message under the key
`show_result` and replace the `{{result}}` part with the value of the `result` variable. Simple, eh?

## Nesting
### Nesting

MessagesDictionary supports nesting (similar to localization files in Rails):

Expand All @@ -136,7 +136,7 @@ class MyClass
end
```

## Indifferent Access
### Indifferent Access

Keys can be passed to the `pou` method as symbols or strings - it does not really matter:

Expand Down Expand Up @@ -168,7 +168,7 @@ inside the same directory. However, this behavior can be easily changed with the
```ruby
class MyClass
include MessagesDictionary
has_messages_dictionary file: 'some_file.yml', dir: 'C:\my_docs'
has_messages_dictionary file: 'some_file.yml', dir: 'my_docs'
end
```

Expand Down
2 changes: 1 addition & 1 deletion lib/messages_dictionary/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module MessagesDictionary
VERSION = '2.0.0'
VERSION = '2.1.0'
end

0 comments on commit 22544e7

Please sign in to comment.