muck-engine 0.4.9 → 0.4.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. data/VERSION +1 -1
  2. data/lib/muck_engine/populate.rb +1 -1
  3. data/lib/muck_engine/tasks.rb +134 -133
  4. data/lib/test/shoulda_macros/controller.rb +1 -1
  5. data/locales/ar.yml +7 -0
  6. data/locales/bg.yml +7 -0
  7. data/locales/ca.yml +8 -1
  8. data/locales/cs.yml +7 -0
  9. data/locales/da.yml +7 -0
  10. data/locales/de.yml +7 -0
  11. data/locales/el.yml +7 -0
  12. data/locales/es.yml +7 -0
  13. data/locales/et.yml +7 -0
  14. data/locales/fa.yml +7 -0
  15. data/locales/fi.yml +7 -0
  16. data/locales/fr.yml +7 -0
  17. data/locales/gl.yml +7 -0
  18. data/locales/hi.yml +7 -0
  19. data/locales/hr.yml +7 -0
  20. data/locales/hu.yml +7 -0
  21. data/locales/id.yml +7 -0
  22. data/locales/it.yml +7 -0
  23. data/locales/iw.yml +7 -0
  24. data/locales/ja.yml +7 -0
  25. data/locales/ko.yml +7 -0
  26. data/locales/lt.yml +7 -0
  27. data/locales/lv.yml +7 -0
  28. data/locales/mt.yml +7 -0
  29. data/locales/nl.yml +7 -0
  30. data/locales/no.yml +7 -0
  31. data/locales/pl.yml +7 -0
  32. data/locales/pt-PT.yml +7 -0
  33. data/locales/ro.yml +7 -0
  34. data/locales/ru.yml +7 -0
  35. data/locales/sk.yml +7 -0
  36. data/locales/sl.yml +7 -0
  37. data/locales/sq.yml +7 -0
  38. data/locales/sr.yml +8 -1
  39. data/locales/sv.yml +7 -0
  40. data/locales/th.yml +24 -17
  41. data/locales/tl.yml +7 -0
  42. data/locales/tr.yml +7 -0
  43. data/locales/uk.yml +7 -0
  44. data/locales/vi.yml +8 -1
  45. data/locales/zh-CN.yml +7 -0
  46. data/locales/zh-TW.yml +9 -2
  47. data/locales/zh.yml +7 -0
  48. data/muck-engine.gemspec +10 -3
  49. data/public/images/fancybox/blank.gif +0 -0
  50. data/public/images/fancybox/fancy_close.png +0 -0
  51. data/public/images/fancybox/fancy_loading.png +0 -0
  52. data/public/images/fancybox/fancy_nav_left.png +0 -0
  53. data/public/images/fancybox/fancy_nav_right.png +0 -0
  54. data/public/images/fancybox/fancy_shadow_e.png +0 -0
  55. data/public/images/fancybox/fancy_shadow_n.png +0 -0
  56. data/public/images/fancybox/fancy_shadow_ne.png +0 -0
  57. data/public/images/fancybox/fancy_shadow_nw.png +0 -0
  58. data/public/images/fancybox/fancy_shadow_s.png +0 -0
  59. data/public/images/fancybox/fancy_shadow_se.png +0 -0
  60. data/public/images/fancybox/fancy_shadow_sw.png +0 -0
  61. data/public/images/fancybox/fancy_shadow_w.png +0 -0
  62. data/public/images/fancybox/fancy_title_left.png +0 -0
  63. data/public/images/fancybox/fancy_title_main.png +0 -0
  64. data/public/images/fancybox/fancy_title_over.png +0 -0
  65. data/public/images/fancybox/fancy_title_right.png +0 -0
  66. data/public/javascripts/jquery/jquery.easing.js +72 -1
  67. data/public/javascripts/jquery/jquery.fancybox.js +43 -16
  68. data/public/javascripts/jquery/jquery.mousewheel.js +13 -0
  69. data/public/stylesheets/jquery/jquery.fancybox.css +58 -38
  70. metadata +43 -21
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.9
1
+ 0.4.10
@@ -737,7 +737,7 @@ module Muck
737
737
  ['中文', 'Chinese', false, 'zh-CN', true],
738
738
  ['中文', 'Chinese Traditional', false, 'zh-TW', true],
739
739
  ['isiZulu', 'Zulu', false, 'zu', false]
