gettext 1.0.0-mswin32 → 1.1.0-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (301) hide show
  1. data/ChangeLog +193 -0
  2. data/NEWS +51 -1
  3. data/README +29 -11
  4. data/Rakefile +70 -56
  5. data/bin/rgettext +2 -0
  6. data/bin/rmsgfmt +2 -0
  7. data/bin/rmsgmerge +24 -0
  8. data/data/locale/cs/LC_MESSAGES/rails.mo +0 -0
  9. data/data/locale/cs/LC_MESSAGES/rgettext.mo +0 -0
  10. data/data/locale/de/LC_MESSAGES/rails.mo +0 -0
  11. data/data/locale/de/LC_MESSAGES/rgettext.mo +0 -0
  12. data/data/locale/es/LC_MESSAGES/rails.mo +0 -0
  13. data/data/locale/es/LC_MESSAGES/rgettext.mo +0 -0
  14. data/data/locale/fr/LC_MESSAGES/rails.mo +0 -0
  15. data/data/locale/fr/LC_MESSAGES/rgettext.mo +0 -0
  16. data/data/locale/it/LC_MESSAGES/rgettext.mo +0 -0
  17. data/data/locale/ja/LC_MESSAGES/rails.mo +0 -0
  18. data/data/locale/ja/LC_MESSAGES/rgettext.mo +0 -0
  19. data/data/locale/ko/LC_MESSAGES/rails.mo +0 -0
  20. data/data/locale/ko/LC_MESSAGES/rgettext.mo +0 -0
  21. data/data/locale/nl/LC_MESSAGES/rails.mo +0 -0
  22. data/data/locale/nl/LC_MESSAGES/rgettext.mo +0 -0
  23. data/data/locale/pt_BR/LC_MESSAGES/rails.mo +0 -0
  24. data/data/locale/pt_BR/LC_MESSAGES/rgettext.mo +0 -0
  25. data/data/locale/sv/LC_MESSAGES/rgettext.mo +0 -0
  26. data/ext/gettext/gettext/_locale.BAK +86 -0
  27. data/ext/gettext/gettext/_locale.c +1 -1
  28. data/ext/gettext/gettext/_locale.exp +0 -0
  29. data/ext/gettext/gettext/_locale.lib +0 -0
  30. data/ext/gettext/gettext/_locale.obj +0 -0
  31. data/ext/gettext/gettext/_locale.pdb +0 -0
  32. data/ext/gettext/gettext/_locale.so +0 -0
  33. data/ext/gettext/gettext/mkmf.log +4 -4
  34. data/ext/gettext/gettext/vc70.pdb +0 -0
  35. data/lib/_locale.so +0 -0
  36. data/lib/gettext.rb +17 -4
  37. data/lib/gettext/cgi.rb +34 -19
  38. data/lib/gettext/locale.rb +3 -13
  39. data/lib/gettext/locale_default.rb +2 -2
  40. data/lib/gettext/locale_win32.rb +27 -7
  41. data/lib/gettext/mo.rb +6 -1
  42. data/lib/gettext/parser/activerecord.rb +115 -0
  43. data/lib/gettext/parser/glade.rb +3 -1
  44. data/lib/gettext/parser/ruby.rb +56 -57
  45. data/lib/gettext/poparser.rb +297 -0
  46. data/lib/gettext/rails.rb +161 -3
  47. data/lib/gettext/rgettext.rb +19 -9
  48. data/lib/gettext/rmsgfmt.rb +95 -363
  49. data/lib/gettext/rmsgmerge.rb +381 -0
  50. data/lib/gettext/string.rb +26 -0
  51. data/lib/gettext/textdomain.rb +21 -18
  52. data/lib/gettext/utils.rb +55 -0
  53. data/lib/gettext/version.rb +1 -1
  54. data/po/cs/rails.po +83 -0
  55. data/po/cs/rgettext.po +104 -0
  56. data/po/de/rails.po +79 -0
  57. data/po/de/rgettext.po +72 -21
  58. data/po/es/rails.po +80 -0
  59. data/po/es/rgettext.po +75 -19
  60. data/po/fr/rails.po +81 -0
  61. data/po/fr/rgettext.po +75 -19
  62. data/po/it/rgettext.po +68 -17
  63. data/po/ja/rails.po +78 -0
  64. data/po/ja/rgettext.po +71 -20
  65. data/po/ko/rails.po +77 -0
  66. data/po/ko/rgettext.po +74 -22
  67. data/po/nl/rails.po +80 -0
  68. data/po/nl/rgettext.po +102 -0
  69. data/po/pt_BR/rails.po +79 -0
  70. data/po/pt_BR/rgettext.po +77 -24
  71. data/po/rails.pot +80 -0
  72. data/po/rgettext.pot +63 -13
  73. data/po/sv/rgettext.po +63 -15
  74. data/samples/cgi/cookie.cgi +5 -0
  75. data/samples/cgi/helloerb1.cgi +4 -0
  76. data/samples/cgi/helloerb2.cgi +5 -0
  77. data/samples/cgi/index.cgi +5 -0
  78. data/samples/cgi/locale/cs/LC_MESSAGES/helloerb1.mo +0 -0
  79. data/samples/cgi/locale/cs/LC_MESSAGES/helloerb2.mo +0 -0
  80. data/samples/cgi/locale/cs/LC_MESSAGES/hellolib.mo +0 -0
  81. data/samples/cgi/locale/cs/LC_MESSAGES/main.mo +0 -0
  82. data/samples/cgi/locale/fr/LC_MESSAGES/main.mo +0 -0
  83. data/samples/cgi/locale/ko/LC_MESSAGES/helloerb1.mo +0 -0
  84. data/samples/cgi/locale/ko/LC_MESSAGES/helloerb2.mo +0 -0
  85. data/samples/cgi/locale/ko/LC_MESSAGES/hellolib.mo +0 -0
  86. data/samples/cgi/locale/ko/LC_MESSAGES/main.mo +0 -0
  87. data/samples/cgi/locale/nl/LC_MESSAGES/helloerb1.mo +0 -0
  88. data/samples/cgi/locale/nl/LC_MESSAGES/helloerb2.mo +0 -0
  89. data/samples/cgi/locale/nl/LC_MESSAGES/hellolib.mo +0 -0
  90. data/samples/cgi/locale/nl/LC_MESSAGES/main.mo +0 -0
  91. data/samples/cgi/locale/pt_BR/LC_MESSAGES/helloerb1.mo +0 -0
  92. data/samples/cgi/locale/pt_BR/LC_MESSAGES/helloerb2.mo +0 -0
  93. data/samples/cgi/locale/pt_BR/LC_MESSAGES/hellolib.mo +0 -0
  94. data/samples/cgi/locale/pt_BR/LC_MESSAGES/main.mo +0 -0
  95. data/samples/cgi/po/cs/helloerb1.po +66 -0
  96. data/samples/cgi/po/cs/helloerb2.po +52 -0
  97. data/samples/cgi/po/cs/hellolib.po +25 -0
  98. data/samples/cgi/po/cs/main.po +78 -0
  99. data/samples/cgi/po/fr/main.po +8 -8
  100. data/samples/cgi/po/ko/helloerb1.po +2 -3
  101. data/samples/cgi/po/ko/helloerb2.po +1 -2
  102. data/samples/cgi/po/ko/hellolib.po +1 -2
  103. data/samples/cgi/po/ko/main.po +2 -3
  104. data/samples/cgi/po/nl/helloerb1.po +60 -0
  105. data/samples/cgi/po/nl/helloerb2.po +52 -0
  106. data/samples/cgi/po/nl/hellolib.po +24 -0
  107. data/samples/cgi/po/nl/main.po +76 -0
  108. data/samples/cgi/po/pt_BR/helloerb1.po +59 -0
  109. data/samples/cgi/po/pt_BR/helloerb2.po +51 -0
  110. data/samples/cgi/po/pt_BR/hellolib.po +22 -0
  111. data/samples/cgi/po/pt_BR/main.po +75 -0
  112. data/samples/locale/cs/LC_MESSAGES/hello.mo +0 -0
  113. data/samples/locale/cs/LC_MESSAGES/hello2.mo +0 -0
  114. data/samples/locale/cs/LC_MESSAGES/hello_noop.mo +0 -0
  115. data/samples/locale/cs/LC_MESSAGES/hello_plural.mo +0 -0
  116. data/samples/locale/cs/LC_MESSAGES/helloglade2.mo +0 -0
  117. data/samples/locale/cs/LC_MESSAGES/hellogtk.mo +0 -0
  118. data/samples/locale/cs/LC_MESSAGES/hellotk.mo +0 -0
  119. data/samples/locale/fr/LC_MESSAGES/helloglade2.mo +0 -0
  120. data/samples/locale/ko/LC_MESSAGES/hello.mo +0 -0
  121. data/samples/locale/ko/LC_MESSAGES/hello2.mo +0 -0
  122. data/samples/locale/ko/LC_MESSAGES/hello_noop.mo +0 -0
  123. data/samples/locale/ko/LC_MESSAGES/hello_plural.mo +0 -0
  124. data/samples/locale/ko/LC_MESSAGES/helloglade2.mo +0 -0
  125. data/samples/locale/ko/LC_MESSAGES/hellogtk.mo +0 -0
  126. data/samples/locale/ko/LC_MESSAGES/hellotk.mo +0 -0
  127. data/samples/locale/nl/LC_MESSAGES/hello.mo +0 -0
  128. data/samples/locale/nl/LC_MESSAGES/hello2.mo +0 -0
  129. data/samples/locale/nl/LC_MESSAGES/hello_noop.mo +0 -0
  130. data/samples/locale/nl/LC_MESSAGES/hello_plural.mo +0 -0
  131. data/samples/locale/nl/LC_MESSAGES/helloglade2.mo +0 -0
  132. data/samples/locale/nl/LC_MESSAGES/hellogtk.mo +0 -0
  133. data/samples/locale/nl/LC_MESSAGES/hellotk.mo +0 -0
  134. data/samples/locale/pt_BR/LC_MESSAGES/hello.mo +0 -0
  135. data/samples/locale/pt_BR/LC_MESSAGES/hello2.mo +0 -0
  136. data/samples/locale/pt_BR/LC_MESSAGES/hello_noop.mo +0 -0
  137. data/samples/locale/pt_BR/LC_MESSAGES/hello_plural.mo +0 -0
  138. data/samples/locale/pt_BR/LC_MESSAGES/helloglade2.mo +0 -0
  139. data/samples/locale/pt_BR/LC_MESSAGES/hellogtk.mo +0 -0
  140. data/samples/locale/pt_BR/LC_MESSAGES/hellotk.mo +0 -0
  141. data/samples/po/cs/hello.po +23 -0
  142. data/samples/po/cs/hello2.po +31 -0
  143. data/samples/po/cs/hello_noop.po +27 -0
  144. data/samples/po/cs/hello_plural.po +26 -0
  145. data/samples/po/cs/helloglade2.po +37 -0
  146. data/samples/po/cs/hellogtk.po +23 -0
  147. data/samples/po/cs/hellotk.po +23 -0
  148. data/samples/po/fr/helloglade2.po +2 -2
  149. data/samples/po/hello.pot +1 -0
  150. data/samples/po/hello2.pot +1 -0
  151. data/samples/po/hello_noop.pot +2 -1
  152. data/samples/po/hello_plural.pot +6 -2
  153. data/samples/po/helloglade2.pot +8 -3
  154. data/samples/po/hellotk.pot +4 -0
  155. data/samples/po/ko/hello.po +1 -2
  156. data/samples/po/ko/hello2.po +1 -2
  157. data/samples/po/ko/hello_noop.po +1 -2
  158. data/samples/po/ko/hello_plural.po +1 -2
  159. data/samples/po/ko/helloglade2.po +2 -2
  160. data/samples/po/ko/hellogtk.po +1 -2
  161. data/samples/po/ko/hellotk.po +1 -2
  162. data/samples/po/nl/hello.po +24 -0
  163. data/samples/po/nl/hello2.po +32 -0
  164. data/samples/po/nl/hello_noop.po +28 -0
  165. data/samples/po/nl/hello_plural.po +26 -0
  166. data/samples/po/nl/helloglade2.po +31 -0
  167. data/samples/po/nl/hellogtk.po +24 -0
  168. data/samples/po/nl/hellotk.po +24 -0
  169. data/samples/po/pt_BR/hello.po +6 -5
  170. data/samples/po/pt_BR/hello2.po +6 -5
  171. data/samples/po/pt_BR/hello_noop.po +6 -5
  172. data/samples/po/pt_BR/hello_plural.po +6 -6
  173. data/samples/po/pt_BR/helloglade2.po +6 -5
  174. data/samples/po/pt_BR/hellogtk.po +6 -5
  175. data/samples/po/pt_BR/hellotk.po +6 -5
  176. data/samples/rails/README +21 -15
  177. data/samples/rails/Rakefile +10 -1
  178. data/samples/rails/app/controllers/application.rb +10 -18
  179. data/samples/rails/app/controllers/blog_controller.rb +1 -5
  180. data/samples/rails/app/helpers/blog_helper.rb +1 -1
  181. data/samples/rails/app/models/article.rb +15 -0
  182. data/samples/rails/app/views/blog/_form.rhtml +2 -2
  183. data/samples/rails/config/boot.rb +17 -0
  184. data/samples/rails/config/database.yml +6 -4
  185. data/samples/rails/config/environment.rb +40 -75
  186. data/samples/rails/config/environments/development.rb +12 -7
  187. data/samples/rails/config/environments/production.rb +17 -6
  188. data/samples/rails/config/environments/test.rb +8 -6
  189. data/samples/rails/locale/cs/LC_MESSAGES/blog.mo +0 -0
  190. data/samples/rails/locale/cs/LC_MESSAGES/gettext_plugin.mo +0 -0
  191. data/samples/rails/locale/de/LC_MESSAGES/blog.mo +0 -0
  192. data/samples/rails/locale/de/LC_MESSAGES/gettext_plugin.mo +0 -0
  193. data/samples/rails/locale/en/LC_MESSAGES/blog.mo +0 -0
  194. data/samples/rails/locale/es/LC_MESSAGES/blog.mo +0 -0
  195. data/samples/rails/locale/es/LC_MESSAGES/gettext_plugin.mo +0 -0
  196. data/samples/rails/locale/fr/LC_MESSAGES/blog.mo +0 -0
  197. data/samples/rails/locale/fr/LC_MESSAGES/{lang_helper.mo → gettext_plugin.mo} +0 -0
  198. data/samples/rails/locale/ja/LC_MESSAGES/blog.mo +0 -0
  199. data/samples/rails/locale/ja/LC_MESSAGES/{lang_helper.mo → gettext_plugin.mo} +0 -0
  200. data/samples/rails/locale/ko/LC_MESSAGES/blog.mo +0 -0
  201. data/samples/rails/locale/ko/LC_MESSAGES/gettext_plugin.mo +0 -0
  202. data/samples/rails/locale/nl/LC_MESSAGES/blog.mo +0 -0
  203. data/samples/rails/locale/nl/LC_MESSAGES/gettext_plugin.mo +0 -0
  204. data/samples/rails/locale/pt_BR/LC_MESSAGES/blog.mo +0 -0
  205. data/samples/rails/locale/pt_BR/LC_MESSAGES/gettext_plugin.mo +0 -0
  206. data/samples/rails/po/blog.pot +57 -37
  207. data/samples/rails/po/cs/blog.po +116 -0
  208. data/samples/rails/po/cs/gettext_plugin.po +29 -0
  209. data/samples/rails/po/de/blog.po +70 -51
  210. data/samples/rails/po/de/{lang_helper.po → gettext_plugin.po} +4 -5
  211. data/samples/rails/po/en/blog.po +111 -0
  212. data/samples/rails/po/es/blog.po +67 -47
  213. data/samples/rails/po/es/{lang_helper.po → gettext_plugin.po} +5 -5
  214. data/samples/rails/po/fr/blog.po +65 -45
  215. data/samples/rails/po/fr/{lang_helper.po → gettext_plugin.po} +4 -4
  216. data/samples/rails/po/{lang_helper.pot → gettext_plugin.pot} +4 -4
  217. data/samples/rails/po/ja/blog.po +64 -44
  218. data/samples/rails/po/ja/{lang_helper.po → gettext_plugin.po} +4 -4
  219. data/samples/rails/po/ko/blog.po +65 -46
  220. data/samples/rails/po/ko/{lang_helper.po → gettext_plugin.po} +5 -6
  221. data/samples/rails/po/nl/blog.po +115 -0
  222. data/samples/rails/po/nl/gettext_plugin.po +28 -0
  223. data/samples/rails/po/pt_BR/blog.po +109 -0
  224. data/samples/rails/po/pt_BR/gettext_plugin.po +27 -0
  225. data/samples/rails/public/images/rails.png +0 -0
  226. data/samples/rails/public/index.html +272 -71
  227. data/samples/rails/public/javascripts/controls.js +441 -166
  228. data/samples/rails/public/javascripts/dragdrop.js +261 -279
  229. data/samples/rails/public/javascripts/effects.js +657 -277
  230. data/samples/rails/public/javascripts/prototype.js +911 -223
  231. data/samples/rails/public/robots.txt +1 -0
  232. data/samples/rails/public/stylesheets/scaffold.css +1 -1
  233. data/samples/rails/script/about +3 -0
  234. data/samples/rails/script/breakpointer +3 -4
  235. data/samples/rails/script/console +3 -23
  236. data/samples/rails/script/destroy +3 -7
  237. data/samples/rails/script/generate +3 -7
  238. data/samples/rails/script/performance/benchmarker +3 -0
  239. data/samples/rails/script/performance/profiler +3 -0
  240. data/samples/rails/script/plugin +3 -0
  241. data/samples/rails/script/process/reaper +3 -0
  242. data/samples/rails/script/process/spawner +3 -0
  243. data/samples/rails/script/process/spinner +3 -0
  244. data/samples/rails/script/runner +3 -29
  245. data/samples/rails/script/server +3 -49
  246. data/samples/rails/vendor/plugins/gettext/init.rb +19 -0
  247. data/samples/rails/vendor/{lang_helper.rb → plugins/gettext/lib/gettext_plugin.rb} +15 -11
  248. data/src/poparser.ry +171 -0
  249. data/test/gettext_runner.rb +3 -1
  250. data/test/gettext_test.rb +56 -31
  251. data/test/gettext_test_cgi.rb +12 -0
  252. data/test/gettext_test_parser.rb +3 -0
  253. data/test/gettext_test_string.rb +14 -0
  254. data/test/locale/cr/LC_MESSAGES/plural.mo +0 -0
  255. data/test/locale/da/LC_MESSAGES/plural.mo +0 -0
  256. data/test/locale/da/LC_MESSAGES/plural_error.mo +0 -0
  257. data/test/locale/fr/LC_MESSAGES/plural.mo +0 -0
  258. data/test/locale/fr/LC_MESSAGES/plural_error.mo +0 -0
  259. data/test/locale/ir/LC_MESSAGES/plural.mo +0 -0
  260. data/test/locale/la/LC_MESSAGES/plural.mo +0 -0
  261. data/test/locale/li/LC_MESSAGES/plural.mo +0 -0
  262. data/test/locale/po/LC_MESSAGES/plural.mo +0 -0
  263. data/test/locale/sl/LC_MESSAGES/plural.mo +0 -0
  264. data/test/po/cr/plural.po +3 -3
  265. data/test/po/da/plural.po +2 -2
  266. data/test/po/da/plural_error.po +2 -1
  267. data/test/po/fr/plural.po +2 -2
  268. data/test/po/fr/plural_error.po +2 -1
  269. data/test/po/ir/plural.po +3 -3
  270. data/test/po/la/plural.po +3 -3
  271. data/test/po/li/plural.po +3 -3
  272. data/test/po/po/plural.po +3 -3
  273. data/test/po/sl/plural.po +4 -4
  274. data/test/test.sh +1 -0
  275. data/test/test_rubyparser.rb +20 -0
  276. data/test/{test_rubyparser_n.rb → test_rubyparser_N.rb} +0 -0
  277. metadata +163 -43
  278. data/README.ja +0 -115
  279. data/data/locale/de/LC_MESSAGES/rmsgfmt.mo +0 -0
  280. data/data/locale/es/LC_MESSAGES/rmsgfmt.mo +0 -0
  281. data/data/locale/fr/LC_MESSAGES/rmsgfmt.mo +0 -0
  282. data/data/locale/it/LC_MESSAGES/rmsgfmt.mo +0 -0
  283. data/data/locale/ja/LC_MESSAGES/rmsgfmt.mo +0 -0
  284. data/data/locale/ko/LC_MESSAGES/rmsgfmt.mo +0 -0
  285. data/data/locale/pt_BR/LC_MESSAGES/rmsgfmt.mo +0 -0
  286. data/data/locale/sv/LC_MESSAGES/rmsgfmt.mo +0 -0
  287. data/gettext-1.0.0-mswin32.gem +0 -0
  288. data/po/de/rmsgfmt.po +0 -45
  289. data/po/es/rmsgfmt.po +0 -43
  290. data/po/fr/rmsgfmt.po +0 -43
  291. data/po/it/rmsgfmt.po +0 -44
  292. data/po/ja/rmsgfmt.po +0 -43
  293. data/po/ko/rmsgfmt.po +0 -40
  294. data/po/pt_BR/rmsgfmt.po +0 -42
  295. data/po/rmsgfmt.pot +0 -40
  296. data/po/sv/rmsgfmt.po +0 -43
  297. data/samples/rails/locale/de/LC_MESSAGES/lang_helper.mo +0 -0
  298. data/samples/rails/locale/es/LC_MESSAGES/lang_helper.mo +0 -0
  299. data/samples/rails/locale/ko/LC_MESSAGES/lang_helper.mo +0 -0
  300. data/samples/rails/log/development.log +0 -378
  301. data/src/rmsgfmt.ry +0 -233
