Changeset 106
- Timestamp:
- 05/15/08 21:52:26 (6 months ago)
- Location:
- trunk
- Files:
-
- 6 modified
-
CHANGELOG.txt (modified) (1 diff)
-
app/controllers/stages_controller.rb (modified) (1 diff)
-
app/models/stage.rb (modified) (1 diff)
-
app/views/stages/tasks.html.erb (modified) (1 diff)
-
test/functional/stages_controller_test.rb (modified) (1 diff)
-
test/unit/webistrano_deployer_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/CHANGELOG.txt
r105 r106 1 1 2 2 SVN 3 4 * Fix XML output of stage tasks. Provided by Mathias Meyer 3 5 4 6 * Add version info XML action. Provided by Mathias Meyer -
trunk/app/controllers/stages_controller.rb
r96 r106 11 11 end 12 12 13 def index 14 @stages = current_project.stages.find(:all) 15 respond_to do |format| 16 format.xml { render :xml => @stages.to_xml} 17 end 18 end 13 19 # GET /projects/1/stages/1 14 20 # GET /projects/1/stages/1.xml 15 21 def show 16 22 @stage = current_project.stages.find(params[:id]) 17 @task_list = [['All tasks: ', '']] + @stage.list_tasks.collect{| x| [x.first, x.first]}.sort23 @task_list = [['All tasks: ', '']] + @stage.list_tasks.collect{|task| [task[:name], task[:name]]}.sort() 18 24 19 25 respond_to do |format| -
trunk/app/models/stage.rb
r82 r106 124 124 d.stage = self 125 125 deployer = Webistrano::Deployer.new(d) 126 deployer.list_tasks.collect { |t| [t.fully_qualified_name, t.description] }.delete_if{|x| x.first == 'shell' || x.first== 'invoke'}126 deployer.list_tasks.collect { |t| {:name => t.fully_qualified_name, :description => t.description} }.delete_if{|t| t[:name] == 'shell' || t[:name] == 'invoke'} 127 127 end 128 128 -
trunk/app/views/stages/tasks.html.erb
r82 r106 4 4 <legend>All Tasks</legend> 5 5 <table> 6 <% @tasks.sort .each do |key, value| %>6 <% @tasks.sort{|a, b| a[:name] <=> b[:name]}.each do |task| %> 7 7 <tr> 8 <td valign="top"><%= link_to key, new_project_stage_deployment_path(current_project, @stage) + "?task=#{key}", :class => 'arrow_link', :name => h(key)%></td>8 <td valign="top"><%= link_to task[:name], new_project_stage_deployment_path(current_project, @stage) + "?task=#{task[:name]}", :class => 'arrow_link', :name => h(task[:name])%></td> 9 9 <td> </td> 10 <td valign="top"><%= simple_format value%></td>10 <td valign="top"><%= simple_format task[:description] %></td> 11 11 </tr> 12 12 <% end %> -
trunk/test/functional/stages_controller_test.rb
r96 r106 107 107 end 108 108 109 def test_should_render_xml_for_stage_tasks 110 get :tasks, :id => @stage.id, :project_id => @project.id, :format => "xml" 111 assert_response :success 112 assert_match /webistrano:mongrel:start/, @response.body 113 end 114 109 115 def test_index 110 116 get :index, :project_id => @project.id, :format => 'xml' -
trunk/test/unit/webistrano_deployer_test.rb
r89 r106 753 753 assert_equal 22, @stage.list_tasks.size # filter shell and invoke 754 754 assert_equal 1, deployer.list_tasks.delete_if{|t| t.fully_qualified_name != 'foo:bar'}.size 755 assert_equal 1, @stage.list_tasks.delete_if{|t| t[ 0] != 'foo:bar'}.size755 assert_equal 1, @stage.list_tasks.delete_if{|t| t[:name] != 'foo:bar'}.size 756 756 end 757 757
