##// END OF EJS Templates
scm: fix non ascii text files displaying (#6256)....
Toshi MARUYAMA -
r5084:79eba572affb
parent child
Show More
@@ -1,341 +1,356
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2009 Jean-Philippe Lang
2 # Copyright (C) 2006-2009 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 require 'SVG/Graph/Bar'
18 require 'SVG/Graph/Bar'
19 require 'SVG/Graph/BarHorizontal'
19 require 'SVG/Graph/BarHorizontal'
20 require 'digest/sha1'
20 require 'digest/sha1'
21
21
22 class ChangesetNotFound < Exception; end
22 class ChangesetNotFound < Exception; end
23 class InvalidRevisionParam < Exception; end
23 class InvalidRevisionParam < Exception; end
24
24
25 class RepositoriesController < ApplicationController
25 class RepositoriesController < ApplicationController
26 menu_item :repository
26 menu_item :repository
27 menu_item :settings, :only => :edit
27 menu_item :settings, :only => :edit
28 default_search_scope :changesets
28 default_search_scope :changesets
29
29
30 before_filter :find_repository, :except => :edit
30 before_filter :find_repository, :except => :edit
31 before_filter :find_project, :only => :edit
31 before_filter :find_project, :only => :edit
32 before_filter :authorize
32 before_filter :authorize
33 accept_key_auth :revisions
33 accept_key_auth :revisions
34
34
35 rescue_from Redmine::Scm::Adapters::CommandFailed, :with => :show_error_command_failed
35 rescue_from Redmine::Scm::Adapters::CommandFailed, :with => :show_error_command_failed
36
36
37 def edit
37 def edit
38 @repository = @project.repository
38 @repository = @project.repository
39 if !@repository
39 if !@repository
40 @repository = Repository.factory(params[:repository_scm])
40 @repository = Repository.factory(params[:repository_scm])
41 @repository.project = @project if @repository
41 @repository.project = @project if @repository
42 end
42 end
43 if request.post? && @repository
43 if request.post? && @repository
44 @repository.attributes = params[:repository]
44 @repository.attributes = params[:repository]
45 @repository.save
45 @repository.save
46 end
46 end
47 render(:update) do |page|
47 render(:update) do |page|
48 page.replace_html "tab-content-repository", :partial => 'projects/settings/repository'
48 page.replace_html "tab-content-repository", :partial => 'projects/settings/repository'
49 if @repository && !@project.repository
49 if @repository && !@project.repository
50 @project.reload #needed to reload association
50 @project.reload #needed to reload association
51 page.replace_html "main-menu", render_main_menu(@project)
51 page.replace_html "main-menu", render_main_menu(@project)
52 end
52 end
53 end
53 end
54 end
54 end
55
55
56 def committers
56 def committers
57 @committers = @repository.committers
57 @committers = @repository.committers
58 @users = @project.users
58 @users = @project.users
59 additional_user_ids = @committers.collect(&:last).collect(&:to_i) - @users.collect(&:id)
59 additional_user_ids = @committers.collect(&:last).collect(&:to_i) - @users.collect(&:id)
60 @users += User.find_all_by_id(additional_user_ids) unless additional_user_ids.empty?
60 @users += User.find_all_by_id(additional_user_ids) unless additional_user_ids.empty?
61 @users.compact!
61 @users.compact!
62 @users.sort!
62 @users.sort!
63 if request.post? && params[:committers].is_a?(Hash)
63 if request.post? && params[:committers].is_a?(Hash)
64 # Build a hash with repository usernames as keys and corresponding user ids as values
64 # Build a hash with repository usernames as keys and corresponding user ids as values
65 @repository.committer_ids = params[:committers].values.inject({}) {|h, c| h[c.first] = c.last; h}
65 @repository.committer_ids = params[:committers].values.inject({}) {|h, c| h[c.first] = c.last; h}
66 flash[:notice] = l(:notice_successful_update)
66 flash[:notice] = l(:notice_successful_update)
67 redirect_to :action => 'committers', :id => @project
67 redirect_to :action => 'committers', :id => @project
68 end
68 end
69 end
69 end
70
70
71 def destroy
71 def destroy
72 @repository.destroy
72 @repository.destroy
73 redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'repository'
73 redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'repository'
74 end
74 end
75
75
76 def show
76 def show
77 @repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty?
77 @repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty?
78
78
79 @entries = @repository.entries(@path, @rev)
79 @entries = @repository.entries(@path, @rev)
80 @changeset = @repository.find_changeset_by_name(@rev)
80 @changeset = @repository.find_changeset_by_name(@rev)
81 if request.xhr?
81 if request.xhr?
82 @entries ? render(:partial => 'dir_list_content') : render(:nothing => true)
82 @entries ? render(:partial => 'dir_list_content') : render(:nothing => true)
83 else
83 else
84 (show_error_not_found; return) unless @entries
84 (show_error_not_found; return) unless @entries
85 @changesets = @repository.latest_changesets(@path, @rev)
85 @changesets = @repository.latest_changesets(@path, @rev)
86 @properties = @repository.properties(@path, @rev)
86 @properties = @repository.properties(@path, @rev)
87 render :action => 'show'
87 render :action => 'show'
88 end
88 end
89 end
89 end
90
90
91 alias_method :browse, :show
91 alias_method :browse, :show
92
92
93 def changes
93 def changes
94 @entry = @repository.entry(@path, @rev)
94 @entry = @repository.entry(@path, @rev)
95 (show_error_not_found; return) unless @entry
95 (show_error_not_found; return) unless @entry
96 @changesets = @repository.latest_changesets(@path, @rev, Setting.repository_log_display_limit.to_i)
96 @changesets = @repository.latest_changesets(@path, @rev, Setting.repository_log_display_limit.to_i)
97 @properties = @repository.properties(@path, @rev)
97 @properties = @repository.properties(@path, @rev)
98 @changeset = @repository.find_changeset_by_name(@rev)
98 @changeset = @repository.find_changeset_by_name(@rev)
99 end
99 end
100
100
101 def revisions
101 def revisions
102 @changeset_count = @repository.changesets.count
102 @changeset_count = @repository.changesets.count
103 @changeset_pages = Paginator.new self, @changeset_count,
103 @changeset_pages = Paginator.new self, @changeset_count,
104 per_page_option,
104 per_page_option,
105 params['page']
105 params['page']
106 @changesets = @repository.changesets.find(:all,
106 @changesets = @repository.changesets.find(:all,
107 :limit => @changeset_pages.items_per_page,
107 :limit => @changeset_pages.items_per_page,
108 :offset => @changeset_pages.current.offset,
108 :offset => @changeset_pages.current.offset,
109 :include => [:user, :repository])
109 :include => [:user, :repository])
110
110
111 respond_to do |format|
111 respond_to do |format|
112 format.html { render :layout => false if request.xhr? }
112 format.html { render :layout => false if request.xhr? }
113 format.atom { render_feed(@changesets, :title => "#{@project.name}: #{l(:label_revision_plural)}") }
113 format.atom { render_feed(@changesets, :title => "#{@project.name}: #{l(:label_revision_plural)}") }
114 end
114 end
115 end
115 end
116
116
117 def entry
117 def entry
118 @entry = @repository.entry(@path, @rev)
118 @entry = @repository.entry(@path, @rev)
119 (show_error_not_found; return) unless @entry
119 (show_error_not_found; return) unless @entry
120
120
121 # If the entry is a dir, show the browser
121 # If the entry is a dir, show the browser
122 (show; return) if @entry.is_dir?
122 (show; return) if @entry.is_dir?
123
123
124 @content = @repository.cat(@path, @rev)
124 @content = @repository.cat(@path, @rev)
125 (show_error_not_found; return) unless @content
125 (show_error_not_found; return) unless @content
126 if 'raw' == params[:format] || @content.is_binary_data? ||
126 if 'raw' == params[:format] ||
127 (@entry.size && @entry.size > Setting.file_max_size_displayed.to_i.kilobyte)
127 (@content.size && @content.size > Setting.file_max_size_displayed.to_i.kilobyte) ||
128 ! is_entry_text_data?(@content, @path)
128 # Force the download
129 # Force the download
129 send_data @content, :filename => filename_for_content_disposition(@path.split('/').last)
130 send_data @content, :filename => filename_for_content_disposition(@path.split('/').last)
130 else
131 else
131 # Prevent empty lines when displaying a file with Windows style eol
132 # Prevent empty lines when displaying a file with Windows style eol
133 # TODO: UTF-16
134 # Is this needs? AttachmentsController reads file simply.
132 @content.gsub!("\r\n", "\n")
135 @content.gsub!("\r\n", "\n")
133 @changeset = @repository.find_changeset_by_name(@rev)
136 @changeset = @repository.find_changeset_by_name(@rev)
134 end
137 end
138 end
139
140 def is_entry_text_data?(ent, path)
141 # UTF-16 contains "\x00".
142 # It is very strict that file contains less than 30% of ascii symbols
143 # in non Western Europe.
144 return true if Redmine::MimeType.is_type?('text', path)
145 # Ruby 1.8.6 has a bug of integer divisions.
146 # http://apidock.com/ruby/v1_8_6_287/String/is_binary_data%3F
147 return false if ent.is_binary_data?
148 true
135 end
149 end
150 private :is_entry_text_data?
136
151
137 def annotate
152 def annotate
138 @entry = @repository.entry(@path, @rev)
153 @entry = @repository.entry(@path, @rev)
139 (show_error_not_found; return) unless @entry
154 (show_error_not_found; return) unless @entry
140
155
141 @annotate = @repository.scm.annotate(@path, @rev)
156 @annotate = @repository.scm.annotate(@path, @rev)
142 (render_error l(:error_scm_annotate); return) if @annotate.nil? || @annotate.empty?
157 (render_error l(:error_scm_annotate); return) if @annotate.nil? || @annotate.empty?
143 @changeset = @repository.find_changeset_by_name(@rev)
158 @changeset = @repository.find_changeset_by_name(@rev)
144 end
159 end
145
160
146 def revision
161 def revision
147 raise ChangesetNotFound if @rev.blank?
162 raise ChangesetNotFound if @rev.blank?
148 @changeset = @repository.find_changeset_by_name(@rev)
163 @changeset = @repository.find_changeset_by_name(@rev)
149 raise ChangesetNotFound unless @changeset
164 raise ChangesetNotFound unless @changeset
150
165
151 respond_to do |format|
166 respond_to do |format|
152 format.html
167 format.html
153 format.js {render :layout => false}
168 format.js {render :layout => false}
154 end
169 end
155 rescue ChangesetNotFound
170 rescue ChangesetNotFound
156 show_error_not_found
171 show_error_not_found
157 end
172 end
158
173
159 def diff
174 def diff
160 if params[:format] == 'diff'
175 if params[:format] == 'diff'
161 @diff = @repository.diff(@path, @rev, @rev_to)
176 @diff = @repository.diff(@path, @rev, @rev_to)
162 (show_error_not_found; return) unless @diff
177 (show_error_not_found; return) unless @diff
163 filename = "changeset_r#{@rev}"
178 filename = "changeset_r#{@rev}"
164 filename << "_r#{@rev_to}" if @rev_to
179 filename << "_r#{@rev_to}" if @rev_to
165 send_data @diff.join, :filename => "#{filename}.diff",
180 send_data @diff.join, :filename => "#{filename}.diff",
166 :type => 'text/x-patch',
181 :type => 'text/x-patch',
167 :disposition => 'attachment'
182 :disposition => 'attachment'
168 else
183 else
169 @diff_type = params[:type] || User.current.pref[:diff_type] || 'inline'
184 @diff_type = params[:type] || User.current.pref[:diff_type] || 'inline'
170 @diff_type = 'inline' unless %w(inline sbs).include?(@diff_type)
185 @diff_type = 'inline' unless %w(inline sbs).include?(@diff_type)
171
186
172 # Save diff type as user preference
187 # Save diff type as user preference
173 if User.current.logged? && @diff_type != User.current.pref[:diff_type]
188 if User.current.logged? && @diff_type != User.current.pref[:diff_type]
174 User.current.pref[:diff_type] = @diff_type
189 User.current.pref[:diff_type] = @diff_type
175 User.current.preference.save
190 User.current.preference.save
176 end
191 end
177
192
178 @cache_key = "repositories/diff/#{@repository.id}/" + Digest::MD5.hexdigest("#{@path}-#{@rev}-#{@rev_to}-#{@diff_type}")
193 @cache_key = "repositories/diff/#{@repository.id}/" + Digest::MD5.hexdigest("#{@path}-#{@rev}-#{@rev_to}-#{@diff_type}")
179 unless read_fragment(@cache_key)
194 unless read_fragment(@cache_key)
180 @diff = @repository.diff(@path, @rev, @rev_to)
195 @diff = @repository.diff(@path, @rev, @rev_to)
181 show_error_not_found unless @diff
196 show_error_not_found unless @diff
182 end
197 end
183
198
184 @changeset = @repository.find_changeset_by_name(@rev)
199 @changeset = @repository.find_changeset_by_name(@rev)
185 @changeset_to = @rev_to ? @repository.find_changeset_by_name(@rev_to) : nil
200 @changeset_to = @rev_to ? @repository.find_changeset_by_name(@rev_to) : nil
186 @diff_format_revisions = @repository.diff_format_revisions(@changeset, @changeset_to)
201 @diff_format_revisions = @repository.diff_format_revisions(@changeset, @changeset_to)
187 end
202 end
188 end
203 end
189
204
190 def stats
205 def stats
191 end
206 end
192
207
193 def graph
208 def graph
194 data = nil
209 data = nil
195 case params[:graph]
210 case params[:graph]
196 when "commits_per_month"
211 when "commits_per_month"
197 data = graph_commits_per_month(@repository)
212 data = graph_commits_per_month(@repository)
198 when "commits_per_author"
213 when "commits_per_author"
199 data = graph_commits_per_author(@repository)
214 data = graph_commits_per_author(@repository)
200 end
215 end
201 if data
216 if data
202 headers["Content-Type"] = "image/svg+xml"
217 headers["Content-Type"] = "image/svg+xml"
203 send_data(data, :type => "image/svg+xml", :disposition => "inline")
218 send_data(data, :type => "image/svg+xml", :disposition => "inline")
204 else
219 else
205 render_404
220 render_404
206 end
221 end
207 end
222 end
208
223
209 private
224 private
210
225
211 REV_PARAM_RE = %r{\A[a-f0-9]*\Z}i
226 REV_PARAM_RE = %r{\A[a-f0-9]*\Z}i
212
227
213 def find_repository
228 def find_repository
214 @project = Project.find(params[:id])
229 @project = Project.find(params[:id])
215 @repository = @project.repository
230 @repository = @project.repository
216 (render_404; return false) unless @repository
231 (render_404; return false) unless @repository
217 @path = params[:path].join('/') unless params[:path].nil?
232 @path = params[:path].join('/') unless params[:path].nil?
218 @path ||= ''
233 @path ||= ''
219 @rev = params[:rev].blank? ? @repository.default_branch : params[:rev].strip
234 @rev = params[:rev].blank? ? @repository.default_branch : params[:rev].strip
220 @rev_to = params[:rev_to]
235 @rev_to = params[:rev_to]
221
236
222 unless @rev.to_s.match(REV_PARAM_RE) && @rev_to.to_s.match(REV_PARAM_RE)
237 unless @rev.to_s.match(REV_PARAM_RE) && @rev_to.to_s.match(REV_PARAM_RE)
223 if @repository.branches.blank?
238 if @repository.branches.blank?
224 raise InvalidRevisionParam
239 raise InvalidRevisionParam
225 end
240 end
226 end
241 end
227 rescue ActiveRecord::RecordNotFound
242 rescue ActiveRecord::RecordNotFound
228 render_404
243 render_404
229 rescue InvalidRevisionParam
244 rescue InvalidRevisionParam
230 show_error_not_found
245 show_error_not_found
231 end
246 end
232
247
233 def show_error_not_found
248 def show_error_not_found
234 render_error :message => l(:error_scm_not_found), :status => 404
249 render_error :message => l(:error_scm_not_found), :status => 404
235 end
250 end
236
251
237 # Handler for Redmine::Scm::Adapters::CommandFailed exception
252 # Handler for Redmine::Scm::Adapters::CommandFailed exception
238 def show_error_command_failed(exception)
253 def show_error_command_failed(exception)
239 render_error l(:error_scm_command_failed, exception.message)
254 render_error l(:error_scm_command_failed, exception.message)
240 end
255 end
241
256
242 def graph_commits_per_month(repository)
257 def graph_commits_per_month(repository)
243 @date_to = Date.today
258 @date_to = Date.today
244 @date_from = @date_to << 11
259 @date_from = @date_to << 11
245 @date_from = Date.civil(@date_from.year, @date_from.month, 1)
260 @date_from = Date.civil(@date_from.year, @date_from.month, 1)
246 commits_by_day = repository.changesets.count(:all, :group => :commit_date, :conditions => ["commit_date BETWEEN ? AND ?", @date_from, @date_to])
261 commits_by_day = repository.changesets.count(:all, :group => :commit_date, :conditions => ["commit_date BETWEEN ? AND ?", @date_from, @date_to])
247 commits_by_month = [0] * 12
262 commits_by_month = [0] * 12
248 commits_by_day.each {|c| commits_by_month[c.first.to_date.months_ago] += c.last }
263 commits_by_day.each {|c| commits_by_month[c.first.to_date.months_ago] += c.last }
249
264
250 changes_by_day = repository.changes.count(:all, :group => :commit_date, :conditions => ["commit_date BETWEEN ? AND ?", @date_from, @date_to])
265 changes_by_day = repository.changes.count(:all, :group => :commit_date, :conditions => ["commit_date BETWEEN ? AND ?", @date_from, @date_to])
251 changes_by_month = [0] * 12
266 changes_by_month = [0] * 12
252 changes_by_day.each {|c| changes_by_month[c.first.to_date.months_ago] += c.last }
267 changes_by_day.each {|c| changes_by_month[c.first.to_date.months_ago] += c.last }
253
268
254 fields = []
269 fields = []
255 12.times {|m| fields << month_name(((Date.today.month - 1 - m) % 12) + 1)}
270 12.times {|m| fields << month_name(((Date.today.month - 1 - m) % 12) + 1)}
256
271
257 graph = SVG::Graph::Bar.new(
272 graph = SVG::Graph::Bar.new(
258 :height => 300,
273 :height => 300,
259 :width => 800,
274 :width => 800,
260 :fields => fields.reverse,
275 :fields => fields.reverse,
261 :stack => :side,
276 :stack => :side,
262 :scale_integers => true,
277 :scale_integers => true,
263 :step_x_labels => 2,
278 :step_x_labels => 2,
264 :show_data_values => false,
279 :show_data_values => false,
265 :graph_title => l(:label_commits_per_month),
280 :graph_title => l(:label_commits_per_month),
266 :show_graph_title => true
281 :show_graph_title => true
267 )
282 )
268
283
269 graph.add_data(
284 graph.add_data(
270 :data => commits_by_month[0..11].reverse,
285 :data => commits_by_month[0..11].reverse,
271 :title => l(:label_revision_plural)
286 :title => l(:label_revision_plural)
272 )
287 )
273
288
274 graph.add_data(
289 graph.add_data(
275 :data => changes_by_month[0..11].reverse,
290 :data => changes_by_month[0..11].reverse,
276 :title => l(:label_change_plural)
291 :title => l(:label_change_plural)
277 )
292 )
278
293
279 graph.burn
294 graph.burn
280 end
295 end
281
296
282 def graph_commits_per_author(repository)
297 def graph_commits_per_author(repository)
283 commits_by_author = repository.changesets.count(:all, :group => :committer)
298 commits_by_author = repository.changesets.count(:all, :group => :committer)
284 commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}
299 commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}
285
300
286 changes_by_author = repository.changes.count(:all, :group => :committer)
301 changes_by_author = repository.changes.count(:all, :group => :committer)
287 h = changes_by_author.inject({}) {|o, i| o[i.first] = i.last; o}
302 h = changes_by_author.inject({}) {|o, i| o[i.first] = i.last; o}
288
303
289 fields = commits_by_author.collect {|r| r.first}
304 fields = commits_by_author.collect {|r| r.first}
290 commits_data = commits_by_author.collect {|r| r.last}
305 commits_data = commits_by_author.collect {|r| r.last}
291 changes_data = commits_by_author.collect {|r| h[r.first] || 0}
306 changes_data = commits_by_author.collect {|r| h[r.first] || 0}
292
307
293 fields = fields + [""]*(10 - fields.length) if fields.length<10
308 fields = fields + [""]*(10 - fields.length) if fields.length<10
294 commits_data = commits_data + [0]*(10 - commits_data.length) if commits_data.length<10
309 commits_data = commits_data + [0]*(10 - commits_data.length) if commits_data.length<10
295 changes_data = changes_data + [0]*(10 - changes_data.length) if changes_data.length<10
310 changes_data = changes_data + [0]*(10 - changes_data.length) if changes_data.length<10
296
311
297 # Remove email adress in usernames
312 # Remove email adress in usernames
298 fields = fields.collect {|c| c.gsub(%r{<.+@.+>}, '') }
313 fields = fields.collect {|c| c.gsub(%r{<.+@.+>}, '') }
299
314
300 graph = SVG::Graph::BarHorizontal.new(
315 graph = SVG::Graph::BarHorizontal.new(
301 :height => 400,
316 :height => 400,
302 :width => 800,
317 :width => 800,
303 :fields => fields,
318 :fields => fields,
304 :stack => :side,
319 :stack => :side,
305 :scale_integers => true,
320 :scale_integers => true,
306 :show_data_values => false,
321 :show_data_values => false,
307 :rotate_y_labels => false,
322 :rotate_y_labels => false,
308 :graph_title => l(:label_commits_per_author),
323 :graph_title => l(:label_commits_per_author),
309 :show_graph_title => true
324 :show_graph_title => true
310 )
325 )
311
326
312 graph.add_data(
327 graph.add_data(
313 :data => commits_data,
328 :data => commits_data,
314 :title => l(:label_revision_plural)
329 :title => l(:label_revision_plural)
315 )
330 )
316
331
317 graph.add_data(
332 graph.add_data(
318 :data => changes_data,
333 :data => changes_data,
319 :title => l(:label_change_plural)
334 :title => l(:label_change_plural)
320 )
335 )
321
336
322 graph.burn
337 graph.burn
323 end
338 end
324
339
325 end
340 end
326
341
327 class Date
342 class Date
328 def months_ago(date = Date.today)
343 def months_ago(date = Date.today)
329 (date.year - self.year)*12 + (date.month - self.month)
344 (date.year - self.year)*12 + (date.month - self.month)
330 end
345 end
331
346
332 def weeks_ago(date = Date.today)
347 def weeks_ago(date = Date.today)
333 (date.year - self.year)*52 + (date.cweek - self.cweek)
348 (date.year - self.year)*52 + (date.cweek - self.cweek)
334 end
349 end
335 end
350 end
336
351
337 class String
352 class String
338 def with_leading_slash
353 def with_leading_slash
339 starts_with?('/') ? self : "/#{self}"
354 starts_with?('/') ? self : "/#{self}"
340 end
355 end
341 end
356 end
General Comments 0
You need to be logged in to leave comments. Login now