740
- ].each {|l| Language.create(:name => l[0], :english_name => l[1], :is_default => l[2], :locale => l[3], :supported => l[4]) }
740
+ ].each {|l| Language.create(:name => l[0], :english_name => l[1], :is_default => l[2], :locale => l[3], :supported => l[4]) unless Language.find_by_locale(s[3]) }
741
741
  end
742
742
 
743
743
  end
@@ -24,7 +24,7 @@ class MuckEngine
24
24
  def define
25
25
 
26
26
  namespace :muck do
27
-
27
+
28
28
  # just returns the names of the gems as specified by muck_gems
29
29
  def muck_gem_names
30
30
  if defined?(muck_gems)
@@ -33,7 +33,7 @@ class MuckEngine
33
33
  puts "Please create a method named 'muck_gems' in the namespace :muck in your rakefile."
34
34
  end
35
35
  end
36
-
36
+
37
37
  # Returns the folder name for each gem. Note that muck-solr lives in the acts_as_solr directory
38
38
  def muck_gem_paths
39
39
  if defined?(muck_gems)
@@ -58,7 +58,7 @@ class MuckEngine
58
58
  gem_name.sub('-', '_')
59
59
  end
60
60
  end
61
-
61
+
62
62
  def muck_unpack(gem_name)
63
63
  system("gem unpack #{gem_name} --target=#{muck_gems_path}")
64
64
  end
@@ -90,7 +90,7 @@ class MuckEngine
90
90
  def projects_path
91
91
  File.join(RAILS_ROOT, '..')
92
92
  end
93
-
93
+
94
94
  def release_gem(path, gem_name)
95
95
  gem_path = File.join(path, muck_gem_path(gem_name))
96
96
  puts "releasing #{gem_name}"
@@ -120,29 +120,29 @@ class MuckEngine
120
120
  end
121
121
  version = IO.read(version_file).strip
122
122
  environment = IO.read(env_file)
