From e957f86cd173976c476123e7afbab8e25ae60674 Mon Sep 17 00:00:00 2001
From: lukemelia
Date: Wed, 8 Nov 2006 06:25:18 +0000
Subject: [PATCH] Convert multiline { || ... } blocks into do || ... end for
nicer style.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@338 a4c988fc-2ded-0310-b66e-134b36920a42
---
tracks/app/controllers/application.rb | 4 +--
tracks/app/views/feed/contexts_rss.rxml | 4 +--
tracks/app/views/feed/projects_rss.rxml | 4 +--
tracks/app/views/feed/rss.rxml | 30 +++++++++++------------
tracks/app/views/todo/list.rxml | 10 ++++----
tracks/test/integration/ldap_auth_test.rb | 4 +--
6 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/tracks/app/controllers/application.rb b/tracks/app/controllers/application.rb
index e2858cb8..72a00488 100644
--- a/tracks/app/controllers/application.rb
+++ b/tracks/app/controllers/application.rb
@@ -93,11 +93,11 @@ class ApplicationController < ActionController::Base
end
def init_not_done_counts(parents = ['project','context'])
- parents.each {|parent|
+ parents.each do |parent|
eval("@#{parent}_not_done_counts = Todo.count(:all,
:conditions => ['user_id = ? and type = ? and done = ?', @user.id, \"Immediate\", false],
:group => :#{parent}_id)")
- }
+ end
end
end
diff --git a/tracks/app/views/feed/contexts_rss.rxml b/tracks/app/views/feed/contexts_rss.rxml
index 37a94a7c..595db86f 100644
--- a/tracks/app/views/feed/contexts_rss.rxml
+++ b/tracks/app/views/feed/contexts_rss.rxml
@@ -4,7 +4,7 @@ xml.rss("version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/") do
xml.title(@title)
xml.link("http://#{@request.host}:#{@request.port}/contexts")
xml.description(@description)
- @contexts.each { |c|
+ @contexts.each do |c|
xml.item do
xml.title(c.name)
xml.link(url_for(:only_path => false, :controller => 'context', :action => 'show', :name => urlize(c.name)))
@@ -14,6 +14,6 @@ xml.rss("version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/") do
context_description += "
"
xml.description(context_description)
end
- }
+ end
end
end
\ No newline at end of file
diff --git a/tracks/app/views/feed/projects_rss.rxml b/tracks/app/views/feed/projects_rss.rxml
index a19ce86d..5c176835 100644
--- a/tracks/app/views/feed/projects_rss.rxml
+++ b/tracks/app/views/feed/projects_rss.rxml
@@ -4,7 +4,7 @@ xml.rss("version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/") do
xml.title(@title)
xml.link("http://#{@request.host}:#{@request.port}/projects")
xml.description(@description)
- @projects.each { |p|
+ @projects.each do |p|
xml.item do
xml.title(p.name)
xml.link(url_for(:only_path => false, :controller => 'project', :action => 'show', :name => urlize(p.name)))
@@ -16,6 +16,6 @@ xml.rss("version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/") do
project_description += ""
xml.description(project_description)
end
- }
+ end
end
end
\ No newline at end of file
diff --git a/tracks/app/views/feed/rss.rxml b/tracks/app/views/feed/rss.rxml
index ff041256..c9e5ae5f 100644
--- a/tracks/app/views/feed/rss.rxml
+++ b/tracks/app/views/feed/rss.rxml
@@ -3,23 +3,23 @@ xml.rss("version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/") do
xml.title(@title)
xml.link("http://#{request.host}:#{request.port}/todo/list")
xml.description(@description)
- @todos.each { |i|
+ @todos.each do |i|
xml.item do
xml.title(i.description)
- xml.link(url_for(:only_path => false, :controller => 'context', :action => 'show', :name => urlize(i.context.name)))
- item_notes = sanitize(markdown( i.notes )) if i.notes?
- due = "Due: #{format_date(i.due)}
\n" if i.due?
+ xml.link(url_for(:only_path => false, :controller => 'context', :action => 'show', :name => urlize(i.context.name)))
+ item_notes = sanitize(markdown( i.notes )) if i.notes?
+ due = "Due: #{format_date(i.due)}
\n" if i.due?
toggle_link = link_to( "mark as done", {:only_path => false, :controller => "todo", :action => "toggle_check", :id => i.id})
- done = "#{toggle_link}
" unless i.completed?
- done = "Completed: #{format_date(i.completed)}
\n" if i.completed?
- context_link = link_to( i.context.name, { :only_path => false, :controller => "context", :action => "show", :name => urlize(i.context.name) } )
- project_link = if i.project_id?
- link_to (i.project.name, { :only_path => false, :controller => "project", :action => "show", :name => urlize(i.project.name)} )
- else
- "none"
- end
- xml.description("#{done||''}#{due||''}#{item_notes||''}\nProject: #{project_link}
\nContext: #{context_link}
")
- end
- }
+ done = "#{toggle_link}
" unless i.completed?
+ done = "Completed: #{format_date(i.completed)}
\n" if i.completed?
+ context_link = link_to( i.context.name, { :only_path => false, :controller => "context", :action => "show", :name => urlize(i.context.name) } )
+ if i.project_id?
+ project_link = link_to (i.project.name, { :only_path => false, :controller => "project", :action => "show", :name => urlize(i.project.name)} )
+ else
+ project_link = "none"
+ end
+ xml.description("#{done||''}#{due||''}#{item_notes||''}\nProject: #{project_link}
\nContext: #{context_link}
")
+ end
+ end
end
end
\ No newline at end of file
diff --git a/tracks/app/views/todo/list.rxml b/tracks/app/views/todo/list.rxml
index b35a6d98..fccd60d9 100644
--- a/tracks/app/views/todo/list.rxml
+++ b/tracks/app/views/todo/list.rxml
@@ -1,14 +1,14 @@
@headers["Content-Type"] = "text/xml; charset=utf-8"
xml.todos_by_context do
- @contexts_to_show.each { |c|
+ @contexts_to_show.each do |c|
xml.context do
xml.name c.name
xml.hide c.hide, :type => :boolean
xml.id c.id, :type => :integer
xml.position c.position, :type => :integer
- c.not_done_todos.each { |t|
+ c.not_done_todos.each do |t|
xml << t.to_xml( :skip_instruct => true, :root => 'todo', :except => [:user_id, :context_id] )
- }
- end
- }
+ end
+ end
+ end
end
\ No newline at end of file
diff --git a/tracks/test/integration/ldap_auth_test.rb b/tracks/test/integration/ldap_auth_test.rb
index 60697c68..98493b1d 100755
--- a/tracks/test/integration/ldap_auth_test.rb
+++ b/tracks/test/integration/ldap_auth_test.rb
@@ -60,10 +60,10 @@ class LdapAuthTest < Test::Unit::TestCase
end
def start_ldap_server
- t = Thread.new(@slapd_conf.path) { |slapd_conf_path|
+ t = Thread.new(@slapd_conf.path) do |slapd_conf_path|
puts "starting slapd..." if OUTPUT_DEBUG_INFO
run_cmd %Q{/usr/libexec/slapd -f #{slapd_conf_path} -h "ldap://127.0.0.1:10389/" -d0}
- }
+ end
sleep(2)
run_cmd %Q{ldapsearch -H "ldap://127.0.0.1:10389/" -x -b '' -s base '(objectclass=*)' namingContexts}
end