gettext 1.9.0-mswin32 → 1.10.0-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +122 -1
- data/NEWS +21 -0
- data/README +30 -22
- data/data/locale/bs/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/bs/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/ca/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/ca/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/cs/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/cs/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/de/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/de/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/el/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/el/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/eo/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/eo/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/es/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/es/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/et/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/fr/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/fr/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/hr/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/hr/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/it/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/it/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/ja/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/ja/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/ko/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/ko/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/nb/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/nb/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/nl/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/nl/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/pt_BR/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/pt_BR/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/ru/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/ru/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/sv/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/vi/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/vi/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/zh/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/zh/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/zh_TW/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/zh_TW/LC_MESSAGES/rgettext.mo +0 -0
- data/ext/gettext/Makefile +2 -2
- data/ext/gettext/locale_system.o +0 -0
- data/ext/gettext/locale_system.so +0 -0
- data/lib/gettext/active_record.rb +51 -31
- data/lib/gettext/locale_win32.rb +2 -1
- data/lib/gettext/parser/active_record.rb +2 -2
- data/lib/gettext/parser/ruby.rb +2 -2
- data/lib/gettext/poparser.rb +303 -298
- data/lib/gettext/rails.rb +104 -50
- data/lib/gettext/rails_compat.rb +16 -0
- data/lib/gettext/rgettext.rb +37 -3
- data/lib/gettext/textdomain.rb +45 -6
- data/lib/gettext/utils.rb +7 -0
- data/lib/gettext/version.rb +1 -1
- data/lib/gettext.rb +119 -37
- data/lib/locale_system.so +0 -0
- data/po/bs/rails.po +148 -0
- data/po/bs/rgettext.po +131 -0
- data/po/ca/rails.po +45 -26
- data/po/ca/rgettext.po +21 -21
- data/po/cs/rails.po +46 -24
- data/po/cs/rgettext.po +21 -21
- data/po/de/rails.po +46 -27
- data/po/de/rgettext.po +21 -21
- data/po/el/rails.po +46 -25
- data/po/el/rgettext.po +22 -22
- data/po/eo/rails.po +49 -30
- data/po/eo/rgettext.po +21 -21
- data/po/es/rails.po +45 -24
- data/po/es/rgettext.po +21 -21
- data/po/et/rails.po +49 -30
- data/po/fr/rails.po +47 -28
- data/po/fr/rgettext.po +31 -29
- data/po/hr/rails.po +148 -0
- data/po/hr/rgettext.po +131 -0
- data/po/it/rails.po +42 -24
- data/po/it/rgettext.po +21 -21
- data/po/ja/rails.po +43 -25
- data/po/ja/rgettext.po +21 -21
- data/po/ko/rails.po +44 -24
- data/po/ko/rgettext.po +21 -21
- data/po/nb/rails.po +140 -0
- data/po/nb/rgettext.po +127 -0
- data/po/nl/rails.po +50 -30
- data/po/nl/rgettext.po +21 -21
- data/po/pt_BR/rails.po +48 -29
- data/po/pt_BR/rgettext.po +21 -21
- data/po/rails.pot +42 -24
- data/po/rgettext.pot +21 -21
- data/po/ru/rails.po +50 -31
- data/po/ru/rgettext.po +21 -21
- data/po/sv/rgettext.po +21 -21
- data/po/vi/rails.po +141 -0
- data/po/vi/rgettext.po +126 -0
- data/po/zh/rails.po +60 -43
- data/po/zh/rgettext.po +22 -22
- data/po/zh_TW/rails.po +61 -43
- data/po/zh_TW/rgettext.po +22 -22
- data/samples/cgi/locale/bs/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/bs/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/bs/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/bs/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/locale/hr/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/hr/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/hr/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/hr/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/locale/nb/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/nb/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/nb/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/nb/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/locale/vi/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/vi/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/vi/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/vi/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/po/bs/helloerb1.po +59 -0
- data/samples/cgi/po/bs/helloerb2.po +51 -0
- data/samples/cgi/po/bs/hellolib.po +23 -0
- data/samples/cgi/po/bs/main.po +83 -0
- data/samples/cgi/po/hr/helloerb1.po +59 -0
- data/samples/cgi/po/hr/helloerb2.po +51 -0
- data/samples/cgi/po/hr/hellolib.po +23 -0
- data/samples/cgi/po/hr/main.po +83 -0
- data/samples/cgi/po/nb/helloerb1.po +58 -0
- data/samples/cgi/po/nb/helloerb2.po +50 -0
- data/samples/cgi/po/nb/hellolib.po +22 -0
- data/samples/cgi/po/nb/main.po +82 -0
- data/samples/cgi/po/vi/helloerb1.po +65 -0
- data/samples/cgi/po/vi/helloerb2.po +52 -0
- data/samples/cgi/po/vi/hellolib.po +24 -0
- data/samples/cgi/po/vi/main.po +77 -0
- data/samples/locale/bs/LC_MESSAGES/hello.mo +0 -0
- data/samples/locale/bs/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/bs/LC_MESSAGES/hello_noop.mo +0 -0
- data/samples/locale/bs/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/bs/LC_MESSAGES/helloglade2.mo +0 -0
- data/samples/locale/bs/LC_MESSAGES/hellogtk.mo +0 -0
- data/samples/locale/bs/LC_MESSAGES/hellotk.mo +0 -0
- data/samples/locale/hr/LC_MESSAGES/hello.mo +0 -0
- data/samples/locale/hr/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/hr/LC_MESSAGES/hello_noop.mo +0 -0
- data/samples/locale/hr/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/hr/LC_MESSAGES/helloglade2.mo +0 -0
- data/samples/locale/hr/LC_MESSAGES/hellogtk.mo +0 -0
- data/samples/locale/hr/LC_MESSAGES/hellotk.mo +0 -0
- data/samples/locale/ja/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/nb/LC_MESSAGES/hello.mo +0 -0
- data/samples/locale/nb/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/nb/LC_MESSAGES/hello_noop.mo +0 -0
- data/samples/locale/nb/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/nb/LC_MESSAGES/helloglade2.mo +0 -0
- data/samples/locale/nb/LC_MESSAGES/hellogtk.mo +0 -0
- data/samples/locale/nb/LC_MESSAGES/hellotk.mo +0 -0
- data/samples/locale/vi/LC_MESSAGES/hello.mo +0 -0
- data/samples/locale/vi/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/vi/LC_MESSAGES/hello_noop.mo +0 -0
- data/samples/locale/vi/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/vi/LC_MESSAGES/helloglade2.mo +0 -0
- data/samples/locale/vi/LC_MESSAGES/hellogtk.mo +0 -0
- data/samples/locale/vi/LC_MESSAGES/hellotk.mo +0 -0
- data/samples/po/bs/hello.po +23 -0
- data/samples/po/bs/hello2.po +31 -0
- data/samples/po/bs/hello_noop.po +27 -0
- data/samples/po/bs/hello_plural.po +26 -0
- data/samples/po/bs/helloglade2.po +31 -0
- data/samples/po/bs/hellogtk.po +23 -0
- data/samples/po/bs/hellotk.po +23 -0
- data/samples/po/hr/hello.po +23 -0
- data/samples/po/hr/hello2.po +31 -0
- data/samples/po/hr/hello_noop.po +27 -0
- data/samples/po/hr/hello_plural.po +26 -0
- data/samples/po/hr/helloglade2.po +31 -0
- data/samples/po/hr/hellogtk.po +23 -0
- data/samples/po/hr/hellotk.po +23 -0
- data/samples/po/ja/hello_plural.po +1 -1
- data/samples/po/nb/hello.po +22 -0
- data/samples/po/nb/hello2.po +31 -0
- data/samples/po/nb/hello_noop.po +26 -0
- data/samples/po/nb/hello_plural.po +24 -0
- data/samples/po/nb/helloglade2.po +30 -0
- data/samples/po/nb/hellogtk.po +22 -0
- data/samples/po/nb/hellotk.po +22 -0
- data/samples/po/vi/hello.po +23 -0
- data/samples/po/vi/hello2.po +31 -0
- data/samples/po/vi/hello_noop.po +27 -0
- data/samples/po/vi/hello_plural.po +26 -0
- data/samples/po/vi/helloglade2.po +38 -0
- data/samples/po/vi/hellogtk.po +23 -0
- data/samples/po/vi/hellotk.po +24 -0
- data/samples/rails/locale/bs/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/hr/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/nb/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/vi/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/po/bs/blog.po +106 -0
- data/samples/rails/po/hr/blog.po +106 -0
- data/samples/rails/po/nb/blog.po +104 -0
- data/samples/rails/po/vi/blog.po +110 -0
- data/samples/rails/vendor/plugins/gettext/locale/bs/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/vendor/plugins/gettext/locale/hr/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/vendor/plugins/gettext/locale/nb/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/vendor/plugins/gettext/locale/vi/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/vendor/plugins/gettext/po/bs/gettext_plugin.po +27 -0
- data/samples/rails/vendor/plugins/gettext/po/hr/gettext_plugin.po +27 -0
- data/samples/rails/vendor/plugins/gettext/po/nb/gettext_plugin.po +27 -0
- data/samples/rails/vendor/plugins/gettext/po/vi/gettext_plugin.po +28 -0
- data/src/poparser.ry +9 -4
- data/test/README +2 -0
- data/test/Rakefile +2 -0
- data/test/gettext_test.rb +51 -13
- data/test/gettext_test_active_record.rb +33 -0
- data/test/gettext_test_parser.rb +5 -0
- data/test/gettext_test_rails_caching.rb +211 -0
- data/test/locale/da/LC_MESSAGES/plural_error.mo +0 -0
- data/test/locale/fr/LC_MESSAGES/plural.mo +0 -0
- data/test/locale/fr/LC_MESSAGES/plural_error.mo +0 -0
- data/test/locale/ja/LC_MESSAGES/plural.mo +0 -0
- data/test/locale/ja/LC_MESSAGES/plural_error.mo +0 -0
- data/test/locale/ja/LC_MESSAGES/test_nsgettext.mo +0 -0
- data/test/locale/la/LC_MESSAGES/plural_error.mo +0 -0
- data/test/po/da/plural_error.po +3 -3
- data/test/po/fr/plural.po +6 -0
- data/test/po/fr/plural_error.po +3 -3
- data/test/po/ja/plural.po +6 -0
- data/test/po/ja/plural_error.po +2 -2
- data/test/po/ja/test_nsgettext.po +65 -0
- data/test/po/la/plural_error.po +3 -3
- data/test/rails/README +5 -0
- data/test/rails/Rakefile +35 -0
- data/test/rails/app/controllers/application.rb +8 -0
- data/test/rails/app/controllers/articles_controller.rb +61 -0
- data/test/rails/app/controllers/mailer_controller.rb +19 -0
- data/test/rails/app/helpers/application_helper.rb +3 -0
- data/test/rails/app/helpers/articles_helper.rb +2 -0
- data/test/rails/app/helpers/mailer_helper.rb +2 -0
- data/test/rails/app/models/article.rb +5 -0
- data/test/rails/app/models/mailer.rb +38 -0
- data/test/rails/app/models/user.rb +3 -0
- data/test/rails/app/views/articles/_form.rhtml +13 -0
- data/test/rails/app/views/articles/edit.rhtml +9 -0
- data/test/rails/app/views/articles/list.rhtml +30 -0
- data/test/rails/app/views/articles/list_fr.rhtml +1 -0
- data/test/rails/app/views/articles/multi_error_messages_for.rhtml +19 -0
- data/test/rails/app/views/articles/new.rhtml +8 -0
- data/test/rails/app/views/articles/show.rhtml +28 -0
- data/test/rails/app/views/layouts/application.rhtml +14 -0
- data/test/rails/app/views/layouts/mailer.rhtml +20 -0
- data/test/rails/app/views/mailer/coverpage.rhtml +6 -0
- data/test/rails/app/views/mailer/coverpage_fr.rhtml +6 -0
- data/test/rails/app/views/mailer/singlepart.rhtml +3 -0
- data/test/rails/app/views/mailer/singlepart_fr.rhtml +3 -0
- data/test/rails/config/boot.rb +45 -0
- data/test/rails/config/database.yml +36 -0
- data/test/rails/config/environment.rb +64 -0
- data/test/rails/config/environments/development.rb +21 -0
- data/test/rails/config/environments/production.rb +18 -0
- data/test/rails/config/environments/test.rb +19 -0
- data/test/rails/config/routes.rb +23 -0
- data/test/rails/db/schema.rb +27 -0
- data/test/rails/po/ja/rails_test.po +142 -0
- data/test/rails/po/rails_test.pot +147 -0
- data/test/rails/public/404.html +30 -0
- data/test/rails/public/500.html +30 -0
- data/test/rails/public/dispatch.cgi +10 -0
- data/test/rails/public/dispatch.fcgi +24 -0
- data/test/rails/public/dispatch.rb +10 -0
- data/test/rails/public/favicon.ico +0 -0
- data/test/rails/public/images/rails.png +0 -0
- data/test/rails/public/index.html +277 -0
- data/test/rails/public/javascripts/application.js +2 -0
- data/test/rails/public/javascripts/controls.js +833 -0
- data/test/rails/public/javascripts/dragdrop.js +942 -0
- data/test/rails/public/javascripts/effects.js +1088 -0
- data/test/rails/public/javascripts/prototype.js +2515 -0
- data/test/rails/public/robots.txt +1 -0
- data/test/rails/public/stylesheets/scaffold.css +74 -0
- data/test/rails/script/about +3 -0
- data/test/rails/script/breakpointer +3 -0
- data/test/rails/script/console +3 -0
- data/test/rails/script/destroy +3 -0
- data/test/rails/script/generate +3 -0
- data/test/rails/script/performance/benchmarker +3 -0
- data/test/rails/script/performance/profiler +3 -0
- data/test/rails/script/plugin +3 -0
- data/test/rails/script/process/inspector +3 -0
- data/test/rails/script/process/reaper +3 -0
- data/test/rails/script/process/spawner +3 -0
- data/test/rails/script/runner +3 -0
- data/test/rails/script/server +3 -0
- data/test/rails/test/fixtures/articles.yml +11 -0
- data/test/rails/test/functional/articles_controller_test.rb +109 -0
- data/test/rails/test/functional/mailer_controller_test.rb +93 -0
- data/test/rails/test/integration/general_stories_test.rb +58 -0
- data/test/rails/test/result/en/create_error.html +95 -0
- data/test/rails/test/result/en/list.html +65 -0
- data/test/rails/test/result/en/multi_error_messages_for.html +153 -0
- data/test/rails/test/result/en/multipart.html +67 -0
- data/test/rails/test/result/en/new.html +95 -0
- data/test/rails/test/result/en/show.html +50 -0
- data/test/rails/test/result/en/singlepart.html +10 -0
- data/test/rails/test/result/fr/list.html +15 -0
- data/test/rails/test/result/fr/multipart.html +67 -0
- data/test/rails/test/result/fr/singlepart.html +10 -0
- data/test/rails/test/result/ja/create_error.html +95 -0
- data/test/rails/test/result/ja/list.html +65 -0
- data/test/rails/test/result/ja/multi_error_messages_for.html +153 -0
- data/test/rails/test/result/ja/multipart.html +67 -0
- data/test/rails/test/result/ja/new.html +95 -0
- data/test/rails/test/result/ja/show.html +50 -0
- data/test/rails/test/result/ja/singlepart.html +10 -0
- data/test/rails/test/test_helper.rb +28 -0
- data/test/rails/test/unit/article_test.rb +18 -0
- data/test/test.sh +4 -0
- data/test/test_nsgettext.rb +44 -0
- data/test/test_rubyparser_n_.rb +10 -0
- metadata +317 -20
- data/ext/gettext/locale_system-i386-mswin32.def +0 -2
- data/ext/gettext/locale_system-i386-mswin32.exp +0 -0
- data/ext/gettext/locale_system-i386-mswin32.lib +0 -0
- data/ext/gettext/locale_system-i386-mswin32.pdb +0 -0
- data/ext/gettext/locale_system.obj +0 -0
- data/ext/gettext/vc70.pdb +0 -0
- data/samples/rails/locale/cs/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/de/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/el/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/es/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/fr/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/ja/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/ko/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/nl/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/pt_BR/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/ru/LC_MESSAGES/gettext_plugin.mo +0 -0
data/test/Rakefile
CHANGED
@@ -3,6 +3,8 @@ require 'gettext/utils'
|
|
3
3
|
desc "Create mo files"
|
4
4
|
task :makemo do
|
5
5
|
GetText.create_mofiles(true, "po", "locale")
|
6
|
+
GetText.create_mofiles(true, "rails/po", "rails/locale")
|
7
|
+
mkdir "rails/log" unless File.exists? "rails/log"
|
6
8
|
end
|
7
9
|
|
8
10
|
SCHEMA_PATH = File.join(File.dirname(__FILE__), "db")
|
data/test/gettext_test.rb
CHANGED
@@ -9,6 +9,7 @@ require 'testlib4.rb'
|
|
9
9
|
require 'testlib6.rb'
|
10
10
|
require 'test_rubyparser.rb'
|
11
11
|
require 'test_sgettext.rb'
|
12
|
+
require 'test_nsgettext.rb'
|
12
13
|
|
13
14
|
class TestGetText < Test::Unit::TestCase
|
14
15
|
include GetText
|
@@ -54,7 +55,7 @@ class TestGetText < Test::Unit::TestCase
|
|
54
55
|
assert_equal("japanese", _("language"))
|
55
56
|
end
|
56
57
|
|
57
|
-
def
|
58
|
+
def test_empty
|
58
59
|
set_locale(nil)
|
59
60
|
bindtextdomain("test1", "locale")
|
60
61
|
assert_equal("japanese", gettext("language"))
|
@@ -117,6 +118,7 @@ DDD
|
|
117
118
|
def test_sgettext
|
118
119
|
GetText.locale = nil
|
119
120
|
testlib5 = TestSGetText.new
|
121
|
+
|
120
122
|
assert_equal("MATCHED", testlib5.test_1)
|
121
123
|
assert_equal("MATCHED", testlib5.test_2)
|
122
124
|
assert_equal("AAA", testlib5.test_3)
|
@@ -128,6 +130,20 @@ DDD
|
|
128
130
|
assert_equal("BBB", testlib5.test_9)
|
129
131
|
end
|
130
132
|
|
133
|
+
def test_nsgettext
|
134
|
+
GetText.locale = nil
|
135
|
+
testlib5 = TestNSGetText.new
|
136
|
+
assert_equal(["single", "plural"], testlib5.test_1)
|
137
|
+
assert_equal(["single", "plural"], testlib5.test_2)
|
138
|
+
assert_equal(["AAA", "BBB"], testlib5.test_3)
|
139
|
+
assert_equal(["CCC", "DDD"], testlib5.test_4)
|
140
|
+
assert_equal(["CCC", "DDD"], testlib5.test_5)
|
141
|
+
assert_equal(["BBB", "CCC"], testlib5.test_6)
|
142
|
+
assert_equal(["B|BB", "CCC"], testlib5.test_7)
|
143
|
+
assert_equal(["single", "plural"], testlib5.test_8)
|
144
|
+
assert_equal(["BBB", "DDD"], testlib5.test_9)
|
145
|
+
end
|
146
|
+
|
131
147
|
def test_plural
|
132
148
|
GetText.locale = nil
|
133
149
|
bindtextdomain("plural", "locale", "ja")
|
@@ -184,22 +200,22 @@ DDD
|
|
184
200
|
setlocale(nil)
|
185
201
|
bindtextdomain("plural_error", "locale", "ja")
|
186
202
|
#If it defines msgstr[0] only, msgstr[0] is used everytime.
|
187
|
-
assert_equal("a", n_("
|
188
|
-
assert_equal("a", n_("
|
189
|
-
assert_equal("a", n_("
|
203
|
+
assert_equal("a", n_("first", "second", 0))
|
204
|
+
assert_equal("a", n_("first", "second", 1))
|
205
|
+
assert_equal("a", n_("first", "second", 2))
|
190
206
|
# Use default(plural = 0)
|
191
207
|
setlocale("fr")
|
192
|
-
assert_equal("
|
193
|
-
assert_equal("
|
194
|
-
assert_equal("
|
208
|
+
assert_equal("fr_first", n_("first", "second", 0))
|
209
|
+
assert_equal("fr_first", n_("first", "second", 1))
|
210
|
+
assert_equal("fr_first", n_("first", "second", 2))
|
195
211
|
setlocale("da")
|
196
|
-
assert_equal("
|
197
|
-
assert_equal("
|
198
|
-
assert_equal("
|
212
|
+
assert_equal("da_first", n_("first", "second", 0))
|
213
|
+
assert_equal("da_first", n_("first", "second", 1))
|
214
|
+
assert_equal("da_first", n_("first", "second", 2))
|
199
215
|
setlocale("la")
|
200
|
-
assert_equal("
|
201
|
-
assert_equal("
|
202
|
-
assert_equal("
|
216
|
+
assert_equal("la_first", n_("first", "second", 0))
|
217
|
+
assert_equal("la_first", n_("first", "second", 1))
|
218
|
+
assert_equal("la_first", n_("first", "second", 2))
|
203
219
|
end
|
204
220
|
|
205
221
|
def test_plural_array
|
@@ -210,6 +226,28 @@ DDD
|
|
210
226
|
assert_equal("da_plural", n_(["one", "two"], 2))
|
211
227
|
end
|
212
228
|
|
229
|
+
def test_plural_with_single
|
230
|
+
GetText.locale = nil
|
231
|
+
bindtextdomain("plural", "locale", "ja")
|
232
|
+
assert_equal("hitotsu", _("single"))
|
233
|
+
assert_equal("hitotsu", n_("single", "plural", 1))
|
234
|
+
assert_equal("hitotsu", n_("single", "plural", 2))
|
235
|
+
assert_equal("all", n_("one", "two", 1))
|
236
|
+
assert_equal("all", n_("one", "two", 2))
|
237
|
+
assert_equal("all", _("one"))
|
238
|
+
|
239
|
+
bindtextdomain("plural", "locale", "fr")
|
240
|
+
assert_equal("fr_hitotsu", _("single"))
|
241
|
+
assert_equal("fr_hitotsu", n_("single", "plural", 1))
|
242
|
+
assert_equal("fr_fukusu", n_("single", "plural", 2))
|
243
|
+
assert_equal("fr_one", n_("one", "two", 1))
|
244
|
+
assert_equal("fr_plural", n_("one", "two", 2))
|
245
|
+
assert_equal("fr_one", _("one"))
|
246
|
+
|
247
|
+
assert_equal("fr_hitotsu", n_("single", "not match", 1))
|
248
|
+
assert_equal("fr_fukusu", n_("single", "not match", 2))
|
249
|
+
end
|
250
|
+
|
213
251
|
def test_Nn_
|
214
252
|
GetText.locale = nil
|
215
253
|
bindtextdomain("plural", "locale", "da")
|
@@ -33,6 +33,7 @@ end
|
|
33
33
|
begin
|
34
34
|
`rake createdb`
|
35
35
|
rescue
|
36
|
+
p $!
|
36
37
|
end
|
37
38
|
|
38
39
|
ActiveRecord::Base.establish_connection(
|
@@ -63,6 +64,22 @@ class Topic
|
|
63
64
|
end
|
64
65
|
end
|
65
66
|
|
67
|
+
class MyModel
|
68
|
+
attr_accessor :title
|
69
|
+
def save; end
|
70
|
+
def save!; end
|
71
|
+
def update_attribute(name, value); end
|
72
|
+
def new_record?
|
73
|
+
false
|
74
|
+
end
|
75
|
+
def self.human_attribute_name(name)
|
76
|
+
name
|
77
|
+
end
|
78
|
+
include ActiveRecord::Validations
|
79
|
+
|
80
|
+
validates_presence_of :title
|
81
|
+
end
|
82
|
+
|
66
83
|
class ValidationsTest < Test::Unit::TestCase
|
67
84
|
fixtures :topics, :developers
|
68
85
|
|
@@ -1755,5 +1772,21 @@ class ValidationsTest < Test::Unit::TestCase
|
|
1755
1772
|
assert_equal "Sillyタイトル が不正に生成されました。", t.errors.full_messages[0]
|
1756
1773
|
assert_equal "Silly内容 空です。", t.errors.full_messages[1]
|
1757
1774
|
end
|
1775
|
+
|
1776
|
+
def test_original_model_with_validation
|
1777
|
+
GetText.set_locale_all "ja_JP.UTF-8"
|
1778
|
+
t = MyModel.new
|
1779
|
+
t.title = nil
|
1780
|
+
t.save
|
1781
|
+
assert_equal "Titleを入力してください。", t.errors.full_messages[0]
|
1782
|
+
assert_equal "Titleを入力してください。", t.errors.on(:title)
|
1783
|
+
|
1784
|
+
GetText.set_locale_all "en"
|
1785
|
+
t = MyModel.new
|
1786
|
+
t.title = nil
|
1787
|
+
t.save
|
1788
|
+
assert_equal "Title can't be blank", t.errors.full_messages[0]
|
1789
|
+
assert_equal "Title can't be blank", t.errors.on(:title)
|
1790
|
+
end
|
1758
1791
|
end
|
1759
1792
|
|
data/test/gettext_test_parser.rb
CHANGED
@@ -191,6 +191,11 @@ class TestGetTextParser < Test::Unit::TestCase
|
|
191
191
|
assert_equal(['aaa\n', 'test_erb.rxml:12'], ary[1])
|
192
192
|
assert_equal(['bbb', 'test_erb.rxml:13'], ary[2])
|
193
193
|
assert_equal(["ccc1\000ccc2", 'test_erb.rxml:14'], ary[3])
|
194
|
+
|
195
|
+
|
196
|
+
ary = GetText::RGetText.parse('test_rubyparser_n_.rb')
|
197
|
+
assert_equal(["ooo\000ppp", 'test_rubyparser_n_.rb:64', 'test_rubyparser_n_.rb:65'], ary[12])
|
198
|
+
assert_equal(["qqq\000rrr", 'test_rubyparser_n_.rb:69', 'test_rubyparser_n_.rb:70'], ary[13])
|
194
199
|
end
|
195
200
|
|
196
201
|
end
|
@@ -0,0 +1,211 @@
|
|
1
|
+
$KCODE = "U"
|
2
|
+
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
3
|
+
|
4
|
+
require 'fileutils'
|
5
|
+
require 'rubygems'
|
6
|
+
require 'yaml'
|
7
|
+
require 'test/unit'
|
8
|
+
require 'active_support'
|
9
|
+
require 'action_controller'
|
10
|
+
require 'breakpoint'
|
11
|
+
require 'action_controller/test_process'
|
12
|
+
gem 'rails'
|
13
|
+
require 'initializer'
|
14
|
+
|
15
|
+
require 'gettext/rails'
|
16
|
+
|
17
|
+
ActiveSupport::Deprecation.debug = true
|
18
|
+
|
19
|
+
ActionController::Base.logger = nil
|
20
|
+
ActionController::Base.ignore_missing_templates = false
|
21
|
+
ActionController::Routing::Routes.reload rescue nil
|
22
|
+
|
23
|
+
CACHE_DIR = 'test_cache'
|
24
|
+
# Don't change '/../temp/' cavalierly or you might hoze something you don't want hozed
|
25
|
+
FILE_STORE_PATH = File.join(File.dirname(__FILE__), 'cache', CACHE_DIR)
|
26
|
+
ActionController::Base.perform_caching = true
|
27
|
+
ActionController::Base.page_cache_directory = FILE_STORE_PATH
|
28
|
+
ActionController::Base.fragment_cache_store = :file_store, FILE_STORE_PATH
|
29
|
+
|
30
|
+
RAILS_ROOT = File.join(File.dirname(__FILE__))
|
31
|
+
|
32
|
+
class ActionCachingTestController < ActionController::Base
|
33
|
+
init_gettext "test"
|
34
|
+
|
35
|
+
caches_action :index
|
36
|
+
|
37
|
+
def index
|
38
|
+
@cache_this = Time.now.to_f.to_s
|
39
|
+
render :text => @cache_this
|
40
|
+
end
|
41
|
+
|
42
|
+
def expire
|
43
|
+
expire_action :controller => 'action_caching_test', :action => 'index'
|
44
|
+
render :nothing => true
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
class ActionCachingMockController
|
50
|
+
attr_accessor :mock_url_for
|
51
|
+
attr_accessor :mock_path
|
52
|
+
|
53
|
+
def initialize
|
54
|
+
yield self if block_given?
|
55
|
+
end
|
56
|
+
|
57
|
+
def url_for(*args)
|
58
|
+
@mock_url_for
|
59
|
+
end
|
60
|
+
|
61
|
+
def request
|
62
|
+
mocked_path = @mock_path
|
63
|
+
Object.new.instance_eval(<<-EVAL)
|
64
|
+
def path; '#{@mock_path}' end
|
65
|
+
self
|
66
|
+
EVAL
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
class ActionCacheTest < Test::Unit::TestCase
|
71
|
+
def setup
|
72
|
+
reset!
|
73
|
+
FileUtils.mkdir_p(FILE_STORE_PATH)
|
74
|
+
@path_class = ActionController::Caching::Actions::ActionCachePath
|
75
|
+
@mock_controller = ActionCachingMockController.new
|
76
|
+
end
|
77
|
+
|
78
|
+
def teardown
|
79
|
+
FileUtils.rm_rf(File.dirname(FILE_STORE_PATH))
|
80
|
+
end
|
81
|
+
|
82
|
+
def test_simple_action_cache
|
83
|
+
get :index, :lang => "ja"
|
84
|
+
cached_time = content_to_cache
|
85
|
+
assert_equal cached_time, @response.body
|
86
|
+
reset!
|
87
|
+
|
88
|
+
get :index, :lang => "ja"
|
89
|
+
assert_equal cached_time, @response.body
|
90
|
+
reset!
|
91
|
+
|
92
|
+
get :index, :lang => "en"
|
93
|
+
cached_time_en = content_to_cache
|
94
|
+
assert_not_equal cached_time, @response.body
|
95
|
+
|
96
|
+
get :index, :lang => "ja"
|
97
|
+
assert_equal cached_time, @response.body
|
98
|
+
reset!
|
99
|
+
|
100
|
+
get :index, :lang => "en"
|
101
|
+
assert_equal cached_time_en, @response.body
|
102
|
+
|
103
|
+
get :index # Same as en
|
104
|
+
assert_equal cached_time_en, @response.body
|
105
|
+
end
|
106
|
+
|
107
|
+
def test_cache_expiration
|
108
|
+
get :index, :lang => "ja"
|
109
|
+
cached_time = content_to_cache
|
110
|
+
reset!
|
111
|
+
|
112
|
+
get :index, :lang => "ja"
|
113
|
+
assert_equal cached_time, @response.body
|
114
|
+
reset!
|
115
|
+
|
116
|
+
get :index, :lang => "en"
|
117
|
+
cached_time_en = content_to_cache
|
118
|
+
assert_not_equal cached_time, @response.body
|
119
|
+
reset!
|
120
|
+
|
121
|
+
get :index, :lang => "en"
|
122
|
+
assert_equal cached_time_en, @response.body
|
123
|
+
reset!
|
124
|
+
|
125
|
+
get :expire
|
126
|
+
reset!
|
127
|
+
|
128
|
+
get :index, :lang => "ja"
|
129
|
+
new_cached_time = content_to_cache
|
130
|
+
assert_not_equal cached_time, @response.body
|
131
|
+
reset!
|
132
|
+
|
133
|
+
get :index, :lang => "ja"
|
134
|
+
assert_response :success
|
135
|
+
assert_equal new_cached_time, @response.body
|
136
|
+
reset!
|
137
|
+
|
138
|
+
get :index, :lang => "en"
|
139
|
+
new_cached_time_en = content_to_cache
|
140
|
+
assert_not_equal new_cached_time, @response.body
|
141
|
+
assert_not_equal cached_time_en, @response.body
|
142
|
+
reset!
|
143
|
+
|
144
|
+
get :index, :lang => "en"
|
145
|
+
assert_response :success
|
146
|
+
assert_equal new_cached_time_en, @response.body
|
147
|
+
reset!
|
148
|
+
end
|
149
|
+
|
150
|
+
def test_cache_is_scoped_by_subdomain
|
151
|
+
@request.host = 'jamis.hostname.com'
|
152
|
+
get :index, :lang => "ja"
|
153
|
+
jamis_cache = content_to_cache
|
154
|
+
|
155
|
+
@request.host = 'david.hostname.com'
|
156
|
+
get :index, :lang => "ja"
|
157
|
+
david_cache = content_to_cache
|
158
|
+
assert_not_equal jamis_cache, @response.body
|
159
|
+
|
160
|
+
@request.host = 'jamis.hostname.com'
|
161
|
+
get :index, :lang => "ja"
|
162
|
+
assert_equal jamis_cache, @response.body
|
163
|
+
|
164
|
+
@request.host = 'david.hostname.com'
|
165
|
+
get :index, :lang => "ja"
|
166
|
+
assert_equal david_cache, @response.body
|
167
|
+
end
|
168
|
+
|
169
|
+
def test_xml_version_of_resource_is_treated_as_different_cache
|
170
|
+
@mock_controller.mock_url_for = 'http://example.org/posts/'
|
171
|
+
@mock_controller.mock_path = '/posts/index.xml'
|
172
|
+
path_object = @path_class.new(@mock_controller)
|
173
|
+
assert_equal 'xml', path_object.extension
|
174
|
+
assert_equal 'example.org/posts/index.xml', path_object.path
|
175
|
+
end
|
176
|
+
|
177
|
+
def test_empty_path_is_normalized
|
178
|
+
@mock_controller.mock_url_for = 'http://example.org/'
|
179
|
+
@mock_controller.mock_path = '/'
|
180
|
+
|
181
|
+
assert_equal 'example.org/index', @path_class.path_for(@mock_controller)
|
182
|
+
end
|
183
|
+
|
184
|
+
def test_file_extensions
|
185
|
+
get :index, :id => 'kitten.jpg', :lang => "ja"
|
186
|
+
assert_response :success
|
187
|
+
reset!
|
188
|
+
get :index, :id => 'kitten.jpg', :lang => "ja"
|
189
|
+
assert_response :success
|
190
|
+
reset!
|
191
|
+
|
192
|
+
get :index, :id => 'kitten.jpg', :lang => "en"
|
193
|
+
assert_response :success
|
194
|
+
reset!
|
195
|
+
get :index, :id => 'kitten.jpg', :lang => "en"
|
196
|
+
assert_response :success
|
197
|
+
reset!
|
198
|
+
end
|
199
|
+
|
200
|
+
private
|
201
|
+
def content_to_cache
|
202
|
+
assigns(:cache_this)
|
203
|
+
end
|
204
|
+
|
205
|
+
def reset!
|
206
|
+
@request = ActionController::TestRequest.new
|
207
|
+
@response = ActionController::TestResponse.new
|
208
|
+
@controller = ActionCachingTestController.new
|
209
|
+
@request.host = 'hostname.com'
|
210
|
+
end
|
211
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/test/po/da/plural_error.po
CHANGED
data/test/po/fr/plural.po
CHANGED
data/test/po/fr/plural_error.po
CHANGED
data/test/po/ja/plural.po
CHANGED
data/test/po/ja/plural_error.po
CHANGED
@@ -0,0 +1,65 @@
|
|
1
|
+
# SOME DESCRIPTIVE TITLE.
|
2
|
+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3
|
+
# This file is distributed under the same license as the PACKAGE package.
|
4
|
+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5
|
+
#
|
6
|
+
#, fuzzy
|
7
|
+
msgid ""
|
8
|
+
msgstr ""
|
9
|
+
"Project-Id-Version: PACKAGE VERSION\n"
|
10
|
+
"POT-Creation-Date: 2007-07-03 00:20+0900\n"
|
11
|
+
"PO-Revision-Date: 2007-07-03 00:20+0900\n"
|
12
|
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13
|
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14
|
+
"MIME-Version: 1.0\n"
|
15
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
16
|
+
"Content-Transfer-Encoding: 8bit\n"
|
17
|
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18
|
+
|
19
|
+
#: test_nsgettext.rb:10 test_nsgettext.rb:14
|
20
|
+
msgid "AAA|BBB"
|
21
|
+
msgid_plural "CCC"
|
22
|
+
msgstr[0] "single"
|
23
|
+
msgstr[1] "plural"
|
24
|
+
|
25
|
+
#: test_nsgettext.rb:18
|
26
|
+
msgid "AAA"
|
27
|
+
msgid_plural "BBB"
|
28
|
+
msgstr[0] ""
|
29
|
+
msgstr[1] ""
|
30
|
+
|
31
|
+
#: test_nsgettext.rb:22
|
32
|
+
msgid "AAA|CCC"
|
33
|
+
msgid_plural "DDD"
|
34
|
+
msgstr[0] ""
|
35
|
+
msgstr[1] ""
|
36
|
+
|
37
|
+
#: test_nsgettext.rb:26
|
38
|
+
msgid "AAA|BBB|CCC"
|
39
|
+
msgid_plural "DDD"
|
40
|
+
msgstr[0] ""
|
41
|
+
msgstr[1] ""
|
42
|
+
|
43
|
+
#: test_nsgettext.rb:30
|
44
|
+
msgid "AAA$BBB"
|
45
|
+
msgid_plural "CCC"
|
46
|
+
msgstr[0] ""
|
47
|
+
msgstr[1] ""
|
48
|
+
|
49
|
+
#: test_nsgettext.rb:34
|
50
|
+
msgid "AAA$B|BB"
|
51
|
+
msgid_plural "CCC"
|
52
|
+
msgstr[0] ""
|
53
|
+
msgstr[1] ""
|
54
|
+
|
55
|
+
#: test_nsgettext.rb:38
|
56
|
+
msgid "AAA$B|CC"
|
57
|
+
msgid_plural "DDD"
|
58
|
+
msgstr[0] "single"
|
59
|
+
msgstr[1] "plural"
|
60
|
+
|
61
|
+
#: test_nsgettext.rb:42
|
62
|
+
msgid "AAA|CCC|BBB"
|
63
|
+
msgid_plural "DDD"
|
64
|
+
msgstr[0] ""
|
65
|
+
msgstr[1] ""
|
data/test/po/la/plural_error.po
CHANGED
data/test/rails/README
ADDED
data/test/rails/Rakefile
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
|
+
|
4
|
+
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
|
5
|
+
|
6
|
+
require 'rake'
|
7
|
+
require 'rake/testtask'
|
8
|
+
require 'rake/rdoctask'
|
9
|
+
|
10
|
+
require 'tasks/rails'
|
11
|
+
|
12
|
+
desc 'Build the MySQL test databases'
|
13
|
+
task :createdb do
|
14
|
+
%x( mysqladmin -u root create rails_unittest )
|
15
|
+
%x( rake db:schema:load )
|
16
|
+
end
|
17
|
+
|
18
|
+
desc 'Drop the MySQL test databases'
|
19
|
+
task :dropdb do
|
20
|
+
%x( mysqladmin -u root -f drop rails_unittest )
|
21
|
+
end
|
22
|
+
|
23
|
+
desc "Create mo-files for L10n"
|
24
|
+
task :makemo do
|
25
|
+
require 'gettext/utils'
|
26
|
+
GetText.create_mofiles(true, "po", "locale")
|
27
|
+
mkdir "log" unless File.exists? "log"
|
28
|
+
end
|
29
|
+
|
30
|
+
desc "Update pot/po files to match new version."
|
31
|
+
task :updatepo do
|
32
|
+
require 'gettext/utils'
|
33
|
+
GetText.update_pofiles("rails_test", Dir.glob("{app,lib}/**/*.{rb,rhtml}"),
|
34
|
+
"rails_test 1.2.0")
|
35
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Filters added to this controller apply to all controllers in the application.
|
2
|
+
# Likewise, all the methods added will be available for all controllers.
|
3
|
+
|
4
|
+
class ApplicationController < ActionController::Base
|
5
|
+
# Pick a unique cookie name to distinguish our session data from others'
|
6
|
+
session :session_key => '_rails_session_id'
|
7
|
+
init_gettext "rails_test"
|
8
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
class ArticlesController < ApplicationController
|
2
|
+
def index
|
3
|
+
list
|
4
|
+
render :action => 'list'
|
5
|
+
end
|
6
|
+
|
7
|
+
# GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
|
8
|
+
verify :method => :post, :only => [ :destroy, :create, :update ],
|
9
|
+
:redirect_to => { :action => :list }
|
10
|
+
|
11
|
+
def list
|
12
|
+
@article_pages, @articles = paginate :articles, :per_page => 10
|
13
|
+
end
|
14
|
+
|
15
|
+
def show
|
16
|
+
@article = Article.find(params[:id])
|
17
|
+
end
|
18
|
+
|
19
|
+
def new
|
20
|
+
@article = Article.new
|
21
|
+
@article.lastupdate = Date.new(2007, 4, 1)
|
22
|
+
end
|
23
|
+
|
24
|
+
def create
|
25
|
+
@article = Article.new(params[:article])
|
26
|
+
if @article.save
|
27
|
+
flash[:notice] = _('Article was successfully created.')
|
28
|
+
redirect_to :action => 'list'
|
29
|
+
else
|
30
|
+
render :action => 'new'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def edit
|
35
|
+
@article = Article.find(params[:id])
|
36
|
+
end
|
37
|
+
|
38
|
+
def multi_error_messages_for
|
39
|
+
@user = User.new
|
40
|
+
@user.lastupdate = Date.new(2007, 4, 1)
|
41
|
+
@article = Article.new
|
42
|
+
@article.lastupdate = Date.new(2007, 4, 1)
|
43
|
+
@user.valid?
|
44
|
+
@article.valid?
|
45
|
+
end
|
46
|
+
|
47
|
+
def update
|
48
|
+
@article = Article.find(params[:id])
|
49
|
+
if @article.update_attributes(params[:article])
|
50
|
+
flash[:notice] = _('Article was successfully updated.')
|
51
|
+
redirect_to :action => 'show', :id => @article
|
52
|
+
else
|
53
|
+
render :action => 'edit'
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def destroy
|
58
|
+
Article.find(params[:id]).destroy
|
59
|
+
redirect_to :action => 'list'
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class MailerController < ApplicationController
|
2
|
+
layout "mailer"
|
3
|
+
|
4
|
+
init_gettext "rails_test"
|
5
|
+
|
6
|
+
def index
|
7
|
+
render :nothing => true, :layout => true
|
8
|
+
end
|
9
|
+
|
10
|
+
def singlepart
|
11
|
+
Mailer.deliver_singlepart
|
12
|
+
render :text => Mailer.create_singlepart.encoded, :layout => true
|
13
|
+
end
|
14
|
+
|
15
|
+
def multipart
|
16
|
+
Mailer.deliver_multipart
|
17
|
+
render :text => Mailer.create_multipart.encoded, :layout => true
|
18
|
+
end
|
19
|
+
end
|