123
-
123
+
124
124
  search = Regexp.new(/\:lib\s*=>\s*['"]#{gem_lib}['"],\s*\:version\s*=>\s*['"][ <>=~]*\d+\.\d+\.\d+['"]/)
125
125
  failure = environment.gsub!(search, ":lib => '#{gem_lib}', :version => '>=#{version}'").nil?
126
-
126
+
127
127
  if failure
128
128
  search = Regexp.new(/config.gem\s*['"]#{gem_name}['"],\s*\:version\s*=>\s*['"][ <>=~]*\d+\.\d+\.\d+['"]/)
129
129
  failure = environment.gsub!(search, "config.gem '#{gem_name}', :version => '>=#{version}'").nil?
130
130
  end
131
-
131
+
132
132
  if failure
133
133
  search = Regexp.new(/config.gem\s*['"]#{gem_name}['"],\s*\:lib\s*=>\s*['"]#{gem_lib}['"]/)
134
134
  failure = environment.gsub!(search, "config.gem '#{gem_name}', :lib => '#{gem_lib}', :version => '>=#{version}'").nil?
135
135
  end
136
-
136
+
137
137
  if failure
138
138
  search = Regexp.new(/config.gem\s*['"]#{gem_name}['"]/)
139
139
  failure = environment.gsub!(search, "config.gem '#{gem_name}', :version => '>=#{version}'").nil?
140
140
  end
141
-
141
+
142
142
  if failure
143
143
  puts "Could not update version for #{gem_name}"
144
144
  end
145
-
145
+
146
146
  File.open(env_file, 'w') { |f| f.write(environment) }
147
147
  end
148
148
 
@@ -202,52 +202,105 @@ class MuckEngine
202
202
  FileUtils.cd(dir) { block.arity == 1 ? yield(dir) : yield }
203
203
  end
204
204
 
205
- desc "Release and commit muck gems"
206
- task :release_commit_gems do
207
- muck_gem_names.each do |gem_name|
205
+ namespace :gems do
206
+
207
+ desc "Release and commit muck gems"
208
+ task :release_commit do
209
+ muck_gem_names.each do |gem_name|
210
+ message = "Released new gem"
211
+ release_gem("#{projects_path}", gem_name)
212
+ git_commit("#{projects_path}/#{muck_gem_path(gem_name)}", message)
213
+ git_push("#{projects_path}/#{muck_gem_path(gem_name)}")
214
+ end
215
+ end
216
+
217
+ desc "Release muck gems"
218
+ task :release do
219
+ muck_gem_names.each do |gem_name|
220
+ release_gem("#{projects_path}", gem_name)
221
+ end
222
+ end
223
+
224
+ desc "commit gems after a release"
225
+ task :commit do
208
226
  message = "Released new gem"
209
- release_gem("#{projects_path}", gem_name)
210
- git_commit("#{projects_path}/#{muck_gem_path(gem_name)}", message)
211
- git_push("#{projects_path}/#{muck_gem_path(gem_name)}")
227
+ muck_gem_paths.each do |gem_name|
228
+ git_commit("#{projects_path}/#{gem_name}", message)
229
+ end
212
230
  end
213
- end
214
231
 
215
- desc "Release muck gems"
216
- task :release_gems do
217
- muck_gem_names.each do |gem_name|
218
- release_gem("#{projects_path}", gem_name)
232
+ desc "Pull code for all the gems (use with caution)"
233
+ task :pull do
234
+ muck_gem_paths.each do |gem_name|
235
+ git_pull("#{projects_path}/#{gem_name}")
236
+ end
219
237
  end
220
- end
221
238
 
222
- desc "commit gems after a release"
223
- task :commit_gems do
224
- message = "Released new gem"
225
- muck_gem_paths.each do |gem_name|
226
- git_commit("#{projects_path}/#{gem_name}", message)
239
+ desc "Push code for all the gems (use with caution)"
240
+ task :push do
241
+ muck_gem_paths.each do |gem_name|
242
+ git_push("#{projects_path}/#{gem_name}")
243
+ end
227
244
  end
228
- end
229
245
 
230
- desc "Pull code for all the gems (use with caution)"
231
- task :pull_gems do
232
- muck_gem_paths.each do |gem_name|
233
- git_pull("#{projects_path}/#{gem_name}")
246
+ desc "Gets status for all the muck gems"
247
+ task :status do
248
+ muck_gem_paths.each do |gem_name|
249
+ git_status("#{projects_path}/#{gem_name}")
250
+ end
251
+ end
252
+
253
+ desc "Test all muck gems"
254
+ task :test do
255
+ muck_gem_paths.each do |gem_name|
256
+ puts "***************************************************************"
257
+ puts "testing #{gem_name}"
258
+ puts "***************************************************************"
259
+ system("cd #{projects_path}/#{gem_name}/ && rake test")
260
+ end
234
261
  end
235
- end
236
262
 
237
- desc "Push code for all the gems (use with caution)"
238
- task :push_gems do
239
- muck_gem_paths.each do |gem_name|
240
- git_push("#{projects_path}/#{gem_name}")
263
+ desc "Translate all muck gems"
264
+ task :translate do
265
+ muck_gem_paths.each do |gem_name|
266
+ puts "translating #{gem_name}"
267
+ system("babelphish -o -y #{projects_path}/#{gem_name}/locales/en.yml")
268
+ end
241
269
  end
242
- end
243
270
 
244
- desc "Gets status for all the muck gems"
245
- task :status_gems do
246
- muck_gem_paths.each do |gem_name|
247
- git_status("#{projects_path}/#{gem_name}")
271
+ desc "Unpacks all muck gems into vendor/gems using versions installed on the local machine."
272
+ task :unpack do
273
+ ensure_muck_gems_path
274
+ muck_gems.each do |gem_name|
275
+ muck_unpack(gem_name)
276
+ end
277
+ muck_write_specs
248
278
  end
279
+
280
+ desc "Install and unpacks all muck gems into vendor/gems."
281
+ task :unpack_install => :install do
282
+ ensure_muck_gems_path
283
+ muck_gems.each do |gem_name|
284
+ muck_unpack(gem_name)
285
+ end
286
+ muck_write_specs
287
+ end
288
+
289
+ desc "Install all the gems specified in muck_gems"
290
+ task :install do
291
+ muck_gems.each do |gem_name|
292
+ system("sudo gem install #{gem_name}")
293
+ end
294
+ end
295
+
296
+ desc "write specs into muck gems"
297
+ task :specs do
298
+ muck_write_specs
299
+ end
300
+
249
301
  end
250
302
 
303
+
251
304
  desc "Write muck gem versions into muck"
252
305
  task :versions do
253
306
  muck_gem_names.each do |gem_name|
@@ -255,72 +308,25 @@ class MuckEngine
255
308
  end
256
309
  end
257
310
 
258
- desc "Test all muck gems"
259
- task :test_gems do
260
- muck_gem_paths.each do |gem_name|
261
- puts "***************************************************************"
262
- puts "testing #{gem_name}"
263
- puts "***************************************************************"
264
- system("cd #{projects_path}/#{gem_name}/ && rake test")
265
- end
266
- end
267
-
268
- desc "Translate all muck gems"
269
- task :translate_gems do
270
- muck_gem_paths.each do |gem_name|
271
- puts "translating #{gem_name}"
272
- system("babelphish -o -y #{projects_path}/#{gem_name}/locales/en.yml")
273
- end
274
- end
275
-
276
311
  desc 'Translate app into all languages supported by Google'
277
312
  task :translate_app => :environment do
278
313
  puts 'translating app'
279
314
  system("babelphish -o -y #{RAILS_ROOT}/config/locales/en.yml")
280
315
  end
281
-
282
- desc "write specs into muck gems"
283
- task :specs do
284
- muck_write_specs
285
- end
286
316
 
287
- desc "Unpacks all muck gems into vendor/gems using versions installed on the local machine."
288
- task :unpack do
289
- ensure_muck_gems_path
290
- muck_gems.each do |gem_name|
291
- muck_unpack(gem_name)
292
- end
293
- muck_write_specs
294
- end
295
-
296
- desc "Install and unpacks all muck gems into vendor/gems."
297
- task :unpack_install => :install_gems do
298
- ensure_muck_gems_path
299
- muck_gems.each do |gem_name|
300
- muck_unpack(gem_name)
301
- end
302
- muck_write_specs
317
+ desc "Completely reset and repopulate the database and annotate models. THIS WILL DELETE ALL YOUR DATA"
318
+ task :reset do
319
+ Rake::Task[ "muck:sync" ].execute
320
+ Rake::Task[ "muck:reset_db" ].execute
303
321
  end
304
322
 
305
- desc "Install all the gems specified in muck_gems"
306
- task :install_gems do
307
- muck_gems.each do |gem_name|
308
- system("sudo gem install #{gem_name}")
309
- end
310
- end
311
-
312
- task :setup do
313
- Rake::Task[ "cms_lite:setup" ].execute if muck_gems.include?('cms-lite')
314
- Rake::Task[ "disguise:setup" ].execute if muck_gems.include?('disguise')
315
- end
316
-
317
323
  desc "Sync resources from all muck related gems."
318
324
  task :sync do
319
325
  puts 'syncronizing engines and gems'
320
326
  muck_gems.each do |gem_name|
321
327
  puts "syncronizing assets and code from #{gem_name}"
322
328
  if gem_name.include?('muck')
323
- task = "muck:#{gem_name.gsub('muck-', '')}:sync"
329
+ task = "muck:sync:#{gem_name.gsub('muck-', '')}"
324
330
  else
325
331
  task = "#{gem_name}:sync"
326
332
  end
@@ -333,45 +339,9 @@ class MuckEngine
333
339
  end
334
340
  end
335
341
 
336
- desc "Completely reset and repopulate the database and annotate models. THIS WILL DELETE ALL YOUR DATA"
337
- task :reset do
338
- Rake::Task[ "muck:sync" ].execute
339
- Rake::Task[ "muck:reset_db" ].execute
340
- end
341
-
342
- desc "Drop, creates, migrations and populates the database"
343
- task :reset_db => :environment do
344
-
345
- puts 'droping databases'
346
- Rake::Task[ "db:drop" ].execute
347
-
348
- puts 'creating databases'
349
- Rake::Task[ "db:create" ].execute
350
-
351
- puts 'migrating'
352
- Rake::Task[ "db:migrate" ].execute
353
-
354
- Rake::Task[ "db:setup_db" ].execute
355
- end
356
-
357
- desc "populates the database with all required values"
358
- task :setup_db => :environment do
359
- puts 'populating db with locale info'
360
- Rake::Task[ "muck:db:populate" ].execute
361
-
362
- puts 'flagging the languages muck raker supports and adding services it supports'
363
- Rake::Task[ "muck:raker:db:populate" ].execute
364
-
365
- puts 'adding some oai endpoints and feeds to the db'
366
- Rake::Task[ "muck:raker:db:bootstrap" ].execute
367
-
368
- puts 'setting up admin account'
369
- Rake::Task[ "muck:users:create_admin" ].execute
370
- end
371
-
372
- namespace :engine do
342
+ namespace :sync do
373
343
  desc "Sync files from muck engine."
374
- task :sync do
344
+ task :engine do
375
345
  path = File.join(File.dirname(__FILE__), *%w[.. ..])
376
346
  # FileUtils.cp_r "#{path}/db", ".", :verbose => true, :remove_destination => true
377
347
  # FileUtils.cp_r "#{path}/public", ".", :verbose => true, :remove_destination => true
@@ -386,10 +356,41 @@ class MuckEngine
386
356
  Muck::Populate.all
387
357
  puts 'Finished adding languages, countries and states'
388
358
  end
359
+
360
+ desc "Drop, creates, migrations and populates the database"
361
+ task :reset => :environment do
362
+
363
+ puts 'droping databases'
364
+ Rake::Task[ "db:drop" ].execute
365
+
366
+ puts 'creating databases'
367
+ Rake::Task[ "db:create" ].execute
368
+
369
+ puts 'migrating'
370
+ Rake::Task[ "db:migrate" ].execute
371
+
372
+ Rake::Task[ "db:setup_db" ].execute
373
+ end
374
+
375
+ desc "populates the database with all required values"
376
+ task :setup => :environment do
377
+ puts 'populating db with locale info'
378
+ Rake::Task[ "muck:db:populate" ].execute
379
+
380
+ puts 'flagging the languages muck raker supports and adding services it supports'
381
+ Rake::Task[ "muck:raker:db:populate" ].execute
382
+
383
+ puts 'adding some oai endpoints and feeds to the db'
384
+ Rake::Task[ "muck:raker:db:bootstrap" ].execute
385
+
386
+ puts 'setting up admin account'
387
+ Rake::Task[ "muck:users:create_admin" ].execute
388
+ end
389
389
  end
390
390
  end
391
-
391
+
392
392
  end
393
393
  end
394
394
  end
395
+
395
396
  MuckEngine::Tasks.new
@@ -15,7 +15,7 @@ module MuckControllerMacros
15
15
  login_url ||= '/login'
16
16
  args.each do |action, verb|
17
17
  should "Require login for '#{action}' action" do
18
- if [:put, :delete].include?(verb) # put and delete require an id even if it is a bogus one
18
+ if [:put, :delete].include?(verb) || [:edit].include?(action) # edit, put and delete require an id even if it is a bogus one
19
19
  send(verb, action, :id => 1)
20
20
  else
21
21
  send(verb, action)
data/locales/ar.yml CHANGED
@@ -2,6 +2,13 @@
2
2
  ar:
3
3
  muck:
4
4
  engine:
5
+ admin_access_codes: "رموز الوصول"
6
+ admin_home: منزل
7
+ admin_home_title: "مشرف الصفحة الرئيسية"
8
+ admin_logout: خروج
9
+ admin_roles: الأدوار
10
+ admin_users: شاهد
11
+ admin_welcome: "أرحب بك مرة أخرى {{user}}"
5
12
  choose_country: "اختيار البلد"
6
13
  choose_language: "اختيار اللغة"
7
14
  choose_state: "اختيار الدولة"
data/locales/bg.yml CHANGED
@@ -2,6 +2,13 @@
2
2
  bg:
3
3
  muck:
4
4
  engine:
5
+ admin_access_codes: "Кодове за достъп"
6
+ admin_home: Дом
7
+ admin_home_title: "Админ Начало"
8
+ admin_logout: Изход
9
+ admin_roles: Роли
10
+ admin_users: Потребители
11
+ admin_welcome: "Добре дошли отново {{user}}"
5
12
  choose_country: "Изберете Държава"
6
13
  choose_language: "Изберете език"
7
14
  choose_state: "Изберете държава"
data/locales/ca.yml CHANGED
@@ -2,6 +2,13 @@
2
2
  ca:
3
3
  muck:
4
4
  engine:
5
+ admin_access_codes: "Codis d&#39;Accés"
6
+ admin_home: Inici
7
+ admin_home_title: "Administrador d&#39;Inici"
8
+ admin_logout: "Tancar sessió"
9
+ admin_roles: Rols
10
+ admin_users: Usuaris
11
+ admin_welcome: "Benvingut de nou {{user}}"
5
12
  choose_country: "Selecciona país"
6
13
  choose_language: "Choose Language"
7
14
  choose_state: "Esculli Estat"
@@ -10,7 +17,7 @@ ca:
10
17
  select_language_prompt: "Si us plau, seleccioneu un idioma"
11
18
  select_state_prompt: "Si us plau, seleccioneu un estat"
12
19
  forms:
13
- please_enter_a_value: "Si us plau, introduïu un valor per {{label}}"
20
+ please_enter_a_value: "Introduïu un valor per {{label}}"
14
21
  general:
15
22
  activate: Activar
16
23
  deactivate: Desactivar