merb_global 0.0.4 → 0.0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/merb_global/merbrake.rb +10 -1
- metadata +1 -1
data/Rakefile
CHANGED
@@ -5,7 +5,7 @@ require 'spec/rake/spectask'
|
|
5
5
|
|
6
6
|
PLUGIN = "merb_global"
|
7
7
|
NAME = "merb_global"
|
8
|
-
GEM_VERSION = "0.0.4"
|
8
|
+
GEM_VERSION = "0.0.4.1"
|
9
9
|
AUTHORS = ["Alex Coles", "Maciej Piechotka"]
|
10
10
|
EMAIL = "alex@alexcolesportfolio.com"
|
11
11
|
HOMEPAGE = "http://trac.ikonoklastik.com/merb_global/"
|
data/lib/merb_global/merbrake.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
1
3
|
namespace :merb_global do
|
2
4
|
task :merb_start do
|
3
5
|
Merb.start_environment :adapter => 'runner',
|
@@ -12,7 +14,14 @@ namespace :merb_global do
|
|
12
14
|
from = Merb::Global.config 'source', 'gettext'
|
13
15
|
into = Merb::Global.config 'provider', 'gettext'
|
14
16
|
if from == 'gettext' and into == 'gettext'
|
15
|
-
|
17
|
+
Dir[Merb::Global::Providers.localedir + '/*.po'] do |file|
|
18
|
+
lang = File.basename file, '.po'
|
19
|
+
lang_dir = File.join(Merb::Global::Providers.localedir,
|
20
|
+
lang, 'LC_MESSAGES')
|
21
|
+
FileUtils.mkdir_p lang_dir
|
22
|
+
domain = Merb::Global.config([:gettext, :domain], 'merbapp')
|
23
|
+
`msgfmt #{file} -o #{lang_dir}/#{domain}.mo`
|
24
|
+
end
|
16
25
|
elsif from == into
|
17
26
|
Merb.logger.error 'Tried transfer from and into the same provider'
|
18
27
|
else
|