smart_locales 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -5
- data/lib/smart_locales/title/{helper.rb → helpers.rb} +1 -1
- data/lib/smart_locales/title/helpers.yml +8 -0
- data/lib/smart_locales/version.rb +1 -1
- data/lib/smart_locales.rb +4 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcf6a300c0cf6389b99822b14a15358a4e42b637
|
4
|
+
data.tar.gz: 9a44fe4b93a41366e0f4379e54e965c6076153a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2118ed297758528bcb49f8ae39bd4e001c634a443091d79f57ef957db4e83817fabb542ab9e58b60e22fa003aed96ec931b444171964dc9c96d107e75a1ffb4
|
7
|
+
data.tar.gz: 9244a86e02546da06b4925e1dfc17e797ce7bbf21ad328a42812ffd1ad86358e74f4ff698a281dc6dc08273d21eee7ad6a996670d8ca5f011ade4fd64b757656
|
data/README.md
CHANGED
@@ -1,9 +1,5 @@
|
|
1
1
|
# SmartLocales
|
2
2
|
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/smart_locales`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
|
-
|
7
3
|
## Installation
|
8
4
|
|
9
5
|
Add this line to your application's Gemfile:
|
@@ -22,7 +18,21 @@ Or install it yourself as:
|
|
22
18
|
|
23
19
|
## Usage
|
24
20
|
|
25
|
-
|
21
|
+
### Helpers
|
22
|
+
|
23
|
+
* page_title
|
24
|
+
* default_title
|
25
|
+
* title
|
26
|
+
|
27
|
+
Using `page_title`
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
page_title(action_name, genitive_model_name)
|
31
|
+
|
32
|
+
# FOR EXAMPLE
|
33
|
+
|
34
|
+
page_title(:create, 'пользователя') => 'Создать пользователя'
|
35
|
+
```
|
26
36
|
|
27
37
|
## Development
|
28
38
|
|
data/lib/smart_locales.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
require "smart_locales/version"
|
2
2
|
require "smart_locales/title"
|
3
|
-
require "smart_locales/title/
|
3
|
+
require "smart_locales/title/helpers"
|
4
4
|
|
5
5
|
module SmartLocales
|
6
|
-
|
6
|
+
gem_root = Gem::Specification.find_by_name('smart_locales').gem_dir
|
7
|
+
I18n.load_path << gem_root + '/lib/smart_locales/title/helpers.yml'
|
8
|
+
ActionView::Base.send :include, SmartLocales::Title::Helpers
|
7
9
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_locales
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
@@ -54,7 +54,8 @@ files:
|
|
54
54
|
- bin/setup
|
55
55
|
- lib/smart_locales.rb
|
56
56
|
- lib/smart_locales/title.rb
|
57
|
-
- lib/smart_locales/title/
|
57
|
+
- lib/smart_locales/title/helpers.rb
|
58
|
+
- lib/smart_locales/title/helpers.yml
|
58
59
|
- lib/smart_locales/version.rb
|
59
60
|
- smart_locales.gemspec
|
60
61
|
homepage: https://github.com/kalashnikovisme/smart_locales
|