merb_global 0.0.1 → 0.0.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.
data/HISTORY ADDED
@@ -0,0 +1,11 @@
1
+ === 0.0.2
2
+ * Added language customisation
3
+ * Support for auto-choose of language
4
+ * Support for DataMapper 0.9 (removed for 0.3)
5
+ * Developed examples
6
+ * Clean-up of code
7
+ * Minor other improvements
8
+
9
+ === 0.0.1
10
+ * Basic support for 'view' translation
11
+ * Auto-guess of language on base of Accept-Language header
data/LICENSE CHANGED
@@ -1,4 +1,5 @@
1
- Copyright (c) 2008 Alex Coles, Ikonoklastik Productions
1
+ Copyright (c) 2008 Alex Coles, Ikonoklastik Productions
2
+ Maciej Piechotka
2
3
 
3
4
  Permission is hereby granted, free of charge, to any person obtaining
4
5
  a copy of this software and associated documentation files (the
data/Rakefile CHANGED
@@ -5,32 +5,30 @@ require 'spec/rake/spectask'
5
5
 
6
6
  PLUGIN = "merb_global"
7
7
  NAME = "merb_global"
8
- GEM_VERSION = "0.0.1"
9
- AUTHOR = "Alex Coles"
8
+ GEM_VERSION = "0.0.2"
9
+ AUTHORS = ["Alex Coles", "Maciej Piechotka"]
10
10
  EMAIL = "alex@alexcolesportfolio.com"
11
- HOMEPAGE = "http://github.com/myabc/merb_global/wikis"
11
+ HOMEPAGE = "http://trac.ikonoklastik.com/merb_global/"
12
12
  SUMMARY = "Localization (L10n) and Internationalization (i18n) support for the Merb MVC Framework"
13
13
 
14
14
  spec = Gem::Specification.new do |s|
15
15
  s.name = NAME
16
16
  s.version = GEM_VERSION
17
17
  s.platform = Gem::Platform::RUBY
18
- s.has_rdoc = true
19
- s.extra_rdoc_files = ["README", "LICENSE", 'TODO']
20
18
  s.summary = SUMMARY
21
19
  s.description = s.summary
22
- s.author = AUTHOR
20
+ s.authors = AUTHORS
23
21
  s.email = EMAIL
24
22
  s.homepage = HOMEPAGE
25
23
  s.add_dependency('merb-core', '>= 0.9.1')
26
24
  s.require_path = 'lib'
27
25
  s.autorequire = PLUGIN
28
- s.files = %w(LICENSE README Rakefile TODO) +
26
+ s.files = %w(LICENSE README Rakefile TODO HISTORY) +
29
27
  Dir.glob("{lib,specs,*_generators}/**/*")
30
28
 
31
29
  # rdoc
32
30
  s.has_rdoc = true
33
- s.extra_rdoc_files = %w( README LICENSE TODO )
31
+ s.extra_rdoc_files = %w(README LICENSE TODO HISTORY)
34
32
  end
35
33
 
36
34
  windows = (PLATFORM =~ /win32|cygwin/) rescue nil
@@ -54,7 +52,7 @@ end
54
52
  desc "Run all specs"
55
53
  Spec::Rake::SpecTask.new('specs') do |st|
56
54
  st.libs = ['lib', 'spec']
57
- st.spec_files = FileList['spec/**/*.rb']
55
+ st.spec_files = FileList['spec/**/*_spec.rb']
58
56
  st.spec_opts = ['--format specdoc', '--color']
59
57
  end
60
58
 
@@ -1,9 +1,12 @@
1
1
  class TranslationMigrationGenerator < Merb::GeneratorBase
2
+ protected :banner
3
+
2
4
  def initialize runtime_args, runtime_options = {}
3
- runtime_args.push ""
5
+ runtime_args.push ''
4
6
  super
5
7
  @name = 'translations'
6
8
  end
9
+
7
10
  def mainfest
8
11
  record do |m|
9
12
  m.directory 'schema/migrations'
@@ -11,14 +14,13 @@ class TranslationMigrationGenerator < Merb::GeneratorBase
11
14
  File.basename(f) =~ /^(\d+)/
12
15
  $1
13
16
  end.max
14
- filename = format "%03d_%s", (highest_migration.to_i+1), @name.snake_case
15
- m.template "translation_migration.erb",
17
+ filename = format '%03d_%s', (highest_migration.to_i+1), @name.snake_case
18
+ m.template 'translation_migration.erb',
16
19
  "schema/migrations/#{filename}.rb"
17
20
  puts banner
18
21
  end
19
22
  end
20
23
 
21
- protected :banner
22
24
  def banner
23
25
  <<-EOS
24
26
  A migration to add translation tables to your database has been created.
@@ -1,3 +1,4 @@
1
+ require 'merb_global/config'
1
2
  require 'merb_global/plural'
2
3
  require 'merb_global/provider'
3
4
  require 'merb_global/providers'
@@ -5,12 +6,15 @@ require 'merb_global/providers'
5
6
  module Merb
6
7
  module Global
7
8
  attr_accessor :lang, :provider
9
+
8
10
  def lang #:nodoc:
9
- @lang ||= "en"
11
+ @lang ||= 'en'
10
12
  end
13
+
11
14
  def provider #:nodoc:
12
15
  @provider ||= Merb::Global::Providers.provider
13
16
  end
17
+
14
18
  # call-seq:
15
19
  # _(singular, opts) => translated
16
20
  # _(singlular, plural, opts) => translated
@@ -29,12 +33,12 @@ module Merb
29
33
  # translated<String>:: A translated string
30
34
  #
31
35
  # ==== Example
32
- # <tt>render _("%d file deleted", "%d files deleted", :n => del) % del</tt>
36
+ # <tt>render _('%d file deleted', '%d files deleted', :n => del) % del</tt>
33
37
  def _(*args)
34
38
  opts = {:lang => self.lang, :n => 1}
35
39
  opts.merge! args.pop if args.last.is_a? Hash
36
40
  if args.size == 1
37
- self.provider.translate_to args[0], args[0], opts
41
+ self.provider.translate_to args[0], nil, opts
38
42
  elsif args.size == 2
39
43
  self.provider.translate_to args[0], args[1], opts
40
44
  else
@@ -0,0 +1,29 @@
1
+ module Merb
2
+ module Global
3
+ # call-seq:
4
+ # config(key) => value
5
+ # config([key1, key2, ...]) => value
6
+ # config(key, default) => value
7
+ # config([key1, key2, ...], default) => value
8
+ #
9
+ # Lookup the configuration
10
+ # ==== Params
11
+ # key<Symbol>:: A key
12
+ # keys<Array[Symbol]>:: Keys
13
+ # default<Object>:: A default value
14
+ #
15
+ # ==== Returns
16
+ # value<Object>:: Object read from configuration or default
17
+ #
18
+ # ==== Examples
19
+ # <tt>Merb::Global.config [:gettext, :domain], 'merbapp'</tt>
20
+ def self.config(keys, default = nil)
21
+ keys = [keys] unless keys.is_a? Array
22
+ current = Merb::Plugins.config[:merb_global]
23
+ while current.respond_to?(:[]) and not keys.empty?
24
+ current = current[keys.shift]
25
+ end
26
+ (keys.empty? and not current.nil?) ? current : default
27
+ end
28
+ end
29
+ end
@@ -1,28 +1,51 @@
1
1
  require 'merb_global/base'
2
2
 
3
3
  module Merb
4
- class Controller #:nodoc:
4
+ class Controller
5
5
  include Merb::Global
6
+ class_inheritable_accessor :_language
7
+
6
8
  before do
9
+ # Set up the language
7
10
  accept_language = self.request.env['HTTP_ACCEPT_LANGUAGE']
8
- self.lang = "en"
9
- unless accept_language.nil?
10
- accept_language = accept_language.split(',')
11
- accept_language.collect! {|lang| lang.delete " " "\n" "\r" "\t"}
12
- accept_language.reject! {|lang| lang.empty?}
13
- accept_language.collect! {|lang| lang.split ';q='}
14
- accept_language.collect! do |lang|
15
- if lang.size == 1
16
- [lang[0], 1.0]
17
- else
18
- [lang[0], lang[1].to_f]
11
+ self.lang = params[:language] ||
12
+ (self._language && self._language.call) ||
13
+ begin
14
+ unless accept_language.nil?
15
+ accept_language = accept_language.split(',')
16
+ accept_language.collect! {|lang| lang.delete ' ' "\n" "\r" "\t"}
17
+ accept_language.reject! {|lang| lang.empty?}
18
+ accept_language.collect! {|lang| lang.split ';q='}
19
+ accept_language.collect! do |lang|
20
+ if lang.size == 1
21
+ [lang[0], 1.0]
22
+ else
23
+ [lang[0], lang[1].to_f]
24
+ end
25
+ end
26
+ accept_language.sort! {|lang_a, lang_b| lang_a[1] <=> lang_b[1]}
27
+ accept_language.collect! {|lang| lang[0]}
28
+ accept_language.reject! do |lang|
29
+ lang != '*' and not self.provider.support? lang
30
+ end
31
+ unless accept_language.empty?
32
+ unless accept_language.last == '*'
33
+ accept_language.last
34
+ else
35
+ accept_language.pop
36
+ self.provider.choose accept_language
37
+ end
38
+ end
19
39
  end
20
- end
21
- accept_language.sort! {|lang_a, lang_b| lang_a[1] <=> lang_b[1]}
22
- accept_language.collect! {|lang| lang[0]}
23
- accept_language.reject! {|lang| not self.provider.support? lang}
24
- self.lang = accept_language.last unless accept_language.empty?
25
- end
40
+ end || 'en'
41
+ end
42
+
43
+ # Sets the language of block.
44
+ #
45
+ # The block should return language or nil if other method should be used
46
+ # to determine the language
47
+ def self.language(&block)
48
+ self._language = block
26
49
  end
27
50
  end
28
51
  end
@@ -3,7 +3,7 @@ namespace :merb_global do
3
3
  Merb.start_environment :adapter => 'runner',
4
4
  :environment => ENV['MERB_ENV'] || 'development'
5
5
  end
6
- desc "create migration"
6
+ desc 'Create migration'
7
7
  task :migration => :merb_start do
8
8
  Merb::Global::Providers.provider.create!
9
9
  end
@@ -14,7 +14,7 @@ module Merb
14
14
  #
15
15
  # ==== Parameters
16
16
  # singular<String>:: A string to translate
17
- # plural<String>:: A plural form of string
17
+ # plural<String>:: A plural form of string (nil if only singular)
18
18
  # opts<Hash>:: An options hash (see below)
19
19
  #
20
20
  # ==== Options (opts)
@@ -57,6 +57,13 @@ module Merb
57
57
  def create!
58
58
  raise NoMethodError.new('method create! has not been implemented')
59
59
  end
60
+
61
+ # This method choos an supported language except those form the list
62
+ # given. It may fallback to english if none language can be found
63
+ # which agree with those criteria
64
+ def choose(except)
65
+ raise NoMethodError.new('method choose has not been implemented')
66
+ end
60
67
  end
61
68
  end
62
69
  end
@@ -19,12 +19,14 @@ module Merb
19
19
  end rescue nil
20
20
  return opts[:n] > 1 ? plural : singular # Fallback if not in database
21
21
  end
22
+
22
23
  def support?(lang)
23
24
  Language.count(:conditions => {:name => lang}) != 0
24
25
  end
26
+
25
27
  def create!
26
- migration_exists = Dir[File.join(Merb.root,"schema",
27
- "migrations", "*.rb")].detect do |f|
28
+ migration_exists = Dir[File.join(Merb.root, 'schema',
29
+ 'migrations', '*.rb')].detect do |f|
28
30
  f =~ /translations\.rb/
29
31
  end
30
32
  if migration_exists
@@ -33,9 +35,24 @@ module Merb
33
35
  sh %{merb-gen translations_migration}
34
36
  end
35
37
  end
38
+
39
+ def choose(except)
40
+ if except.empty?
41
+ Language.find(:first).name
42
+ else
43
+ condition = 'name NOT IN (' + '?, ' * (except.length - 1) + '?)'
44
+ Language.find(:first, :conditions => [condition, *except]).name
45
+ end
46
+ # On #rubyonrails the following method was given. However I do not
47
+ # trust it. Please change if the validity is confirmed
48
+ # Language.find(:first, :conditions => ['name NOT IN ?',
49
+ # "(#{except.join(',')})"])
50
+ end
51
+
36
52
  class Language < ::ActiveRecord::Base
37
53
  set_table_name :merb_global_languages
38
54
  end
55
+
39
56
  class Translation < ::ActiveRecord::Base
40
57
  set_table_name :merb_global_translations
41
58
  set_primary_keys :language_id, :msgid_hash, :msgstr_index
@@ -1,10 +1,11 @@
1
1
  require 'data_mapper'
2
+ require 'dm-aggregates'
2
3
  require 'merb_global/plural'
3
4
 
4
5
  module Merb
5
6
  module Global
6
7
  module Providers
7
- class DataMapper < Merb::Global::Provider #:nodoc: all
8
+ class DataMapper #:nodoc: all
8
9
  def translate_to(singular, plural, opts)
9
10
  # I hope it's from MemCache
10
11
  language = Language.first :name => opts[:lang]
@@ -18,32 +19,43 @@ module Merb
18
19
  # Fallback if not in database
19
20
  return opts[:n] != 1 ? plural : singular
20
21
  end
22
+
21
23
  def support?(lang)
22
- Language.count(:name => lang) != 0
24
+ not Language.first(:name => lang).nil?
23
25
  end
26
+
24
27
  def create!
25
28
  Language.auto_migrate!
26
29
  Translation.auto_migrate!
27
30
  end
31
+
32
+ def choose(except)
33
+ Language.first(:name.not => except).name
34
+ end
35
+
28
36
  # When table structure becomes stable it *should* be documented
29
- class Language < ::DataMapper::Base
30
- set_table_name 'merb_global_languages'
31
- property :name, :string, :index => true # It should be unique
32
- property :plural, :text, :lazy => false
33
- validates_uniqueness_of :name
37
+ class Language
38
+ include ::DataMapper::Resource
39
+ storage_names[:default] = 'merb_global_languages'
40
+ property :id, Integer, :serial => true
41
+ property :name, String, :index => :unique
42
+ property :plural, Text, :lazy => false
43
+ # validates_is_unique :name
34
44
  end
35
- class Translation < ::DataMapper::Base
36
- set_table_name 'merb_global_translations'
37
- property :language_id, :integer, :nullable => false, :key => true
45
+
46
+ class Translation
47
+ include ::DataMapper::Resource
48
+ storage_names[:default] = 'merb_global_translations'
49
+ property :language_id, Integer, :nullable => false, :key => true
38
50
  # Sould it be propery :msgid, :text?
39
51
  # This form should be faster. However:
40
52
  # - collision may appear (despite being unpropable)
41
53
  # - it may be wrong optimalisation
42
54
  # As far I'll leave it in this form. If anybody could measure the
43
55
  # speed of both methods it will be appreciate.
44
- property :msgid_hash, :integer, :nullable => false, :key => true
45
- property :msgstr, :text, :nullable => false, :lazy => false
46
- property :msgstr_index, :integer, :nullable => false, :key => true
56
+ property :msgid_hash, Integer, :nullable => false, :key => true
57
+ property :msgstr, Text, :nullable => false, :lazy => false
58
+ property :msgstr_index, Integer, :nullable => false, :key => true
47
59
  #belongs_to :language
48
60
  end
49
61
  end
@@ -15,20 +15,35 @@ module Merb
15
15
  def translate_to(singular, plural, opts)
16
16
  context = Thread.current.gettext_context
17
17
  context.set_locale opts[:lang], true
18
- context.ngettext(singular, plural, opts[:n])
18
+ unless plural.nil?
19
+ context.ngettext singular, plural, opts[:n]
20
+ else
21
+ context.gettext singular
22
+ end
19
23
  end
24
+
20
25
  def support?(lang)
21
- puts File.join(Merb::Global::Providers.localedir, lang)
22
- File.exist? File.join(Merb::Global::Providers.localedir, lang)
26
+ lang == 'en' ||
27
+ File.exist?(File.join(Merb::Global::Providers.localedir, lang))
23
28
  end
29
+
24
30
  def create!
25
31
  File.mkdirs Merb::Global::Providers.localedir
26
32
  end
33
+
34
+ def choose(except)
35
+ dir = Dir[Merb::Global::Providers.localedir + '/*/']
36
+ dir.collect! {|p| File.basename p}
37
+ dir << 'en'
38
+ dir.reject! {|lang| except.include? lang}
39
+ dir.first
40
+ end
41
+
27
42
  class GettextContext
28
43
  include ::GetText
29
- # Please change it to proper location
30
- bindtextdomain "merbapp", Merb::Global::Providers.localedir
31
- public :set_locale, :ngettext
44
+ bindtextdomain Merb::Global.config([:gettext, :domain], 'merbapp'),
45
+ Merb::Global::Providers.localedir
46
+ public :set_locale, :ngettext, :gettext
32
47
  end
33
48
  end
34
49
  end
@@ -5,12 +5,18 @@ module Merb
5
5
  def translate_to(singular, plural, opts)
6
6
  opts[:n] > 1 ? plural : singular
7
7
  end
8
+
8
9
  def support?(lang)
9
10
  true
10
11
  end
12
+
11
13
  def create!
12
14
  nil # It's mock after all ;)
13
15
  end
16
+
17
+ def choose
18
+ 'en'
19
+ end
14
20
  end
15
21
  end
16
22
  end
@@ -8,18 +8,20 @@ module Merb
8
8
  def translate_to(singular, plural, opts)
9
9
  language = Language[:name => opts[:lang]] # I hope it's from MemCache
10
10
  unless language.nil?
11
- n = Plural.which_form opts[:n], language.plural
11
+ n = Plural.which_form opts[:n], language[:plural]
12
12
  translation = Translation[language.pk, singular.hash, n]
13
- return translation.msgstr unless translation.nil?
13
+ return translation[:msgstr] unless translation.nil?
14
14
  end
15
15
  return opts[:n] > 1 ? plural : singular # Fallback if not in database
16
16
  end
17
+
17
18
  def support?(lang)
18
19
  Language.filter(:name => lang).count != 0
19
20
  end
21
+
20
22
  def create!
21
- migration_exists = Dir[File.join(Merb.root,"schema",
22
- "migrations", "*.rb")].detect do |f|
23
+ migration_exists = Dir[File.join(Merb.root, 'schema',
24
+ 'migrations', "*.rb")].detect do |f|
23
25
  f =~ /translations\.rb/
24
26
  end
25
27
  if migration_exists
@@ -28,8 +30,14 @@ module Merb
28
30
  sh %{merb-gen translations_migration}
29
31
  end
30
32
  end
33
+
34
+ def choose(except)
35
+ Language.filter {:name != except}.first[:name]
36
+ end
37
+
31
38
  class Language < ::Sequel::Model(:merb_global_languages)
32
39
  end
40
+
33
41
  class Translation < ::Sequel::Model(:merb_global_translations)
34
42
  set_primary_key :language_id, :msgid_hash, :msgstr_index
35
43
  end
@@ -10,6 +10,7 @@ module Merb
10
10
  # Shouldn't it be sort of cache with some expiration limit?
11
11
  @lang = Hash.new
12
12
  end
13
+
13
14
  def translate_to(singular, plural, opts)
14
15
  unless @lang.include? opts[:lang]
15
16
  file = File.join Merb::Global::Providers.localedir,
@@ -20,15 +21,21 @@ module Merb
20
21
  @lang[opts[:lang]] = nil
21
22
  end
22
23
  end
24
+
23
25
  unless @lang[opts[:lang]].nil?
24
26
  lang = @lang[opts[:lang]]
25
- n = Merb::Global::Plural.which_form opts[:n], lang[:plural]
26
27
  unless lang[singular].nil?
27
- return lang[singular][n] unless lang[singular][n].nil?
28
+ unless plural.nil?
29
+ n = Merb::Global::Plural.which_form opts[:n], lang[:plural]
30
+ return lang[singular][n] unless lang[singular][n].nil?
31
+ else
32
+ return lang[singular] unless lang[singular].nil?
33
+ end
28
34
  end
29
35
  end
30
36
  return opts[:n] > 1 ? plural : singular
31
37
  end
38
+
32
39
  def support?(lang)
33
40
  unless @lang.include? lang
34
41
  file = File.join Merb::Global::Providers.localedir, lang + '.yaml'
@@ -36,10 +43,18 @@ module Merb
36
43
  end
37
44
  not @lang[lang].nil?
38
45
  end
46
+
39
47
  def create!
40
48
  require 'ftools'
41
49
  File.mkdirs Merb::Global::Providers.localedir
42
50
  end
51
+
52
+ def choose(except)
53
+ dir = Dir[Merb::Global::Providers.localedir + '/*.yaml']
54
+ dir.collect! {|p| File.basename p, '.yaml'}
55
+ dir.reject! {|lang| except.include? lang}
56
+ dir.first
57
+ end
43
58
  end
44
59
  end
45
60
  end
@@ -1,6 +1,14 @@
1
1
  module Merb
2
2
  module Global
3
3
  module Providers
4
+ @@provider_name = lambda do
5
+ Merb::Global.config :provider, 'gettext'
6
+ end
7
+ @@provider_loading = lambda do |provider|
8
+ require 'merb_global/providers/' + provider
9
+ @@provider = eval "Merb::Global::Providers::#{provider.camel_case}.new"
10
+ end
11
+
4
12
  # call-seq:
5
13
  # localedir => localdir
6
14
  #
@@ -10,33 +18,15 @@ module Merb
10
18
  # ==== Returns
11
19
  # localedir<String>>:: Directory where the locales are stored
12
20
  def self.localedir
13
- localedir = nil
14
- unless Merb::Plugins.config[:merb_global].nil?
15
- if not Merb::Plugins.config[:merb_global][:localedir].nil?
16
- localedir = Merb::Plugins.config[:merb_global][:localedir]
17
- elsif Merb::Plugins.config[:merb_global][:flat]
18
- localedir = 'locale'
21
+ localedir =
22
+ if Merb::Global.config :flat
23
+ 'locale'
24
+ else
25
+ Merb::Global.config :localedir, File.join('app', 'locale')
19
26
  end
20
- end
21
- localedir ||= File.join('app', 'locale')
22
27
  File.join Merb.root, localedir
23
28
  end
24
- # Is there a way to mark static methods as private?
25
- @@provider_name = lambda do
26
- provider = 'gettext'
27
- unless Merb::Plugins.config[:merb_global].nil?
28
- unless Merb::Plugins.config[:merb_global][:provider].nil?
29
- provider = Merb::Plugins.config[:merb_global][:provider].to_s
30
- end
31
- end
32
- return provider
33
- end
34
- @@provider_loading = lambda do |provider|
35
- # Should it be like that or should the provider be renamed?
36
- require 'merb_global/providers/' + provider
37
- @@provider = eval "Merb::Global::Providers::#{provider.camel_case}.new"
38
- end
39
- @@provider_loading.call @@provider_name.call
29
+
40
30
  # call-seq:
41
31
  # provider => provider
42
32
  #
@@ -45,7 +35,7 @@ module Merb
45
35
  # ==== Returns
46
36
  # provider<Provider>:: Returns provider
47
37
  def self.provider
48
- @@provider
38
+ @@provider ||= @@provider_loading.call @@provider_name.call
49
39
  end
50
40
  end
51
41
  end
data/lib/merb_global.rb CHANGED
@@ -1,6 +1,8 @@
1
+ require 'pathname'
2
+
1
3
  if defined? Merb::Plugins
2
- require 'merb_global/base'
3
- require 'merb_global/controller'
4
+ require Pathname(__FILE__).dirname.expand_path + 'merb_global/base'
5
+ require Pathname(__FILE__).dirname.expand_path + 'merb_global/controller'
4
6
 
5
7
  Merb::Plugins.add_rakefiles 'merb_global/rake'
6
8
  end
@@ -1,9 +1,12 @@
1
1
  class TranslationMigrationGenerator < Merb::GeneratorBase
2
+ protected :banner
3
+
2
4
  def initialize runtime_args, runtime_options = {}
3
- runtime_args.push ""
5
+ runtime_args.push ''
4
6
  super
5
7
  @name = 'translations'
6
8
  end
9
+
7
10
  def mainfest
8
11
  record do |m|
9
12
  m.directory 'schema/migrations'
@@ -12,17 +15,17 @@ class TranslationMigrationGenerator < Merb::GeneratorBase
12
15
  $1
13
16
  end.max
14
17
  filename = format "%03d_%s", (highest_migration.to_i+1), @name.snake_case
15
- m.template "translation_migration.erb",
18
+ m.template 'translation_migration.erb',
16
19
  "schema/migrations/#{filename}.rb"
17
20
  puts banner
18
21
  end
19
22
  end
20
23
 
21
- protected :banner
22
24
  def banner
23
25
  <<-EOS
24
26
  A migration to add translation tables to your database has been created.
25
- Run 'rake sequel:db:migrate' to add the translations migration to your database.
27
+ Run 'rake sequel:db:migrate' to add the translations migration to your
28
+ database.
26
29
 
27
30
  EOS
28
31
  end
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: merb_global
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Coles
8
+ - Maciej Piechotka
8
9
  autorequire: merb_global
9
10
  bindir: bin
10
11
  cert_chain: []
11
12
 
12
- date: 2008-05-20 00:00:00 +02:00
13
+ date: 2008-06-01 00:00:00 +02:00
13
14
  default_executable:
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
@@ -31,15 +32,18 @@ extra_rdoc_files:
31
32
  - README
32
33
  - LICENSE
33
34
  - TODO
35
+ - HISTORY
34
36
  files:
35
37
  - LICENSE
36
38
  - README
37
39
  - Rakefile
38
40
  - TODO
41
+ - HISTORY
39
42
  - lib/merb_global
40
43
  - lib/merb_global/plural.rb
41
44
  - lib/merb_global/providers.rb
42
45
  - lib/merb_global/provider.rb
46
+ - lib/merb_global/config.rb
43
47
  - lib/merb_global/controller.rb
44
48
  - lib/merb_global/base.rb
45
49
  - lib/merb_global/merbrake.rb
@@ -62,7 +66,7 @@ files:
62
66
  - activerecord_generators/translations_migration/templates
63
67
  - activerecord_generators/translations_migration/templates/translations_migration.erb
64
68
  has_rdoc: true
65
- homepage: http://github.com/myabc/merb_global/wikis
69
+ homepage: http://trac.ikonoklastik.com/merb_global/
66
70
  post_install_message:
67
71
  rdoc_options: []
68
72