rake task for restart rails application runed on mod_rails
amespace :passenger do desc "Restart Application" task :restart do puts `touch tmp/restart.txt` end end
DZone Snippets > bublik > rails
12358 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Voloshin Ruslan http://rubyclub.com.ua/
amespace :passenger do desc "Restart Application" task :restart do puts `touch tmp/restart.txt` end end
namespace :test do Rake::TestTask.new(:helpers) do |t| t.libs << "test" t.pattern = 'test/unit/helper/*_test.rb' t.verbose = true end Rake::Task['test:helpers'].invoke end
module ActionView::Helpers::ActiveRecordHelper def error_messages_for(object_name, options = {}) options = options.symbolize_keys object = instance_variable_get("@#{object_name}") if object && !object.errors.empty? content_tag("div", content_tag( options[:header_tag] || "h2", "Возникло #{object.errors.count} ошибок при сохранении" ) + content_tag("p", "Проблеммы возникли для следующих полей:") + content_tag("dl", object.errors.full_messages.collect { |msg| content_tag("dt", msg) }), "id" => options[:id] || "errorExplanation", "class" => options[:class] || "errorExplanation" ) else "" end end end
irb(main):032:0> irb(main):033:0* server = XMLRPC::Client.new("blogsearch.google.com", "/ping/RPC2", 80) => #<XMLRPC::Client:0x2aaaaeb222e8 @create=nil, @port=80, @http=#<Net::HTTP blogsearch.google.com:80 open=false>, @proxy_host=nil, @http_last_response=nil, @parser=nil, @timeout=30, @path="/ping/RPC2", @password=nil, @http_header_extra=nil, @use_ssl=false, @host="blogsearch.google.com", @user=nil, @proxy_port=nil, @auth=nil, @cookie=nil> irb(main):034:0> server.call("weblogUpdates.extendedPing", 'Rubyclub.com.ua new on site','http://rubyclub.com.ua/', 'http://rubyclub.com.ua/messages/rss') => {"message"=>"Thanks for the ping.", "flerror"=>false}