Class: ProjectController
Defined Under Namespace
Classes: HtmlDiffVisitor
Constant Summary
collapse
- SCMS =
TODO: check if the various SCMs are installed and disable them with a warning if not. Each SCM class should have an available? method
[
RSCM::CVS,
RSCM::SVN,
RSCM::StarTeam
]
- TRACKERS =
[
DamageControl::Tracker::Null,
DamageControl::Tracker::Bugzilla,
DamageControl::Tracker::JIRA,
DamageControl::Tracker::RubyForge,
DamageControl::Tracker::SourceForge,
DamageControl::Tracker::Scarab,
DamageControl::Tracker::Trac
]
- SCM_WEBS =
[
]
Instance Method Summary
collapse
#breadcrumbs, #load_project
Constructor Details
Returns a new instance of ProjectController.
36
37
38
39
|
# File 'app/controllers/project_controller.rb', line 36
def initialize
super
@navigation_name = "changesets_list"
end
|
Instance Method Details
#changesets ⇒ Object
105
106
107
108
109
110
|
# File 'app/controllers/project_controller.rb', line 105
def changesets
load
last_changeset_identifier = @params["changeset"]
@changesets = @project.changesets(last_changeset_identifier.to_identifier, 1)
@changesets.accept(HtmlDiffVisitor.new(@project))
end
|
75
76
77
78
|
# File 'app/controllers/project_controller.rb', line 75
def
load
send_file(@project.)
end
|
#delete ⇒ Object
80
81
82
83
84
85
86
87
88
|
# File 'app/controllers/project_controller.rb', line 80
def delete
load_project
begin
Rscm.delete_project(project)
rescue => e
return render_text("Couldn't connect to RSCM server. Please make sure it's running.<br>" + e.message)
end
index
end
|
#edit ⇒ Object
69
70
71
72
73
|
# File 'app/controllers/project_controller.rb', line 69
def edit
@edit = true
load
render_action("view")
end
|
#index ⇒ Object
41
42
43
44
|
# File 'app/controllers/project_controller.rb', line 41
def index
@projects = DamageControl::Project.find_all
@navigation_name = "null"
end
|
#new ⇒ Object
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# File 'app/controllers/project_controller.rb', line 46
def new
@project = DamageControl::Project.new
@scms = SCMS.collect {|o| o.new}
first_scm = @scms[0]
def first_scm.selected?
true
end
@trackers = TRACKERS.collect {|o| o.new}
first_tracker = @trackers[0]
def first_tracker.selected?
true
end
@edit = true
@new_project = true
render_action("view")
end
|
#save ⇒ Object
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
# File 'app/controllers/project_controller.rb', line 90
def save
project = instantiate_from_params("project")
project.scm = instantiate_from_params("scm")
project.tracker = instantiate_from_params("tracker")
begin
Rscm.save_project(project)
rescue => e
$stderr.puts(e.backtrace.join("\n"))
return render_text("Couldn't connect to RSCM server. Please make sure it's running.<br>" + e.message)
end
redirect_to(:action => "view", :id => project.name)
end
|
#view ⇒ Object
63
64
65
66
67
|
# File 'app/controllers/project_controller.rb', line 63
def view
return render_text("No project specified") unless @params["id"]
@edit = false
load
end
|