Adding a project description using the cruise_config.rb file.

View: New views
2 Messages — Rating Filter:   Alert me  

Adding a project description using the cruise_config.rb file.

by Donovan Bray :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I wanted to add a project description to each of my projects.

So I started with the projects cruise_config.rb

# Project-specific configuration for CruiseControl.rb

Project.configure do |project|
  project.description = "This is a project description"
end


I changed app/models/project.rb

-  attr_accessor :source_control, :scheduler
+  attr_accessor :source_control, :scheduler, :description

   def initialize(name, scm = nil)
     @name = name
+    @description = ''


I added the following to app/views/projects/_project.rhtml

   <td class="build_details">
+    <% if project.description %>
+      <p><%=project.description%></p>
+    <% end %>
     <% latest_build = recent_builds.first %>

I can force a description to show up in the view if I change
@description in the initialze method of project.rb to a value.

But the configuration value from cruise_config.rb never changes it.

What did I miss?
_______________________________________________
Cruisecontrolrb-developers mailing list
Cruisecontrolrb-developers@...
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-developers

Re: Adding a project description using the cruise_config.rb file.

by John D. Hume :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I realize this question is old, but I thought I'd mention that my
recollection of trying to do similar customization of the webapp is
that a Project is only configured with cruise_config.rb in the builder
process for that project, not in the webapp process, even though it's
an instance of the same Project class in both processes.

Hope that helps.
-hume.

On Sat, May 30, 2009 at 10:00 PM, Donovan Bray<donnoman@...> wrote:

> I wanted to add a project description to each of my projects.
>
> So I started with the projects cruise_config.rb
>
> # Project-specific configuration for CruiseControl.rb
>
> Project.configure do |project|
>  project.description = "This is a project description"
> end
>
>
> I changed app/models/project.rb
>
> -  attr_accessor :source_control, :scheduler
> +  attr_accessor :source_control, :scheduler, :description
>
>   def initialize(name, scm = nil)
>     @name = name
> +    @description = ''
>
>
> I added the following to app/views/projects/_project.rhtml
>
>   <td class="build_details">
> +    <% if project.description %>
> +      <p><%=project.description%></p>
> +    <% end %>
>     <% latest_build = recent_builds.first %>
>
> I can force a description to show up in the view if I change
> @description in the initialze method of project.rb to a value.
>
> But the configuration value from cruise_config.rb never changes it.
>
> What did I miss?

--
http://elhumidor.blogspot.com/
_______________________________________________
Cruisecontrolrb-developers mailing list
Cruisecontrolrb-developers@...
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-developers