tidy_i18n 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/tidy_i18n.rb +2 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6dd847f287fb635623e943b0176b57738646091
|
4
|
+
data.tar.gz: 91a68136f3c3e874d4212a2e9063c3b12e46bce3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8045ab77393db768ec16e0615947837223808392a055840ac3a57ab206d50fd0b9153074aed3839f65879815c5a920db85ad0d0dc283b6971ba610f6f3c42f66
|
7
|
+
data.tar.gz: 718948c6048fc20066e0b729c03ab609e3af3951ca575c7be5e1ae9a001153dbb397f40878c71be95f1799c6fbca5ceca1595d5c8bdfb751eeed28edfa635e70
|
data/lib/tidy_i18n.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "i18n"
|
2
2
|
|
3
3
|
module TidyI18n
|
4
|
+
class ProjectRootNotConfigured < StandardError; end
|
4
5
|
class RaiseAllErrors
|
5
6
|
|
6
7
|
def call(exception, locale, key, options)
|
@@ -26,6 +27,7 @@ module TidyI18n
|
|
26
27
|
end
|
27
28
|
|
28
29
|
def self.translate(key, options={})
|
30
|
+
raise ProjectRootNotConfigured if project_root.nil?
|
29
31
|
if key[0] == "."
|
30
32
|
key_prefix = caller[0].
|
31
33
|
gsub("#{project_root}/", "").
|