Top Level Namespace
Defined Under Namespace
Modules: AppMaint
Instance Method Summary collapse
Instance Method Details
#close_sessions ⇒ Object
15 16 17 18 |
# File 'lib/app_maint.rb', line 15 def close_sessions sessions.values.each { |session| session.close } sessions.clear end |
#template(from, to) ⇒ Object
1 2 3 4 |
# File 'lib/recipes/base.rb', line 1 def template(from, to) erb = File.read(File.("../templates/#{from}", __FILE__)) put ERB.new(erb).result(binding), to end |
#with_user(new_user, &block) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/app_maint.rb', line 6 def with_user(new_user, &block) old_user = user set :user, new_user close_sessions yield set :user, old_user close_sessions end |