@@ -0,0 +1 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
@@ -24,7 +24,7 @@ a:hover { color: #fff; background-color:#000; }
24
24
 
25
25
  #ErrorExplanation {
26
26
  width: 400px;
27
- border: 2px solid 'red';
27
+ border: 2px solid red;
28
28
  padding: 7px;
29
29
  padding-bottom: 12px;
30
30
  margin-bottom: 20px;
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/about'
@@ -1,4 +1,3 @@
1
- #!/usr/bin/ruby
2
- require 'rubygems'
3
- require_gem 'rails'
4
- require 'breakpoint_client'
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/breakpointer'
@@ -1,23 +1,3 @@
1
- #!/usr/bin/ruby
2
- irb = RUBY_PLATFORM =~ /mswin32/ ? 'irb.bat' : 'irb'
3
-
4
- require 'optparse'
5
- options = { :sandbox => false, :irb => irb }
6
- OptionParser.new do |opt|
7
- opt.on('-s', '--sandbox', 'Rollback database modifications on exit.') { |options[:sandbox]| }
8
- opt.on("--irb=[#{irb}]", 'Invoke a different irb.') { |options[:irb]| }
9
- opt.parse!(ARGV)
10
- end
11
-
12
- libs = " -r irb/completion"
13
- libs << " -r #{File.dirname(__FILE__)}/../config/environment"
14
- libs << " -r console_sandbox" if options[:sandbox]
15
-
16
- ENV['RAILS_ENV'] = ARGV.first || 'development'
17
- if options[:sandbox]
18
- puts "Loading #{ENV['RAILS_ENV']} environment in sandbox."
19
- puts "Any modifications you make will be rolled back on exit."
20
- else
21
- puts "Loading #{ENV['RAILS_ENV']} environment."
22
- end
23
- exec "#{options[:irb]} #{libs} --prompt-mode simple"
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/console'
@@ -1,7 +1,3 @@
1
- #!/usr/bin/ruby
2
- require File.dirname(__FILE__) + '/../config/environment'
3
- require 'rails_generator'
4
- require 'rails_generator/scripts/destroy'
5
-
6
- ARGV.shift if ['--help', '-h'].include?(ARGV[0])
7
- Rails::Generator::Scripts::Destroy.new.run(ARGV)
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/destroy'
@@ -1,7 +1,3 @@
1
- #!/usr/bin/ruby
2
- require File.dirname(__FILE__) + '/../config/environment'
3
- require 'rails_generator'
4
- require 'rails_generator/scripts/generate'
5
-
6
- ARGV.shift if ['--help', '-h'].include?(ARGV[0])
7
- Rails::Generator::Scripts::Generate.new.run(ARGV)
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/generate'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/performance/benchmarker'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/performance/profiler'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/plugin'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/process/reaper'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/process/spawner'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/process/spinner'
@@ -1,29 +1,3 @@
1
- #!/usr/bin/ruby
2
- require 'optparse'
3
-
4
- options = { :environment => "development" }
5
-
6
- ARGV.options do |opts|
7
- script_name = File.basename($0)
8
- opts.banner = "Usage: runner 'puts Person.find(1).name' [options]"
9
-
10
- opts.separator ""
11
-
12
- opts.on("-e", "--environment=name", String,
13
- "Specifies the environment for the runner to operate under (test/development/production).",
14
- "Default: development") { |options[:environment]| }
15
-
16
- opts.separator ""
17
-
18
- opts.on("-h", "--help",
19
- "Show this help message.") { puts opts; exit }
20
-
21
- opts.parse!
22
- end
23
-
24
- ENV["RAILS_ENV"] = options[:environment]
25
-
26
- #!/usr/local/bin/ruby
27
-
28
- require File.dirname(__FILE__) + '/../config/environment'
29
- eval(ARGV.first)
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/runner'
@@ -1,49 +1,3 @@
1
- #!/usr/bin/ruby
2
-
3
- require 'webrick'
4
- require 'optparse'
5
-
6
- OPTIONS = {
7
- :port => 3000,
8
- :ip => "0.0.0.0",
9
- :environment => "development",
10
- :server_root => File.expand_path(File.dirname(__FILE__) + "/../public/"),
11
- :server_type => WEBrick::SimpleServer
12
- }
13
-
14
- ARGV.options do |opts|
15
- script_name = File.basename($0)
16
- opts.banner = "Usage: ruby #{script_name} [options]"
17
-
18
- opts.separator ""
19
-
20
- opts.on("-p", "--port=port", Integer,
21
- "Runs Rails on the specified port.",
22
- "Default: 3000") { |OPTIONS[:port]| }
23
- opts.on("-b", "--binding=ip", String,
24
- "Binds Rails to the specified ip.",
25
- "Default: 0.0.0.0") { |OPTIONS[:ip]| }
26
- opts.on("-e", "--environment=name", String,
27
- "Specifies the environment to run this server under (test/development/production).",
28
- "Default: development") { |OPTIONS[:environment]| }
29
- opts.on("-d", "--daemon",
30
- "Make Rails run as a Daemon (only works if fork is available -- meaning on *nix)."
31
- ) { OPTIONS[:server_type] = WEBrick::Daemon }
32
-
33
- opts.separator ""
34
-
35
- opts.on("-h", "--help",
36
- "Show this help message.") { puts opts; exit }
37
-
38
- opts.parse!
39
- end
40
-
41
- ENV["RAILS_ENV"] = OPTIONS[:environment]
42
- require File.dirname(__FILE__) + "/../config/environment"
43
- require 'webrick_server'
44
-
45
- OPTIONS['working_directory'] = File.expand_path(RAILS_ROOT)
46
-
47
- puts "=> Rails application started on http://#{OPTIONS[:ip]}:#{OPTIONS[:port]}"
48
- puts "=> Ctrl-C to shutdown server; call with --help for options" if OPTIONS[:server_type] == WEBrick::SimpleServer
49
- DispatchServlet.dispatch(OPTIONS)
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/server'
@@ -0,0 +1,19 @@
1
+ # init.rb - a sample script for Ruby on Rails
2
+ #
3
+ # Copyright (C) 2005 Masao Mutoh
4
+ #
5
+ # This file is distributed under the same license as Ruby-GetText-Package.
6
+
7
+ require 'gettext_plugin'
8
+
9
+ class ActionController::Base
10
+ include LangHelper
11
+ helper LangHelper
12
+
13
+ before_filter{ |controller|
14
+ if controller.params["action"] == "cookie_locale"
15
+ controller.cookie_locale
16
+ end
17
+ }
18
+ end
19
+
@@ -1,32 +1,37 @@
1
- # lang_helper.rb - a sample script for Ruby on Rails
1
+ # gettext_plugin.rb - a sample script for Ruby on Rails
2
2
  #
3
3
  # Copyright (C) 2005 Masao Mutoh
4
4
  #
5
5
  # This file is distributed under the same license as Ruby-GetText-Package.
6
6
 
7
+ require 'gettext/rails'
8
+
7
9
  module LangHelper
8
- # If you need to bind yet another textdomain to your helper.
10
+ # If you need to bind yet another textdomain to your plugin/helper.
9
11
  # Separate the name space from ActionView::Base/ApplicationController.
10
12
  class YetanotherTextDomain
11
13
  include GetText::Rails
12
14
 
13
15
  def initialize
14
16
  # You need to call bindtextdomain in an instance of ActionView::Base.
15
- # The locale is set automatically or use Cookie value, parameter "lang".
16
- bindtextdomain("lang_helper")
17
-
18
- # Or set locale forcely.
19
- #bindtextdomain("lang_helper", nil, "ja")
17
+ # The locale is used same values which define ApplicationController#init_gettext.
18
+ bindtextdomain("gettext_plugin")
20
19
  end
21
20
 
22
21
  def show_language(actionview)
23
22
  langs = ["en"] + Dir.glob(File.join(RAILS_ROOT,"locale/*")).collect{|item| File.basename(item)}
23
+ langs.delete("CVS")
24
+ langs.uniq!
24
25
  ret = "<h4>" + _("Select locale") + "</h4>"
25
- langs.sort.each do |lang|
26
+ langs.sort.each_with_index do |lang, i|
26
27
  ret << actionview.link_to("[#{lang}]", :action => "cookie_locale", :lang => lang)
28
+ if ((i + 1) % 6 == 0)
29
+ ret << "<br/>"
30
+ end
27
31
  end
28
32
  ret
29
33
  end
34
+
30
35
  def cookie_locale(cookies, flash, params)
31
36
  cookies["lang"] = params["lang"]
32
37
  flash[:notice] = _('Cookie &quot;lang&quot; is set: %s') % params["lang"]
@@ -34,16 +39,15 @@ module LangHelper
34
39
  end
35
40
 
36
41
  # This function shows supported languages with link to set cookie
37
- # action (coolie_locale).
42
+ # action (cookie_locale).
38
43
  def show_language
39
44
  YetanotherTextDomain.new.show_language(self)
40
45
  end
41
46
 
42
47
  # This function is called when the language link is set.
43
48
  def cookie_locale
44
- YetanotherTextDomain.new.cookie_locale(cookies, flash, @params)
49
+ YetanotherTextDomain.new.cookie_locale(cookies, flash, params)
45
50
  redirect_to :action => 'list'
46
51
  end
47
-
48
52
  end
49
53
 
data/src/poparser.ry ADDED
@@ -0,0 +1,171 @@
1
+ #
2
+ # poparser.ry - ruby version of msgfmt
3
+ #
4
+ # Copyright (C) 2002-2005 Masao Mutoh <mutoh@highway.ne.jp>
5
+ #
6
+ # You may redistribute it and/or modify it under the same
7
+ # license terms as Ruby.
8
+
9
+ class GetText::PoParser
10
+
11
+ token COMMENT MSGID MSGID_PLURAL MSGSTR STRING PLURAL_NUM
12
+
13
+ rule
14
+
15
+ msgfmt
16
+ : /* empty */
17
+ | msgfmt comment
18
+ | msgfmt message
19
+ ;
20
+
21
+ message
22
+ : MSGID string_list MSGSTR string_list
23
+ {
24
+ if @fuzzy
25
+ if val[1] != ""
26
+ $stderr.print _("Warning: fuzzy message was ignored.\n")
27
+ $stderr.print " msgid '#{val[1]}'\n"
28
+ else
29
+ on_message('', unescape(val[3]))
30
+ end
31
+ @fuzzy = false
32
+ else
33
+ on_message(unescape(val[1]), unescape(val[3]))
34
+ end
35
+ result = ""
36
+ }
37
+ | MSGID string_list MSGID_PLURAL string_list msgstr_plural
38
+ {
39
+ if @fuzzy
40
+ if val[1] != ""
41
+ $stderr.print _("Warning: fuzzy message was ignored.\n")
42
+ $stderr.print "msgid = '#{val[1]}\n"
43
+ else
44
+ on_message('', unescape(val[3]))
45
+ end
46
+ @fuzzy = false
47
+ else
48
+ on_message(unescape(val[1]) + "\000" + unescape(val[3]), unescape(val[4]))
49
+ end
50
+ result = ""
51
+ }
52
+ ;
53
+
54
+ msgstr_plural
55
+ : msgstr_plural msgstr_plural_line
56
+ {
57
+ result = val[0] + "\000" + val[1]
58
+ }
59
+ | msgstr_plural_line
60
+ ;
61
+
62
+ msgstr_plural_line
63
+ : MSGSTR PLURAL_NUM string_list
64
+ {
65
+ result = val[2]
66
+ }
67
+ ;
68
+
69
+ comment
70
+ : COMMENT
71
+ {
72
+ on_comment(val[0])
73
+ }
74
+ #| COMMENT
75
+ #;
76
+
77
+ string_list
78
+ : string_list STRING
79
+ {
80
+ result = val.delete_if{|item| item == ""}.join
81
+ }
82
+ | STRING
83
+ {
84
+ result = val[0]
85
+ }
86
+ ;
87
+ end
88
+
89
+ ---- inner
90
+ include GetText
91
+ GetText.bindtextdomain("rgettext")
92
+
93
+ def unescape(orig)
94
+ ret = orig.gsub(/\\n/, "\n")
95
+ ret.gsub!(/\\t/, "\t")
96
+ ret.gsub!(/\\r/, "\r")
97
+ ret.gsub!(/\\"/, "\"")
98
+ ret
99
+ end
100
+
101
+ def parse(str, data)
102
+ @comments = []
103
+ @data = data
104
+ @fuzzy = false
105
+ str.strip!
106
+ @q = []
107
+ until str.empty? do
108
+ case str
109
+ when /\A\s+/
110
+ str = $'
111
+ when /\Amsgid_plural/
112
+ @q.push [:MSGID_PLURAL, $&]
113
+ str = $'
114
+ when /\Amsgid/
115
+ @q.push [:MSGID, $&]
116
+ str = $'
117
+ when /\Amsgstr/
118
+ @q.push [:MSGSTR, $&]
119
+ str = $'
120
+ when /\A\[(\d+)\]/
121
+ @q.push [:PLURAL_NUM, $1]
122
+ str = $'
123
+ when /\A\#~(.*)/
124
+ $stderr.print _("Warning: obsolete msgid is existed.\n")
125
+ $stderr.print " #{$&}\n"
126
+ @q.push [:COMMENT, $&]
127
+ str = $'
128
+ when /\A\#(.*)/
129
+ @q.push [:COMMENT, $&]
130
+ str = $'
131
+ when /\A\"(.*)\"/
132
+ @q.push [:STRING, $1]
133
+ str = $'
134
+ else
135
+ #c = str[0,1]
136
+ #@q.push [:STRING, c]
137
+ str = str[1..-1]
138
+ end
139
+ end
140
+ @q.push [false, '$end']
141
+ if $DEBUG
142
+ @q.each do |a,b|
143
+ puts "[#{a}, #{b}]"
144
+ end
145
+ end
146
+ @yydebug = true if $DEBUG
147
+ do_parse
148
+
149
+ if @comments.size > 0
150
+ @data.set_comment(:last, @comments.join("\n"))
151
+ end
152
+ @data
153
+ end
154
+
155
+ def next_token
156
+ @q.shift
157
+ end
158
+
159
+ def on_message(msgid, msgstr)
160
+ @data[msgid] = msgstr
161
+
162
+ @data.set_comment(msgid, @comments.join("\n"))
163
+ @comments.clear
164
+ end
165
+
166
+ def on_comment(comment)
167
+ @fuzzy = true if (/fuzzy/ =~ comment)
168
+ @comments << comment
169
+ end
170
+
171
+ ---- footer