Commit 775418918782d5284000ed0bfea364458c748567

Authored by Robert Speicher
1 parent 1413c23c

Fully embrace Ruby 1.9 hash syntax

Didn't bother with files in db/, config/, or features/
Showing 257 changed files with 1449 additions and 1449 deletions   Show diff stats

Too many changes.

To preserve performance only 100 of 257 files displayed.

app/contexts/commit_load.rb
1 1 class CommitLoad < BaseContext
2 2 def execute
3 3 result = {
4   - :commit => nil,
5   - :suppress_diff => false,
6   - :line_notes => [],
7   - :notes_count => 0,
8   - :note => nil
  4 + commit: nil,
  5 + suppress_diff: false,
  6 + line_notes: [],
  7 + notes_count: 0,
  8 + note: nil
9 9 }
10 10  
11 11 commit = project.commit(params[:id])
... ...
app/contexts/issues_bulk_update_context.rb
... ... @@ -12,12 +12,12 @@ class IssuesBulkUpdateContext &lt; BaseContext
12 12 opts[:assignee_id] = assignee_id if assignee_id.present?
13 13 opts[:closed] = (status == "closed") if status.present?
14 14  
15   - issues = Issue.where(:id => issues_ids).all
  15 + issues = Issue.where(id: issues_ids).all
16 16 issues = issues.select { |issue| can?(current_user, :modify_issue, issue) }
17 17 issues.each { |issue| issue.update_attributes(opts) }
18 18 {
19   - :count => issues.count,
20   - :success => !issues.count.zero?
  19 + count: issues.count,
  20 + success: !issues.count.zero?
21 21 }
22 22 end
23 23 end
... ...
app/controllers/admin/projects_controller.rb
... ... @@ -2,7 +2,7 @@ class Admin::ProjectsController &lt; ApplicationController
2 2 layout "admin"
3 3 before_filter :authenticate_user!
4 4 before_filter :authenticate_admin!
5   - before_filter :admin_project, :only => [:edit, :show, :update, :destroy, :team_update]
  5 + before_filter :admin_project, only: [:edit, :show, :update, :destroy, :team_update]
6 6  
7 7 def index
8 8 @admin_projects = Project.scoped
... ... @@ -36,7 +36,7 @@ class Admin::ProjectsController &lt; ApplicationController
36 36 if @admin_project.save
37 37 redirect_to [:admin, @admin_project], notice: 'Project was successfully created.'
38 38 else
39   - render :action => "new"
  39 + render action: "new"
40 40 end
41 41 end
42 42  
... ... @@ -50,7 +50,7 @@ class Admin::ProjectsController &lt; ApplicationController
50 50 if @admin_project.update_attributes(params[:project])
51 51 redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.'
52 52 else
53   - render :action => "edit"
  53 + render action: "edit"
54 54 end
55 55 end
56 56  
... ...
app/controllers/admin/users_controller.rb
... ... @@ -34,7 +34,7 @@ class Admin::UsersController &lt; ApplicationController
34 34  
35 35  
36 36 def new
37   - @admin_user = User.new(:projects_limit => Gitlab.config.default_projects_limit)
  37 + @admin_user = User.new(projects_limit: Gitlab.config.default_projects_limit)
38 38 end
39 39  
40 40 def edit
... ...
app/controllers/application_controller.rb
... ... @@ -11,15 +11,15 @@ class ApplicationController &lt; ActionController::Base
11 11 helper_method :abilities, :can?
12 12  
13 13 rescue_from Gitlab::Gitolite::AccessDenied do |exception|
14   - render "errors/gitolite", :layout => "error"
  14 + render "errors/gitolite", layout: "error"
15 15 end
16 16  
17 17 rescue_from Encoding::CompatibilityError do |exception|
18   - render "errors/encoding", :layout => "error", :status => 404
  18 + render "errors/encoding", layout: "error", status: 404
19 19 end
20 20  
21 21 rescue_from ActiveRecord::RecordNotFound do |exception|
22   - render "errors/not_found", :layout => "error", :status => 404
  22 + render "errors/not_found", layout: "error", status: 404
23 23 end
24 24  
25 25 layout :layout_by_resource
... ... @@ -97,15 +97,15 @@ class ApplicationController &lt; ActionController::Base
97 97 end
98 98  
99 99 def access_denied!
100   - render "errors/access_denied", :layout => "error", :status => 404
  100 + render "errors/access_denied", layout: "error", status: 404
101 101 end
102 102  
103 103 def not_found!
104   - render "errors/not_found", :layout => "error", :status => 404
  104 + render "errors/not_found", layout: "error", status: 404
105 105 end
106 106  
107 107 def git_not_found!
108   - render "errors/git_not_found", :layout => "error", :status => 404
  108 + render "errors/git_not_found", layout: "error", status: 404
109 109 end
110 110  
111 111 def method_missing(method_sym, *arguments, &block)
... ... @@ -127,7 +127,7 @@ class ApplicationController &lt; ActionController::Base
127 127 end
128 128  
129 129 def render_404
130   - render :file => File.join(Rails.root, "public", "404"), :layout => false, :status => "404"
  130 + render file: File.join(Rails.root, "public", "404"), layout: false, status: "404"
131 131 end
132 132  
133 133 def require_non_empty_project
... ...
app/controllers/commits_controller.rb
... ... @@ -9,7 +9,7 @@ class CommitsController &lt; ApplicationController
9 9 before_filter :authorize_read_project!
10 10 before_filter :authorize_code_access!
11 11 before_filter :require_non_empty_project
12   - before_filter :load_refs, :only => :index # load @branch, @tag & @ref
  12 + before_filter :load_refs, only: :index # load @branch, @tag & @ref
13 13 before_filter :render_full_content
14 14  
15 15 def index
... ... @@ -22,7 +22,7 @@ class CommitsController &lt; ApplicationController
22 22 respond_to do |format|
23 23 format.html # index.html.erb
24 24 format.js
25   - format.atom { render :layout => false }
  25 + format.atom { render layout: false }
26 26 end
27 27 end
28 28  
... ... @@ -61,9 +61,9 @@ class CommitsController &lt; ApplicationController
61 61  
62 62 send_data(
63 63 @commit.to_patch,
64   - :type => "text/plain",
65   - :disposition => 'attachment',
66   - :filename => (@commit.id.to_s + ".patch")
  64 + type: "text/plain",
  65 + disposition: 'attachment',
  66 + filename: (@commit.id.to_s + ".patch")
67 67 )
68 68 end
69 69 end
... ...
app/controllers/dashboard_controller.rb
... ... @@ -9,7 +9,7 @@ class DashboardController &lt; ApplicationController
9 9 respond_to do |format|
10 10 format.html
11 11 format.js
12   - format.atom { render :layout => false }
  12 + format.atom { render layout: false }
13 13 end
14 14 end
15 15  
... ... @@ -28,7 +28,7 @@ class DashboardController &lt; ApplicationController
28 28  
29 29 respond_to do |format|
30 30 format.html
31   - format.atom { render :layout => false }
  31 + format.atom { render layout: false }
32 32 end
33 33 end
34 34 end
... ...
app/controllers/deploy_keys_controller.rb
... ... @@ -40,7 +40,7 @@ class DeployKeysController &lt; ApplicationController
40 40  
41 41 respond_to do |format|
42 42 format.html { redirect_to project_deploy_keys_url }
43   - format.js { render :nothing => true }
  43 + format.js { render nothing: true }
44 44 end
45 45 end
46 46 end
... ...
app/controllers/hooks_controller.rb
... ... @@ -6,7 +6,7 @@ class HooksController &lt; ApplicationController
6 6 # Authorize
7 7 before_filter :add_project_abilities
8 8 before_filter :authorize_read_project!
9   - before_filter :authorize_admin_project!, :only => [:new, :create, :destroy]
  9 + before_filter :authorize_admin_project!, only: [:new, :create, :destroy]
10 10  
11 11 respond_to :html
12 12  
... ...
app/controllers/issues_controller.rb
... ... @@ -2,7 +2,7 @@ class IssuesController &lt; ApplicationController
2 2 before_filter :authenticate_user!
3 3 before_filter :project
4 4 before_filter :module_enabled
5   - before_filter :issue, :only => [:edit, :update, :destroy, :show]
  5 + before_filter :issue, only: [:edit, :update, :destroy, :show]
6 6 helper_method :issues_filter
7 7  
8 8 layout "project"
... ... @@ -14,13 +14,13 @@ class IssuesController &lt; ApplicationController
14 14 before_filter :authorize_read_issue!
15 15  
16 16 # Allow write(create) issue
17   - before_filter :authorize_write_issue!, :only => [:new, :create]
  17 + before_filter :authorize_write_issue!, only: [:new, :create]
18 18  
19 19 # Allow modify issue
20   - before_filter :authorize_modify_issue!, :only => [:close, :edit, :update]
  20 + before_filter :authorize_modify_issue!, only: [:close, :edit, :update]
21 21  
22 22 # Allow destroy issue
23   - before_filter :authorize_admin_issue!, :only => [:destroy]
  23 + before_filter :authorize_admin_issue!, only: [:destroy]
24 24  
25 25 respond_to :js, :html
26 26  
... ... @@ -32,7 +32,7 @@ class IssuesController &lt; ApplicationController
32 32 respond_to do |format|
33 33 format.html # index.html.erb
34 34 format.js
35   - format.atom { render :layout => false }
  35 + format.atom { render layout: false }
36 36 end
37 37 end
38 38  
... ... @@ -46,7 +46,7 @@ class IssuesController &lt; ApplicationController
46 46 end
47 47  
48 48 def show
49   - @note = @project.notes.new(:noteable => @issue)
  49 + @note = @project.notes.new(noteable: @issue)
50 50  
51 51 respond_to do |format|
52 52 format.html
... ... @@ -66,7 +66,7 @@ class IssuesController &lt; ApplicationController
66 66 end
67 67  
68 68 def update
69   - @issue.update_attributes(params[:issue].merge(:author_id_of_changes => current_user.id))
  69 + @issue.update_attributes(params[:issue].merge(author_id_of_changes: current_user.id))
70 70  
71 71 respond_to do |format|
72 72 format.js
... ... @@ -87,20 +87,20 @@ class IssuesController &lt; ApplicationController
87 87  
88 88 respond_to do |format|
89 89 format.html { redirect_to project_issues_path }
90   - format.js { render :nothing => true }
  90 + format.js { render nothing: true }
91 91 end
92 92 end
93 93  
94 94 def sort
95 95 return render_404 unless can?(current_user, :admin_issue, @project)
96 96  
97   - @issues = @project.issues.where(:id => params['issue'])
  97 + @issues = @project.issues.where(id: params['issue'])
98 98 @issues.each do |issue|
99 99 issue.position = params['issue'].index(issue.id.to_s) + 1
100 100 issue.save
101 101 end
102 102  
103   - render :nothing => true
  103 + render nothing: true
104 104 end
105 105  
106 106 def search
... ... @@ -110,12 +110,12 @@ class IssuesController &lt; ApplicationController
110 110 @issues = @issues.where("title LIKE ?", "%#{terms}%") unless terms.blank?
111 111 @issues = @issues.page(params[:page]).per(100)
112 112  
113   - render :partial => 'issues'
  113 + render partial: 'issues'
114 114 end
115 115  
116 116 def bulk_update
117 117 result = IssuesBulkUpdateContext.new(project, current_user, params).execute
118   - redirect_to :back, :notice => "#{result[:count]} issues updated"
  118 + redirect_to :back, notice: "#{result[:count]} issues updated"
119 119 end
120 120  
121 121 protected
... ... @@ -144,8 +144,8 @@ class IssuesController &lt; ApplicationController
144 144 else @project.issues.opened
145 145 end
146 146  
147   - @issues = @issues.where(:assignee_id => params[:assignee_id]) if params[:assignee_id].present?
148   - @issues = @issues.where(:milestone_id => params[:milestone_id]) if params[:milestone_id].present?
  147 + @issues = @issues.where(assignee_id: params[:assignee_id]) if params[:assignee_id].present?
  148 + @issues = @issues.where(milestone_id: params[:milestone_id]) if params[:milestone_id].present?
149 149 @issues = @issues.tagged_with(params[:label_name]) if params[:label_name].present?
150 150 @issues = @issues.includes(:author, :project).order("updated_at")
151 151 @issues
... ...
app/controllers/keys_controller.rb
... ... @@ -29,7 +29,7 @@ class KeysController &lt; ApplicationController
29 29  
30 30 respond_to do |format|
31 31 format.html { redirect_to keys_url }
32   - format.js { render :nothing => true }
  32 + format.js { render nothing: true }
33 33 end
34 34 end
35 35 end
... ...
app/controllers/merge_requests_controller.rb
... ... @@ -2,9 +2,9 @@ class MergeRequestsController &lt; ApplicationController
2 2 before_filter :authenticate_user!
3 3 before_filter :project
4 4 before_filter :module_enabled
5   - before_filter :merge_request, :only => [:edit, :update, :destroy, :show, :commits, :diffs, :automerge, :automerge_check, :raw]
6   - before_filter :validates_merge_request, :only => [:show, :diffs, :raw]
7   - before_filter :define_show_vars, :only => [:show, :diffs]
  5 + before_filter :merge_request, only: [:edit, :update, :destroy, :show, :commits, :diffs, :automerge, :automerge_check, :raw]
  6 + before_filter :validates_merge_request, only: [:show, :diffs, :raw]
  7 + before_filter :define_show_vars, only: [:show, :diffs]
8 8 layout "project"
9 9  
10 10 # Authorize
... ... @@ -14,13 +14,13 @@ class MergeRequestsController &lt; ApplicationController
14 14 before_filter :authorize_read_merge_request!
15 15  
16 16 # Allow write(create) merge_request
17   - before_filter :authorize_write_merge_request!, :only => [:new, :create]
  17 + before_filter :authorize_write_merge_request!, only: [:new, :create]
18 18  
19 19 # Allow modify merge_request
20   - before_filter :authorize_modify_merge_request!, :only => [:close, :edit, :update, :sort]
  20 + before_filter :authorize_modify_merge_request!, only: [:close, :edit, :update, :sort]
21 21  
22 22 # Allow destroy merge_request
23   - before_filter :authorize_admin_merge_request!, :only => [:destroy]
  23 + before_filter :authorize_admin_merge_request!, only: [:destroy]
24 24  
25 25  
26 26 def index
... ... @@ -66,7 +66,7 @@ class MergeRequestsController &lt; ApplicationController
66 66 end
67 67  
68 68 def update
69   - if @merge_request.update_attributes(params[:merge_request].merge(:author_id_of_changes => current_user.id))
  69 + if @merge_request.update_attributes(params[:merge_request].merge(author_id_of_changes: current_user.id))
70 70 @merge_request.reload_code
71 71 @merge_request.mark_as_unchecked
72 72 redirect_to [@project, @merge_request], notice: 'Merge request was successfully updated.'
... ... @@ -79,7 +79,7 @@ class MergeRequestsController &lt; ApplicationController
79 79 if @merge_request.unchecked?
80 80 @merge_request.check_if_can_be_merged
81 81 end
82   - render :json => {:state => @merge_request.human_state}
  82 + render json: {state: @merge_request.human_state}
83 83 end
84 84  
85 85 def automerge
... ... @@ -138,7 +138,7 @@ class MergeRequestsController &lt; ApplicationController
138 138  
139 139 def define_show_vars
140 140 # Build a note object for comment form
141   - @note = @project.notes.new(:noteable => @merge_request)
  141 + @note = @project.notes.new(noteable: @merge_request)
142 142  
143 143 # Get commits from repository
144 144 # or from cache if already merged
... ...
app/controllers/milestones_controller.rb
... ... @@ -2,7 +2,7 @@ class MilestonesController &lt; ApplicationController
2 2 before_filter :authenticate_user!
3 3 before_filter :project
4 4 before_filter :module_enabled
5   - before_filter :milestone, :only => [:edit, :update, :destroy, :show]
  5 + before_filter :milestone, only: [:edit, :update, :destroy, :show]
6 6 layout "project"
7 7  
8 8 # Authorize
... ... @@ -12,7 +12,7 @@ class MilestonesController &lt; ApplicationController
12 12 before_filter :authorize_read_milestone!
13 13  
14 14 # Allow admin milestone
15   - before_filter :authorize_admin_milestone!, :except => [:index, :show]
  15 + before_filter :authorize_admin_milestone!, except: [:index, :show]
16 16  
17 17 respond_to :html
18 18  
... ... @@ -77,7 +77,7 @@ class MilestonesController &lt; ApplicationController
77 77  
78 78 respond_to do |format|
79 79 format.html { redirect_to project_milestones_path }
80   - format.js { render :nothing => true }
  80 + format.js { render nothing: true }
81 81 end
82 82 end
83 83  
... ...
app/controllers/notes_controller.rb
... ... @@ -5,7 +5,7 @@ class NotesController &lt; ApplicationController
5 5 before_filter :add_project_abilities
6 6  
7 7 before_filter :authorize_read_note!
8   - before_filter :authorize_write_note!, :only => [:create]
  8 + before_filter :authorize_write_note!, only: [:create]
9 9  
10 10 respond_to :js
11 11  
... ... @@ -29,12 +29,12 @@ class NotesController &lt; ApplicationController
29 29 @note.destroy
30 30  
31 31 respond_to do |format|
32   - format.js { render :nothing => true }
  32 + format.js { render nothing: true }
33 33 end
34 34 end
35 35  
36 36 def preview
37   - render :text => view_context.markdown(params[:note])
  37 + render text: view_context.markdown(params[:note])
38 38 end
39 39  
40 40 protected
... ...
app/controllers/profile_controller.rb
... ... @@ -26,7 +26,7 @@ class ProfileController &lt; ApplicationController
26 26 flash[:notice] = "Password was successfully updated. Please login with it"
27 27 redirect_to new_user_session_path
28 28 else
29   - render :action => "password"
  29 + render action: "password"
30 30 end
31 31 end
32 32  
... ...
app/controllers/projects_controller.rb
1 1 require File.join(Rails.root, 'lib', 'graph_commit')
2 2  
3 3 class ProjectsController < ApplicationController
4   - before_filter :project, :except => [:index, :new, :create]
  4 + before_filter :project, except: [:index, :new, :create]
5 5 layout :determine_layout
6 6  
7 7 # Authorize
8 8 before_filter :add_project_abilities
9   - before_filter :authorize_read_project!, :except => [:index, :new, :create]
10   - before_filter :authorize_admin_project!, :only => [:edit, :update, :destroy]
11   - before_filter :require_non_empty_project, :only => [:blob, :tree, :graph]
  9 + before_filter :authorize_read_project!, except: [:index, :new, :create]
  10 + before_filter :authorize_admin_project!, only: [:edit, :update, :destroy]
  11 + before_filter :require_non_empty_project, only: [:blob, :tree, :graph]
12 12  
13 13 def new
14 14 @project = Project.new
... ... @@ -35,7 +35,7 @@ class ProjectsController &lt; ApplicationController
35 35 def update
36 36 respond_to do |format|
37 37 if project.update_attributes(params[:project])
38   - format.html { redirect_to edit_project_path(project), :notice => 'Project was successfully updated.' }
  38 + format.html { redirect_to edit_project_path(project), notice: 'Project was successfully updated.' }
39 39 format.js
40 40 else
41 41 format.html { render action: "edit" }
... ...
app/controllers/protected_branches_controller.rb
... ... @@ -6,7 +6,7 @@ class ProtectedBranchesController &lt; ApplicationController
6 6 before_filter :authorize_read_project!
7 7 before_filter :require_non_empty_project
8 8  
9   - before_filter :authorize_admin_project!, :only => [:destroy, :create]
  9 + before_filter :authorize_admin_project!, only: [:destroy, :create]
10 10 before_filter :render_full_content
11 11  
12 12 layout "project"
... ... @@ -26,7 +26,7 @@ class ProtectedBranchesController &lt; ApplicationController
26 26  
27 27 respond_to do |format|
28 28 format.html { redirect_to project_protected_branches_path }
29   - format.js { render :nothing => true }
  29 + format.js { render nothing: true }
30 30 end
31 31 end
32 32 end
... ...
app/controllers/refs_controller.rb
... ... @@ -9,7 +9,7 @@ class RefsController &lt; ApplicationController
9 9 before_filter :require_non_empty_project
10 10  
11 11 before_filter :ref
12   - before_filter :define_tree_vars, :only => [:tree, :blob, :blame, :logs_tree]
  12 + before_filter :define_tree_vars, only: [:tree, :blob, :blame, :logs_tree]
13 13 before_filter :render_full_content
14 14  
15 15 layout "project"
... ... @@ -20,7 +20,7 @@ class RefsController &lt; ApplicationController
20 20 new_path = if params[:destination] == "tree"
21 21 tree_project_ref_path(@project, params[:ref])
22 22 else
23   - project_commits_path(@project, :ref => params[:ref])
  23 + project_commits_path(@project, ref: params[:ref])
24 24 end
25 25  
26 26 redirect_to new_path
... ... @@ -53,8 +53,8 @@ class RefsController &lt; ApplicationController
53 53 last_commit = @project.commits(@commit.id, file, 1).last
54 54 last_commit = CommitDecorator.decorate(last_commit)
55 55 {
56   - :file_name => content.name,
57   - :commit => last_commit
  56 + file_name: content.name,
  57 + commit: last_commit
58 58 }
59 59 end
60 60 end
... ... @@ -70,9 +70,9 @@ class RefsController &lt; ApplicationController
70 70  
71 71 send_data(
72 72 @tree.data,
73   - :type => mime_type,
74   - :disposition => 'inline',
75   - :filename => @tree.name
  73 + type: mime_type,
  74 + disposition: 'inline',
  75 + filename: @tree.name
76 76 )
77 77 else
78 78 head(404)
... ...
app/controllers/search_controller.rb
... ... @@ -8,8 +8,8 @@ class SearchController &lt; ApplicationController
8 8  
9 9 if query.present?
10 10 @projects = current_user.projects.search(query).limit(10)
11   - @merge_requests = MergeRequest.where(:project_id => current_user.project_ids).search(query).limit(10)
12   - @issues = Issue.where(:project_id => current_user.project_ids).search(query).limit(10)
  11 + @merge_requests = MergeRequest.where(project_id: current_user.project_ids).search(query).limit(10)
  12 + @issues = Issue.where(project_id: current_user.project_ids).search(query).limit(10)
13 13 end
14 14 end
15 15 end
... ...
app/controllers/snippets_controller.rb
1 1 class SnippetsController < ApplicationController
2 2 before_filter :authenticate_user!
3 3 before_filter :project
4   - before_filter :snippet, :only => [:show, :edit, :destroy, :update, :raw]
  4 + before_filter :snippet, only: [:show, :edit, :destroy, :update, :raw]
5 5 layout "project"
6 6  
7 7 # Authorize
... ... @@ -11,13 +11,13 @@ class SnippetsController &lt; ApplicationController
11 11 before_filter :authorize_read_snippet!
12 12  
13 13 # Allow write(create) snippet
14   - before_filter :authorize_write_snippet!, :only => [:new, :create]
  14 + before_filter :authorize_write_snippet!, only: [:new, :create]
15 15  
16 16 # Allow modify snippet
17   - before_filter :authorize_modify_snippet!, :only => [:edit, :update]
  17 + before_filter :authorize_modify_snippet!, only: [:edit, :update]
18 18  
19 19 # Allow destroy snippet
20   - before_filter :authorize_admin_snippet!, :only => [:destroy]
  20 + before_filter :authorize_admin_snippet!, only: [:destroy]
21 21  
22 22 respond_to :html
23 23  
... ... @@ -55,7 +55,7 @@ class SnippetsController &lt; ApplicationController
55 55 end
56 56  
57 57 def show
58   - @note = @project.notes.new(:noteable => @snippet)
  58 + @note = @project.notes.new(noteable: @snippet)
59 59 render_full_content
60 60 end
61 61  
... ... @@ -70,9 +70,9 @@ class SnippetsController &lt; ApplicationController
70 70 def raw
71 71 send_data(
72 72 @snippet.content,
73   - :type => "text/plain",
74   - :disposition => 'inline',
75   - :filename => @snippet.file_name
  73 + type: "text/plain",
  74 + disposition: 'inline',
  75 + filename: @snippet.file_name
76 76 )
77 77 end
78 78  
... ...
app/controllers/team_members_controller.rb
... ... @@ -5,7 +5,7 @@ class TeamMembersController &lt; ApplicationController
5 5 # Authorize
6 6 before_filter :add_project_abilities
7 7 before_filter :authorize_read_project!
8   - before_filter :authorize_admin_project!, :except => [:show]
  8 + before_filter :authorize_admin_project!, except: [:show]
9 9  
10 10 def show
11 11 @team_member = project.users_projects.find(params[:id])
... ... @@ -41,7 +41,7 @@ class TeamMembersController &lt; ApplicationController
41 41  
42 42 respond_to do |format|
43 43 format.html { redirect_to team_project_path(@project) }
44   - format.js { render :nothing => true }
  44 + format.js { render nothing: true }
45 45 end
46 46 end
47 47 end
... ...
app/controllers/wikis_controller.rb
... ... @@ -2,8 +2,8 @@ class WikisController &lt; ApplicationController
2 2 before_filter :project
3 3 before_filter :add_project_abilities
4 4 before_filter :authorize_read_wiki!
5   - before_filter :authorize_write_wiki!, :only => [:edit, :create, :history]
6   - before_filter :authorize_admin_wiki!, :only => :destroy
  5 + before_filter :authorize_write_wiki!, only: [:edit, :create, :history]
  6 + before_filter :authorize_admin_wiki!, only: :destroy
7 7 layout "project"
8 8  
9 9 def pages
... ... @@ -14,16 +14,16 @@ class WikisController &lt; ApplicationController
14 14 if params[:old_page_id]
15 15 @wiki = @project.wikis.find(params[:old_page_id])
16 16 else
17   - @wiki = @project.wikis.where(:slug => params[:id]).order("created_at").last
  17 + @wiki = @project.wikis.where(slug: params[:id]).order("created_at").last
18 18 end
19 19  
20   - @note = @project.notes.new(:noteable => @wiki)
  20 + @note = @project.notes.new(noteable: @wiki)
21 21  
22 22 if @wiki
23 23 render 'show'
24 24 else
25 25 if can?(current_user, :write_wiki, @project)
26   - @wiki = @project.wikis.new(:slug => params[:id])
  26 + @wiki = @project.wikis.new(slug: params[:id])
27 27 render 'edit'
28 28 else
29 29 render 'empty'
... ... @@ -32,7 +32,7 @@ class WikisController &lt; ApplicationController
32 32 end
33 33  
34 34 def edit
35   - @wiki = @project.wikis.where(:slug => params[:id]).order("created_at").last
  35 + @wiki = @project.wikis.where(slug: params[:id]).order("created_at").last
36 36 @wiki = Wiki.regenerate_from @wiki
37 37 end
38 38  
... ... @@ -50,11 +50,11 @@ class WikisController &lt; ApplicationController
50 50 end
51 51  
52 52 def history
53   - @wikis = @project.wikis.where(:slug => params[:id]).order("created_at")
  53 + @wikis = @project.wikis.where(slug: params[:id]).order("created_at")
54 54 end
55 55  
56 56 def destroy
57   - @wikis = @project.wikis.where(:slug => params[:id]).delete_all
  57 + @wikis = @project.wikis.where(slug: params[:id]).delete_all
58 58  
59 59 respond_to do |format|
60 60 format.html { redirect_to project_wiki_path(@project, :index), notice: "Page was successfully deleted" }
... ...
app/decorators/application_decorator.rb
... ... @@ -15,7 +15,7 @@ class ApplicationDecorator &lt; Drapper::Base
15 15 #
16 16 # def formatted_timestamp(time)
17 17 # h.content_tag :span, time.strftime("%a %m/%d/%y"),
18   - # :class => 'timestamp'
  18 + # class: 'timestamp'
19 19 # end
20 20 #
21 21 # def created_at
... ...
app/decorators/event_decorator.rb
... ... @@ -19,7 +19,7 @@ class EventDecorator &lt; ApplicationDecorator
19 19 elsif self.merge_request?
20 20 h.project_merge_request_url(self.project, self.merge_request)
21 21 elsif self.push?
22   - h.project_commits_url(self.project, :ref => self.ref_name)
  22 + h.project_commits_url(self.project, ref: self.ref_name)
23 23 end
24 24 end
25 25 end
... ...
app/decorators/tree_decorator.rb
... ... @@ -8,14 +8,14 @@ class TreeDecorator &lt; ApplicationDecorator
8 8  
9 9 #parts = parts[0...-1] if is_blob?
10 10  
11   - yield(h.link_to("..", "#", :remote => :true)) if parts.count > max_links
  11 + yield(h.link_to("..", "#", remote: :true)) if parts.count > max_links
12 12  
13 13 parts.each do |part|
14 14 part_path = File.join(part_path, part) unless part_path.empty?
15 15 part_path = part if part_path.empty?
16 16  
17 17 next unless parts.last(2).include?(part) if parts.count > max_links
18   - yield(h.link_to(h.truncate(part, :length => 40), h.tree_file_project_ref_path(project, ref, :path => part_path), :remote => :true))
  18 + yield(h.link_to(h.truncate(part, length: 40), h.tree_file_project_ref_path(project, ref, path: part_path), remote: :true))
19 19 end
20 20 end
21 21 end
... ... @@ -30,7 +30,7 @@ class TreeDecorator &lt; ApplicationDecorator
30 30 end
31 31  
32 32 def history_path
33   - h.project_commits_path(project, :path => path, :ref => ref)
  33 + h.project_commits_path(project, path: path, ref: ref)
34 34 end
35 35  
36 36 def mb_size
... ...
app/helpers/application_helper.rb
... ... @@ -43,23 +43,23 @@ module ApplicationHelper
43 43 end
44 44  
45 45 def search_autocomplete_source
46   - projects = current_user.projects.map{ |p| { :label => p.name, :url => project_path(p) } }
  46 + projects = current_user.projects.map{ |p| { label: p.name, url: project_path(p) } }
47 47 default_nav = [
48   - { :label => "Profile", :url => profile_path },
49   - { :label => "Keys", :url => keys_path },
50   - { :label => "Dashboard", :url => root_path },
51   - { :label => "Admin", :url => admin_root_path }
  48 + { label: "Profile", url: profile_path },
  49 + { label: "Keys", url: keys_path },
  50 + { label: "Dashboard", url: root_path },
  51 + { label: "Admin", url: admin_root_path }
52 52 ]
53 53  
54 54 project_nav = []
55 55  
56 56 if @project && !@project.new_record?
57 57 project_nav = [
58   - { :label => "#{@project.name} / Issues", :url => project_issues_path(@project) },
59   - { :label => "#{@project.name} / Wall", :url => wall_project_path(@project) },
60   - { :label => "#{@project.name} / Tree", :url => tree_project_ref_path(@project, @project.root_ref) },
61   - { :label => "#{@project.name} / Commits", :url => project_commits_path(@project) },
62   - { :label => "#{@project.name} / Team", :url => team_project_path(@project) }
  58 + { label: "#{@project.name} / Issues", url: project_issues_path(@project) },
  59 + { label: "#{@project.name} / Wall", url: wall_project_path(@project) },
  60 + { label: "#{@project.name} / Tree", url: tree_project_ref_path(@project, @project.root_ref) },
  61 + { label: "#{@project.name} / Commits", url: project_commits_path(@project) },
  62 + { label: "#{@project.name} / Team", url: team_project_path(@project) }
63 63 ]
64 64 end
65 65  
... ... @@ -89,7 +89,7 @@ module ApplicationHelper
89 89 when :wall; wall_tab?
90 90 when :wiki; controller.controller_name == "wikis"
91 91 when :issues; issues_tab?
92   - when :network; current_page?(:controller => "projects", :action => "graph", :id => @project)
  92 + when :network; current_page?(controller: "projects", action: "graph", id: @project)
93 93 when :merge_requests; controller.controller_name == "merge_requests"
94 94  
95 95 # Dashboard Area
... ... @@ -100,10 +100,10 @@ module ApplicationHelper
100 100 when :root; current_page?(dashboard_path) || current_page?(root_path)
101 101  
102 102 # Profile Area
103   - when :profile; current_page?(:controller => "profile", :action => :show)
104   - when :password; current_page?(:controller => "profile", :action => :password)
105   - when :token; current_page?(:controller => "profile", :action => :token)
106   - when :design; current_page?(:controller => "profile", :action => :design)
  103 + when :profile; current_page?(controller: "profile", action: :show)
  104 + when :password; current_page?(controller: "profile", action: :password)
  105 + when :token; current_page?(controller: "profile", action: :token)
  106 + when :design; current_page?(controller: "profile", action: :design)
107 107 when :ssh_keys; controller.controller_name == "keys"
108 108  
109 109 # Admin Area
... ...
app/helpers/gitlab_markdown_helper.rb
... ... @@ -28,32 +28,32 @@ module GitlabMarkdownHelper
28 28  
29 29 # team member: @foo
30 30 when /^@/
31   - user = @project.users.where(:name => user_name).first
32   - member = @project.users_projects.where(:user_id => user).first if user
33   - link_to("@#{user_name}", project_team_member_path(@project, member), html_options.merge(:class => "gfm gfm-team_member #{html_options[:class]}")) if member
  31 + user = @project.users.where(name: user_name).first
  32 + member = @project.users_projects.where(user_id: user).first if user
  33 + link_to("@#{user_name}", project_team_member_path(@project, member), html_options.merge(class: "gfm gfm-team_member #{html_options[:class]}")) if member
34 34  
35 35 # issue: #123
36 36 when /^#/
37 37 # avoid HTML entities
38 38 unless prefix.try(:end_with?, "&") && suffix.try(:start_with?, ";")
39   - issue = @project.issues.where(:id => issue_id).first
40   - link_to("##{issue_id}", project_issue_path(@project, issue), html_options.merge(:title => "Issue: #{issue.title}", :class => "gfm gfm-issue #{html_options[:class]}")) if issue
  39 + issue = @project.issues.where(id: issue_id).first
  40 + link_to("##{issue_id}", project_issue_path(@project, issue), html_options.merge(title: "Issue: #{issue.title}", class: "gfm gfm-issue #{html_options[:class]}")) if issue
41 41 end
42 42  
43 43 # merge request: !123
44 44 when /^!/
45   - merge_request = @project.merge_requests.where(:id => merge_request_id).first
46   - link_to("!#{merge_request_id}", project_merge_request_path(@project, merge_request), html_options.merge(:title => "Merge Request: #{merge_request.title}", :class => "gfm gfm-merge_request #{html_options[:class]}")) if merge_request
  45 + merge_request = @project.merge_requests.where(id: merge_request_id).first
  46 + link_to("!#{merge_request_id}", project_merge_request_path(@project, merge_request), html_options.merge(title: "Merge Request: #{merge_request.title}", class: "gfm gfm-merge_request #{html_options[:class]}")) if merge_request
47 47  
48 48 # snippet: $123
49 49 when /^\$/
50   - snippet = @project.snippets.where(:id => snippet_id).first
51   - link_to("$#{snippet_id}", project_snippet_path(@project, snippet), html_options.merge(:title => "Snippet: #{snippet.title}", :class => "gfm gfm-snippet #{html_options[:class]}")) if snippet
  50 + snippet = @project.snippets.where(id: snippet_id).first
  51 + link_to("$#{snippet_id}", project_snippet_path(@project, snippet), html_options.merge(title: "Snippet: #{snippet.title}", class: "gfm gfm-snippet #{html_options[:class]}")) if snippet
52 52  
53 53 # commit: 123456...
54 54 when /^\h/
55 55 commit = @project.commit(commit_id)
56   - link_to(commit_id, project_commit_path(@project, :id => commit.id), html_options.merge(:title => "Commit: #{commit.author_name} - #{CommitDecorator.new(commit).title}", :class => "gfm gfm-commit #{html_options[:class]}")) if commit
  56 + link_to(commit_id, project_commit_path(@project, id: commit.id), html_options.merge(title: "Commit: #{commit.author_name} - #{CommitDecorator.new(commit).title}", class: "gfm gfm-commit #{html_options[:class]}")) if commit
57 57  
58 58 end # case
59 59  
... ...
app/helpers/issues_helper.rb
... ... @@ -9,7 +9,7 @@ module IssuesHelper
9 9  
10 10 tm = project.team_member_by_id(issue.assignee_id)
11 11 if tm
12   - link_to issue.assignee_name, project_team_member_path(project, tm), :class => "author_link"
  12 + link_to issue.assignee_name, project_team_member_path(project, tm), class: "author_link"
13 13 else
14 14 issue.assignee_name
15 15 end
... ... @@ -20,7 +20,7 @@ module IssuesHelper
20 20  
21 21 tm = project.team_member_by_id(issue.author_id)
22 22 if tm
23   - link_to issue.author_name, project_team_member_path(project, tm), :class => "author_link"
  23 + link_to issue.author_name, project_team_member_path(project, tm), class: "author_link"
24 24 else
25 25 issue.author_name
26 26 end
... ...
app/helpers/merge_requests_helper.rb
... ... @@ -4,7 +4,7 @@ module MergeRequestsHelper
4 4  
5 5 tm = project.team_member_by_id(merge_request.assignee_id)
6 6 if tm
7   - link_to merge_request.assignee_name, project_team_member_path(project, tm), :class => "author_link"
  7 + link_to merge_request.assignee_name, project_team_member_path(project, tm), class: "author_link"
8 8 else
9 9 merge_request.assignee_name
10 10 end
... ... @@ -15,7 +15,7 @@ module MergeRequestsHelper
15 15  
16 16 tm = project.team_member_by_id(merge_request.author_id)
17 17 if tm
18   - link_to merge_request.author_name, project_team_member_path(project, tm), :class => "author_link"
  18 + link_to merge_request.author_name, project_team_member_path(project, tm), class: "author_link"
19 19 else
20 20 merge_request.author_name
21 21 end
... ... @@ -24,10 +24,10 @@ module MergeRequestsHelper
24 24 def new_mr_path_from_push_event(event)
25 25 new_project_merge_request_path(
26 26 event.project,
27   - :merge_request => {
28   - :source_branch => event.branch_name,
29   - :target_branch => event.project.root_ref,
30   - :title => event.branch_name.titleize
  27 + merge_request: {
  28 + source_branch: event.branch_name,
  29 + target_branch: event.project.root_ref,
  30 + title: event.branch_name.titleize
31 31 }
32 32 )
33 33 end
... ...
app/helpers/tab_helper.rb
... ... @@ -4,12 +4,12 @@ module TabHelper
4 4 end
5 5  
6 6 def wall_tab?
7   - current_page?(:controller => "projects", :action => "wall", :id => @project)
  7 + current_page?(controller: "projects", action: "wall", id: @project)
8 8 end
9 9  
10 10 def project_tab_class
11 11 [:show, :files, :team, :edit, :update].each do |action|
12   - return "current" if current_page?(:controller => "projects", :action => action, :id => @project)
  12 + return "current" if current_page?(controller: "projects", action: action, id: @project)
13 13 end
14 14  
15 15 if ['snippets', 'hooks', 'deploy_keys', 'team_members'].include? controller.controller_name
... ...
app/mailers/notify.rb
... ... @@ -12,20 +12,20 @@ class Notify &lt; ActionMailer::Base
12 12 def new_user_email(user_id, password)
13 13 @user = User.find(user_id)
14 14 @password = password
15   - mail(:to => @user.email, :subject => "gitlab | Account was created for you")
  15 + mail(to: @user.email, subject: "gitlab | Account was created for you")
16 16 end
17 17  
18 18 def new_issue_email(issue_id)
19 19 @issue = Issue.find(issue_id)
20 20 @project = @issue.project
21   - mail(:to => @issue.assignee_email, :subject => "gitlab | new issue ##{@issue.id} | #{@issue.title} | #{@project.name}")
  21 + mail(to: @issue.assignee_email, subject: "gitlab | new issue ##{@issue.id} | #{@issue.title} | #{@project.name}")
22 22 end
23 23  
24 24 def note_wall_email(recipient_id, note_id)
25 25 recipient = User.find(recipient_id)
26 26 @note = Note.find(note_id)
27 27 @project = @note.project
28   - mail(:to => recipient.email, :subject => "gitlab | #{@project.name}")
  28 + mail(to: recipient.email, subject: "gitlab | #{@project.name}")
29 29 end
30 30  
31 31 def note_commit_email(recipient_id, note_id)
... ... @@ -34,7 +34,7 @@ class Notify &lt; ActionMailer::Base
34 34 @commit = @note.target
35 35 @commit = CommitDecorator.decorate(@commit)
36 36 @project = @note.project
37   - mail(:to => recipient.email, :subject => "gitlab | note for commit #{@commit.short_id} | #{@commit.title} | #{@project.name}")
  37 + mail(to: recipient.email, subject: "gitlab | note for commit #{@commit.short_id} | #{@commit.title} | #{@project.name}")
38 38 end
39 39  
40 40 def note_merge_request_email(recipient_id, note_id)
... ... @@ -42,7 +42,7 @@ class Notify &lt; ActionMailer::Base
42 42 @note = Note.find(note_id)
43 43 @merge_request = @note.noteable
44 44 @project = @note.project
45   - mail(:to => recipient.email, :subject => "gitlab | note for merge request !#{@merge_request.id} | #{@project.name}")
  45 + mail(to: recipient.email, subject: "gitlab | note for merge request !#{@merge_request.id} | #{@project.name}")
46 46 end
47 47  
48 48 def note_issue_email(recipient_id, note_id)
... ... @@ -50,7 +50,7 @@ class Notify &lt; ActionMailer::Base
50 50 @note = Note.find(note_id)
51 51 @issue = @note.noteable
52 52 @project = @note.project
53   - mail(:to => recipient.email, :subject => "gitlab | note for issue ##{@issue.id} | #{@project.name}")
  53 + mail(to: recipient.email, subject: "gitlab | note for issue ##{@issue.id} | #{@project.name}")
54 54 end
55 55  
56 56 def note_wiki_email(recipient_id, note_id)
... ... @@ -58,13 +58,13 @@ class Notify &lt; ActionMailer::Base
58 58 @note = Note.find(note_id)
59 59 @wiki = @note.noteable
60 60 @project = @note.project
61   - mail(:to => recipient.email, :subject => "gitlab | note for wiki | #{@project.name}")
  61 + mail(to: recipient.email, subject: "gitlab | note for wiki | #{@project.name}")
62 62 end
63 63  
64 64 def new_merge_request_email(merge_request_id)
65 65 @merge_request = MergeRequest.find(merge_request_id)
66 66 @project = @merge_request.project
67   - mail(:to => @merge_request.assignee_email, :subject => "gitlab | new merge request !#{@merge_request.id} | #{@merge_request.title} | #{@project.name}")
  67 + mail(to: @merge_request.assignee_email, subject: "gitlab | new merge request !#{@merge_request.id} | #{@merge_request.title} | #{@project.name}")
68 68 end
69 69  
70 70 def reassigned_merge_request_email(recipient_id, merge_request_id, previous_assignee_id)
... ... @@ -72,7 +72,7 @@ class Notify &lt; ActionMailer::Base
72 72 @merge_request = MergeRequest.find(merge_request_id)
73 73 @previous_assignee ||= User.find(previous_assignee_id)
74 74 @project = @merge_request.project
75   - mail(:to => recipient.email, :subject => "gitlab | changed merge request !#{@merge_request.id} | #{@merge_request.title} | #{@project.name}")
  75 + mail(to: recipient.email, subject: "gitlab | changed merge request !#{@merge_request.id} | #{@merge_request.title} | #{@project.name}")
76 76 end
77 77  
78 78 def reassigned_issue_email(recipient_id, issue_id, previous_assignee_id)
... ... @@ -80,6 +80,6 @@ class Notify &lt; ActionMailer::Base
80 80 @issue = Issue.find(issue_id)
81 81 @previous_assignee ||= User.find(previous_assignee_id)
82 82 @project = @issue.project
83   - mail(:to => recipient.email, :subject => "gitlab | changed issue ##{@issue.id} | #{@issue.title} | #{@project.name}")
  83 + mail(to: recipient.email, subject: "gitlab | changed issue ##{@issue.id} | #{@issue.title} | #{@project.name}")
84 84 end
85 85 end
... ...
app/models/commit.rb
... ... @@ -20,7 +20,7 @@ class Commit
20 20 :tree,
21 21 :id,
22 22 :to_patch,
23   - :to => :commit
  23 + to: :commit
24 24  
25 25  
26 26 class << self
... ... @@ -57,7 +57,7 @@ class Commit
57 57  
58 58 def commits_since(repo, date)
59 59 commits = repo.heads.map do |h|
60   - repo.log(h.name, nil, :since => date).each { |c| Commit.new(c, h) }
  60 + repo.log(h.name, nil, since: date).each { |c| Commit.new(c, h) }
61 61 end.flatten.uniq { |c| c.id }
62 62  
63 63 commits.sort! do |x, y|
... ... @@ -69,7 +69,7 @@ class Commit
69 69  
70 70 def commits(repo, ref, path = nil, limit = nil, offset = nil)
71 71 if path
72   - repo.log(ref, path, :max_count => limit, :skip => offset)
  72 + repo.log(ref, path, max_count: limit, skip: offset)
73 73 elsif limit && offset
74 74 repo.commits(ref, limit, offset)
75 75 else
... ... @@ -86,9 +86,9 @@ class Commit
86 86 last = project.commit(from.try(:strip))
87 87  
88 88 result = {
89   - :commits => [],
90   - :diffs => [],
91   - :commit => nil
  89 + commits: [],
  90 + diffs: [],
  91 + commit: nil
92 92 }
93 93  
94 94 if first && last
... ...
app/models/event.rb
... ... @@ -12,13 +12,13 @@ class Event &lt; ActiveRecord::Base
12 12 Merged = 7
13 13  
14 14 belongs_to :project
15   - belongs_to :target, :polymorphic => true
  15 + belongs_to :target, polymorphic: true
16 16  
17 17 # For Hash only
18 18 serialize :data
19 19  
20 20 scope :recent, order("created_at DESC")
21   - scope :code_push, where(:action => Pushed)
  21 + scope :code_push, where(action: Pushed)
22 22  
23 23 def self.determine_action(record)
24 24 if [Issue, MergeRequest].include? record.class
... ... @@ -29,7 +29,7 @@ class Event &lt; ActiveRecord::Base
29 29 end
30 30  
31 31 def self.recent_for_user user
32   - where(:project_id => user.projects.map(&:id)).recent
  32 + where(project_id: user.projects.map(&:id)).recent
33 33 end
34 34  
35 35 # Next events currently enabled for system
... ... @@ -106,9 +106,9 @@ class Event &lt; ActiveRecord::Base
106 106 end
107 107 end
108 108  
109   - delegate :name, :email, :to => :author, :prefix => true, :allow_nil => true
110   - delegate :title, :to => :issue, :prefix => true, :allow_nil => true
111   - delegate :title, :to => :merge_request, :prefix => true, :allow_nil => true
  109 + delegate :name, :email, to: :author, prefix: true, allow_nil: true
  110 + delegate :title, to: :issue, prefix: true, allow_nil: true
  111 + delegate :title, to: :merge_request, prefix: true, allow_nil: true
112 112 end
113 113 # == Schema Information
114 114 #
... ...
app/models/issue.rb
... ... @@ -7,7 +7,7 @@ class Issue &lt; ActiveRecord::Base
7 7 belongs_to :milestone
8 8  
9 9 validates :description,
10   - :length => { :within => 0..2000 }
  10 + length: { within: 0..2000 }
11 11  
12 12 acts_as_list
13 13  
... ...
app/models/key.rb
... ... @@ -6,16 +6,16 @@ class Key &lt; ActiveRecord::Base
6 6 belongs_to :project
7 7  
8 8 validates :title,
9   - :presence => true,
10   - :length => { :within => 0..255 }
  9 + presence: true,
  10 + length: { within: 0..255 }
11 11  
12 12 validates :key,
13   - :presence => true,
14   - :length => { :within => 0..5000 }
  13 + presence: true,
  14 + length: { within: 0..5000 }
15 15  
16 16 before_save :set_identifier
17 17 before_validation :strip_white_space
18   - delegate :name, :email, :to => :user, :prefix => true
  18 + delegate :name, :email, to: :user, prefix: true
19 19 validate :unique_key
20 20  
21 21 def strip_white_space
... ... @@ -23,7 +23,7 @@ class Key &lt; ActiveRecord::Base
23 23 end
24 24  
25 25 def unique_key
26   - query = Key.where(:key => key)
  26 + query = Key.where(key: key)
27 27 query = query.where('(project_id IS NULL OR project_id = ?)', project_id) if project_id
28 28 if (query.count > 0)
29 29 errors.add :key, 'already exist.'
... ...
app/models/merge_request.rb
... ... @@ -20,7 +20,7 @@ class MergeRequest &lt; ActiveRecord::Base
20 20 validate :validate_branches
21 21  
22 22 def self.find_all_by_branch(branch_name)
23   - where("source_branch like :branch or target_branch like :branch", :branch => branch_name)
  23 + where("source_branch like :branch or target_branch like :branch", branch: branch_name)
24 24 end
25 25  
26 26 def human_state
... ... @@ -48,7 +48,7 @@ class MergeRequest &lt; ActiveRecord::Base
48 48 end
49 49  
50 50 def mark_as_unchecked
51   - self.update_attributes(:state => UNCHECKED)
  51 + self.update_attributes(state: UNCHECKED)
52 52 end
53 53  
54 54 def can_be_merged?
... ... @@ -101,11 +101,11 @@ class MergeRequest &lt; ActiveRecord::Base
101 101 end
102 102  
103 103 def merge_event
104   - self.project.events.where(:target_id => self.id, :target_type => "MergeRequest", :action => Event::Merged).last
  104 + self.project.events.where(target_id: self.id, target_type: "MergeRequest", action: Event::Merged).last
105 105 end
106 106  
107 107 def closed_event
108   - self.project.events.where(:target_id => self.id, :target_type => "MergeRequest", :action => Event::Closed).last
  108 + self.project.events.where(target_id: self.id, target_type: "MergeRequest", action: Event::Closed).last
109 109 end
110 110  
111 111 def commits
... ... @@ -128,7 +128,7 @@ class MergeRequest &lt; ActiveRecord::Base
128 128 end
129 129  
130 130 def mark_as_unmergable
131   - self.update_attributes :state => CANNOT_BE_MERGED
  131 + self.update_attributes state: CANNOT_BE_MERGED
132 132 end
133 133  
134 134 def reloaded_commits
... ... @@ -150,11 +150,11 @@ class MergeRequest &lt; ActiveRecord::Base
150 150 def merge!(user_id)
151 151 self.mark_as_merged!
152 152 Event.create(
153   - :project => self.project,
154   - :action => Event::Merged,
155   - :target_id => self.id,
156   - :target_type => "MergeRequest",
157   - :author_id => user_id
  153 + project: self.project,
  154 + action: Event::Merged,
  155 + target_id: self.id,
  156 + target_type: "MergeRequest",
  157 + author_id: user_id
158 158 )
159 159 end
160 160  
... ...
app/models/milestone.rb
... ... @@ -24,7 +24,7 @@ class Milestone &lt; ActiveRecord::Base
24 24 end
25 25  
26 26 def participants
27   - User.where(:id => issues.map(&:assignee_id))
  27 + User.where(id: issues.map(&:assignee_id))
28 28 end
29 29  
30 30 def percent_complete
... ...
app/models/note.rb
... ... @@ -3,18 +3,18 @@ require &#39;file_size_validator&#39;
3 3  
4 4 class Note < ActiveRecord::Base
5 5 belongs_to :project
6   - belongs_to :noteable, :polymorphic => true
  6 + belongs_to :noteable, polymorphic: true
7 7 belongs_to :author,
8   - :class_name => "User"
  8 + class_name: "User"
9 9  
10 10 delegate :name,
11   - :to => :project,
12   - :prefix => true
  11 + to: :project,
  12 + prefix: true
13 13  
14 14 delegate :name,
15 15 :email,
16   - :to => :author,
17   - :prefix => true
  16 + to: :author,
  17 + prefix: true
18 18  
19 19 attr_protected :author, :author_id
20 20 attr_accessor :notify
... ... @@ -23,19 +23,19 @@ class Note &lt; ActiveRecord::Base
23 23 validates_presence_of :project
24 24  
25 25 validates :note,
26   - :presence => true,
27   - :length => { :within => 0..5000 }
  26 + presence: true,
  27 + length: { within: 0..5000 }
28 28  
29 29 validates :attachment,
30   - :file_size => {
31   - :maximum => 10.megabytes.to_i
  30 + file_size: {
  31 + maximum: 10.megabytes.to_i
32 32 }
33 33  
34   - scope :common, where(:noteable_id => nil)
  34 + scope :common, where(noteable_id: nil)
35 35  
36   - scope :today, where("created_at >= :date", :date => Date.today)
37   - scope :last_week, where("created_at >= :date", :date => (Date.today - 7.days))
38   - scope :since, lambda { |day| where("created_at >= :date", :date => (day)) }
  36 + scope :today, where("created_at >= :date", date: Date.today)
  37 + scope :last_week, where("created_at >= :date", date: (Date.today - 7.days))
  38 + scope :since, lambda { |day| where("created_at >= :date", date: (day)) }
39 39 scope :fresh, order("created_at DESC")
40 40 scope :inc_author_project, includes(:project, :author)
41 41 scope :inc_author, includes(:author)
... ... @@ -43,11 +43,11 @@ class Note &lt; ActiveRecord::Base
43 43 mount_uploader :attachment, AttachmentUploader
44 44  
45 45 def self.create_status_change_note(noteable, author, status)
46   - create({ :noteable => noteable,
47   - :project => noteable.project,
48   - :author => author,
49   - :note => "_Status changed to #{status}_" },
50   - :without_protection => true)
  46 + create({ noteable: noteable,
  47 + project: noteable.project,
  48 + author: author,
  49 + note: "_Status changed to #{status}_" },
  50 + without_protection: true)
51 51 end
52 52  
53 53 def notify
... ...
app/models/project.rb
... ... @@ -9,19 +9,19 @@ class Project &lt; ActiveRecord::Base
9 9 #
10 10 # Relations
11 11 #
12   - belongs_to :owner, :class_name => "User"
13   - has_many :users, :through => :users_projects
14   - has_many :events, :dependent => :destroy
15   - has_many :merge_requests, :dependent => :destroy
16   - has_many :issues, :dependent => :destroy, :order => "closed, created_at DESC"
17   - has_many :milestones, :dependent => :destroy
18   - has_many :users_projects, :dependent => :destroy
19   - has_many :notes, :dependent => :destroy
20   - has_many :snippets, :dependent => :destroy
21   - has_many :deploy_keys, :dependent => :destroy, :foreign_key => "project_id", :class_name => "Key"
22   - has_many :hooks, :dependent => :destroy, :class_name => "ProjectHook"
23   - has_many :wikis, :dependent => :destroy
24   - has_many :protected_branches, :dependent => :destroy
  12 + belongs_to :owner, class_name: "User"
  13 + has_many :users, through: :users_projects
  14 + has_many :events, dependent: :destroy
  15 + has_many :merge_requests, dependent: :destroy
  16 + has_many :issues, dependent: :destroy, order: "closed, created_at DESC"
  17 + has_many :milestones, dependent: :destroy
  18 + has_many :users_projects, dependent: :destroy
  19 + has_many :notes, dependent: :destroy
  20 + has_many :snippets, dependent: :destroy
  21 + has_many :deploy_keys, dependent: :destroy, foreign_key: "project_id", class_name: "Key"
  22 + has_many :hooks, dependent: :destroy, class_name: "ProjectHook"
  23 + has_many :wikis, dependent: :destroy
  24 + has_many :protected_branches, dependent: :destroy
25 25  
26 26 attr_accessor :error_code
27 27  
... ... @@ -33,15 +33,15 @@ class Project &lt; ActiveRecord::Base
33 33 #
34 34 # Scopes
35 35 #
36   - scope :public_only, where(:private_flag => false)
37   - scope :without_user, lambda { |user| where("id not in (:ids)", :ids => user.projects.map(&:id) ) }
  36 + scope :public_only, where(private_flag: false)
  37 + scope :without_user, lambda { |user| where("id not in (:ids)", ids: user.projects.map(&:id) ) }
38 38  
39 39 def self.active
40 40 joins(:issues, :notes, :merge_requests).order("issues.created_at, notes.created_at, merge_requests.created_at DESC")
41 41 end
42 42  
43 43 def self.search query
44   - where("name like :query or code like :query or path like :query", :query => "%#{query}%")
  44 + where("name like :query or code like :query or path like :query", query: "%#{query}%")
45 45 end
46 46  
47 47 def self.create_by_user(params, user)
... ... @@ -53,7 +53,7 @@ class Project &lt; ActiveRecord::Base
53 53 project.save!
54 54  
55 55 # Add user as project master
56   - project.users_projects.create!(:project_access => UsersProject::MASTER, :user => user)
  56 + project.users_projects.create!(project_access: UsersProject::MASTER, user: user)
57 57  
58 58 # when project saved no team member exist so
59 59 # project repository should be updated after first user add
... ... @@ -82,28 +82,28 @@ class Project &lt; ActiveRecord::Base
82 82 # Validations
83 83 #
84 84 validates :name,
85   - :uniqueness => true,
86   - :presence => true,
87   - :length => { :within => 0..255 }
  85 + uniqueness: true,
  86 + presence: true,
  87 + length: { within: 0..255 }
88 88  
89 89 validates :path,
90   - :uniqueness => true,
91   - :presence => true,
92   - :format => { :with => /^[a-zA-Z][a-zA-Z0-9_\-\.]*$/,
93   - :message => "only letters, digits & '_' '-' '.' allowed. Letter should be first" },
94   - :length => { :within => 0..255 }
  90 + uniqueness: true,
  91 + presence: true,
  92 + format: { with: /^[a-zA-Z][a-zA-Z0-9_\-\.]*$/,
  93 + message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" },
  94 + length: { within: 0..255 }
95 95  
96 96 validates :description,
97   - :length => { :within => 0..2000 }
  97 + length: { within: 0..2000 }
98 98  
99 99 validates :code,
100   - :presence => true,
101   - :uniqueness => true,
102   - :format => { :with => /^[a-zA-Z][a-zA-Z0-9_\-\.]*$/,
103   - :message => "only letters, digits & '_' '-' '.' allowed. Letter should be first" },
104   - :length => { :within => 1..255 }
  100 + presence: true,
  101 + uniqueness: true,
  102 + format: { with: /^[a-zA-Z][a-zA-Z0-9_\-\.]*$/,
  103 + message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" },
  104 + length: { within: 1..255 }
105 105  
106   - validates :owner, :presence => true
  106 + validates :owner, presence: true
107 107 validate :check_limit
108 108 validate :repo_name
109 109  
... ... @@ -134,19 +134,19 @@ class Project &lt; ActiveRecord::Base
134 134 end
135 135  
136 136 def common_notes
137   - notes.where(:noteable_type => ["", nil]).inc_author_project
  137 + notes.where(noteable_type: ["", nil]).inc_author_project
138 138 end
139 139  
140 140 def build_commit_note(commit)
141   - notes.new(:noteable_id => commit.id, :noteable_type => "Commit")
  141 + notes.new(noteable_id: commit.id, noteable_type: "Commit")
142 142 end
143 143  
144 144 def commit_notes(commit)
145   - notes.where(:noteable_id => commit.id, :noteable_type => "Commit", :line_code => nil)
  145 + notes.where(noteable_id: commit.id, noteable_type: "Commit", line_code: nil)
146 146 end
147 147  
148 148 def commit_line_notes(commit)
149   - notes.where(:noteable_id => commit.id, :noteable_type => "Commit").where("line_code is not null")
  149 + notes.where(noteable_id: commit.id, noteable_type: "Commit").where("line_code is not null")
150 150 end
151 151  
152 152 def public?
... ...
app/models/snippet.rb
... ... @@ -2,29 +2,29 @@ class Snippet &lt; ActiveRecord::Base
2 2 include Linguist::BlobHelper
3 3  
4 4 belongs_to :project
5   - belongs_to :author, :class_name => "User"
6   - has_many :notes, :as => :noteable, :dependent => :destroy
  5 + belongs_to :author, class_name: "User"
  6 + has_many :notes, as: :noteable, dependent: :destroy
7 7  
8 8 delegate :name,
9 9 :email,
10   - :to => :author,
11   - :prefix => true
  10 + to: :author,
  11 + prefix: true
12 12 attr_protected :author, :author_id, :project, :project_id
13 13  
14 14 validates_presence_of :project_id
15 15 validates_presence_of :author_id
16 16  
17 17 validates :title,
18   - :presence => true,
19   - :length => { :within => 0..255 }
  18 + presence: true,
  19 + length: { within: 0..255 }
20 20  
21 21 validates :file_name,
22   - :presence => true,
23   - :length => { :within => 0..255 }
  22 + presence: true,
  23 + length: { within: 0..255 }
24 24  
25 25 validates :content,
26   - :presence => true,
27   - :length => { :within => 0..10000 }
  26 + presence: true,
  27 + length: { within: 0..10000 }
28 28  
29 29 scope :fresh, order("created_at DESC")
30 30 scope :non_expired, where(["expires_at IS NULL OR expires_at > ?", Time.current])
... ...
app/models/tree.rb
... ... @@ -11,7 +11,7 @@ class Tree
11 11 :size,
12 12 :text?,
13 13 :colorize,
14   - :to => :tree
  14 + to: :tree
15 15  
16 16 def initialize(raw_tree, project, ref = nil, path = nil)
17 17 @project, @ref, @path = project, ref, path,
... ...
app/models/user.rb
... ... @@ -11,58 +11,58 @@ class User &lt; ActiveRecord::Base
11 11  
12 12 attr_accessor :force_random_password
13 13  
14   - has_many :users_projects, :dependent => :destroy
15   - has_many :projects, :through => :users_projects
16   - has_many :my_own_projects, :class_name => "Project", :foreign_key => :owner_id
17   - has_many :keys, :dependent => :destroy
  14 + has_many :users_projects, dependent: :destroy
  15 + has_many :projects, through: :users_projects
  16 + has_many :my_own_projects, class_name: "Project", foreign_key: :owner_id
  17 + has_many :keys, dependent: :destroy
18 18  
19 19 has_many :events,
20   - :class_name => "Event",
21   - :foreign_key => :author_id,
22   - :dependent => :destroy
  20 + class_name: "Event",
  21 + foreign_key: :author_id,
  22 + dependent: :destroy
23 23  
24 24 has_many :recent_events,
25   - :class_name => "Event",
26   - :foreign_key => :author_id,
27   - :order => "id DESC"
  25 + class_name: "Event",
  26 + foreign_key: :author_id,
  27 + order: "id DESC"
28 28  
29 29 has_many :issues,
30   - :foreign_key => :author_id,
31   - :dependent => :destroy
  30 + foreign_key: :author_id,
  31 + dependent: :destroy
32 32  
33 33 has_many :notes,
34   - :foreign_key => :author_id,
35   - :dependent => :destroy
  34 + foreign_key: :author_id,
  35 + dependent: :destroy
36 36  
37 37 has_many :assigned_issues,
38   - :class_name => "Issue",
39   - :foreign_key => :assignee_id,
40   - :dependent => :destroy
  38 + class_name: "Issue",
  39 + foreign_key: :assignee_id,
  40 + dependent: :destroy
41 41  
42 42 has_many :merge_requests,
43   - :foreign_key => :author_id,
44   - :dependent => :destroy
  43 + foreign_key: :author_id,
  44 + dependent: :destroy
45 45  
46 46 has_many :assigned_merge_requests,
47   - :class_name => "MergeRequest",
48   - :foreign_key => :assignee_id,
49   - :dependent => :destroy
  47 + class_name: "MergeRequest",
  48 + foreign_key: :assignee_id,
  49 + dependent: :destroy
50 50  
51 51 validates :projects_limit,
52   - :presence => true,
53   - :numericality => {:greater_than_or_equal_to => 0}
  52 + presence: true,
  53 + numericality: {greater_than_or_equal_to: 0}
54 54  
55   - validates :bio, :length => { :within => 0..255 }
  55 + validates :bio, length: { within: 0..255 }
56 56  
57 57 before_save :ensure_authentication_token
58 58 alias_attribute :private_token, :authentication_token
59 59  
60   - scope :not_in_project, lambda { |project| where("id not in (:ids)", :ids => project.users.map(&:id) ) }
61   - scope :admins, where(:admin => true)
62   - scope :blocked, where(:blocked => true)
63   - scope :active, where(:blocked => false)
  60 + scope :not_in_project, lambda { |project| where("id not in (:ids)", ids: project.users.map(&:id) ) }
  61 + scope :admins, where(admin: true)
  62 + scope :blocked, where(blocked: true)
  63 + scope :active, where(blocked: false)
64 64  
65   - before_validation :generate_password, :on => :create
  65 + before_validation :generate_password, on: :create
66 66  
67 67 def generate_password
68 68 if self.force_random_password
... ... @@ -94,17 +94,17 @@ class User &lt; ActiveRecord::Base
94 94 else
95 95 password = Devise.friendly_token[0, 8].downcase
96 96 @user = User.create(
97   - :name => name,
98   - :email => email,
99   - :password => password,
100   - :password_confirmation => password,
101   - :projects_limit => Gitlab.config.default_projects_limit
  97 + name: name,
  98 + email: email,
  99 + password: password,
  100 + password_confirmation: password,
  101 + projects_limit: Gitlab.config.default_projects_limit
102 102 )
103 103 end
104 104 end
105 105  
106 106 def self.search query
107   - where("name like :query or email like :query", :query => "%#{query}%")
  107 + where("name like :query or email like :query", query: "%#{query}%")
108 108 end
109 109 end
110 110 # == Schema Information
... ...
app/models/users_project.rb
... ... @@ -12,18 +12,18 @@ class UsersProject &lt; ActiveRecord::Base
12 12 after_save :update_repository
13 13 after_destroy :update_repository
14 14  
15   - validates_uniqueness_of :user_id, :scope => [:project_id]
  15 + validates_uniqueness_of :user_id, scope: [:project_id]
16 16 validates_presence_of :user_id
17 17 validates_presence_of :project_id
18 18  
19   - delegate :name, :email, :to => :user, :prefix => true
  19 + delegate :name, :email, to: :user, prefix: true
20 20  
21 21 def self.bulk_import(project, user_ids, project_access)
22 22 UsersProject.transaction do
23 23 user_ids.each do |user_id|
24 24 users_project = UsersProject.new(
25   - :project_access => project_access,
26   - :user_id => user_id
  25 + project_access: project_access,
  26 + user_id: user_id
27 27 )
28 28 users_project.project = project
29 29 users_project.save
... ... @@ -35,7 +35,7 @@ class UsersProject &lt; ActiveRecord::Base
35 35 UsersProject.transaction do
36 36 project_ids.each do |project_id|
37 37 users_project = UsersProject.new(
38   - :project_access => project_access,
  38 + project_access: project_access,
39 39 )
40 40 users_project.project_id = project_id
41 41 users_project.user_id = user.id
... ...
app/models/wiki.rb
1 1 class Wiki < ActiveRecord::Base
2 2 belongs_to :project
3 3 belongs_to :user
4   - has_many :notes, :as => :noteable, :dependent => :destroy
  4 + has_many :notes, as: :noteable, dependent: :destroy
5 5  
6   - validates :content, :title, :user_id, :presence => true
7   - validates :title, :length => 1..250
  6 + validates :content, :title, :user_id, presence: true
  7 + validates :title, length: 1..250
8 8  
9 9 before_update :set_slug
10 10  
... ...
app/observers/activity_observer.rb
... ... @@ -3,22 +3,22 @@ class ActivityObserver &lt; ActiveRecord::Observer
3 3  
4 4 def after_create(record)
5 5 Event.create(
6   - :project => record.project,
7   - :target_id => record.id,
8   - :target_type => record.class.name,
9   - :action => Event.determine_action(record),
10   - :author_id => record.author_id
  6 + project: record.project,
  7 + target_id: record.id,
  8 + target_type: record.class.name,
  9 + action: Event.determine_action(record),
  10 + author_id: record.author_id
11 11 )
12 12 end
13 13  
14 14 def after_save(record)
15 15 if record.changed.include?("closed")
16 16 Event.create(
17   - :project => record.project,
18   - :target_id => record.id,
19   - :target_type => record.class.name,
20   - :action => (record.closed ? Event::Closed : Event::Reopened),
21   - :author_id => record.author_id_of_changes
  17 + project: record.project,
  18 + target_id: record.id,
  19 + target_type: record.class.name,
  20 + action: (record.closed ? Event::Closed : Event::Reopened),
  21 + author_id: record.author_id_of_changes
22 22 )
23 23 end
24 24 end
... ...
app/observers/mailer_observer.rb
... ... @@ -71,7 +71,7 @@ class MailerObserver &lt; ActiveRecord::Observer
71 71  
72 72 # Create comment about status changed
73 73 if target.closed_changed?
74   - note = Note.new(:noteable => target, :project => target.project)
  74 + note = Note.new(noteable: target, project: target.project)
75 75 note.author = current_user
76 76 note.note = "_Status changed to #{target.closed ? 'closed' : 'reopened'}_"
77 77 note.save()
... ...
app/roles/account.rb
... ... @@ -24,7 +24,7 @@ module Account
24 24 end
25 25  
26 26 def cared_merge_requests
27   - MergeRequest.where("author_id = :id or assignee_id = :id", :id => self.id).opened
  27 + MergeRequest.where("author_id = :id or assignee_id = :id", id: self.id).opened
28 28 end
29 29  
30 30 def project_ids
... ... @@ -50,7 +50,7 @@ module Account
50 50 def recent_push project_id = nil
51 51 # Get push events not earlier than 2 hours ago
52 52 events = recent_events.code_push.where("created_at > ?", Time.now - 2.hours)
53   - events = events.where(:project_id => project_id) if project_id
  53 + events = events.where(project_id: project_id) if project_id
54 54  
55 55 # Take only latest one
56 56 events = events.recent.limit(1).first
... ...
app/roles/authority.rb
... ... @@ -3,56 +3,56 @@ module Authority
3 3 # Should be rewrited for new access rights
4 4 def add_access(user, *access)
5 5 access = if access.include?(:admin)
6   - { :project_access => UsersProject::MASTER }
  6 + { project_access: UsersProject::MASTER }
7 7 elsif access.include?(:write)
8   - { :project_access => UsersProject::DEVELOPER }
  8 + { project_access: UsersProject::DEVELOPER }
9 9 else
10   - { :project_access => UsersProject::REPORTER }
  10 + { project_access: UsersProject::REPORTER }
11 11 end
12   - opts = { :user => user }
  12 + opts = { user: user }
13 13 opts.merge!(access)
14 14 users_projects.create(opts)
15 15 end
16 16  
17 17 def reset_access(user)
18   - users_projects.where(:project_id => self.id, :user_id => user.id).destroy if self.id
  18 + users_projects.where(project_id: self.id, user_id: user.id).destroy if self.id
19 19 end
20 20  
21 21 def repository_readers
22   - keys = Key.joins({:user => :users_projects}).
  22 + keys = Key.joins({user: :users_projects}).
23 23 where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::REPORTER)
24 24 keys.map(&:identifier) + deploy_keys.map(&:identifier)
25 25 end
26 26  
27 27 def repository_writers
28   - keys = Key.joins({:user => :users_projects}).
  28 + keys = Key.joins({user: :users_projects}).
29 29 where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::DEVELOPER)
30 30 keys.map(&:identifier)
31 31 end
32 32  
33 33 def repository_masters
34   - keys = Key.joins({:user => :users_projects}).
  34 + keys = Key.joins({user: :users_projects}).
35 35 where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::MASTER)
36 36 keys.map(&:identifier)
37 37 end
38 38  
39 39 def allow_read_for?(user)
40   - !users_projects.where(:user_id => user.id).empty?
  40 + !users_projects.where(user_id: user.id).empty?
41 41 end
42 42  
43 43 def guest_access_for?(user)
44   - !users_projects.where(:user_id => user.id).empty?
  44 + !users_projects.where(user_id: user.id).empty?
45 45 end
46 46  
47 47 def report_access_for?(user)
48   - !users_projects.where(:user_id => user.id, :project_access => [UsersProject::REPORTER, UsersProject::DEVELOPER, UsersProject::MASTER]).empty?
  48 + !users_projects.where(user_id: user.id, project_access: [UsersProject::REPORTER, UsersProject::DEVELOPER, UsersProject::MASTER]).empty?
49 49 end
50 50  
51 51 def dev_access_for?(user)
52   - !users_projects.where(:user_id => user.id, :project_access => [UsersProject::DEVELOPER, UsersProject::MASTER]).empty?
  52 + !users_projects.where(user_id: user.id, project_access: [UsersProject::DEVELOPER, UsersProject::MASTER]).empty?
53 53 end
54 54  
55 55 def master_access_for?(user)
56   - !users_projects.where(:user_id => user.id, :project_access => [UsersProject::MASTER]).empty? || owner_id == user.id
  56 + !users_projects.where(user_id: user.id, project_access: [UsersProject::MASTER]).empty? || owner_id == user.id
57 57 end
58 58 end
... ...
app/roles/issue_commonality.rb
... ... @@ -6,39 +6,39 @@ module IssueCommonality
6 6 attr_protected :author, :author_id, :project, :project_id
7 7  
8 8 belongs_to :project
9   - belongs_to :author, :class_name => "User"
10   - belongs_to :assignee, :class_name => "User"
11   - has_many :notes, :as => :noteable, :dependent => :destroy
  9 + belongs_to :author, class_name: "User"
  10 + belongs_to :assignee, class_name: "User"
  11 + has_many :notes, as: :noteable, dependent: :destroy
12 12  
13 13 validates_presence_of :project_id
14 14 validates_presence_of :author_id
15 15  
16 16 validates :title,
17   - :presence => true,
18   - :length => { :within => 0..255 }
  17 + presence: true,
  18 + length: { within: 0..255 }
19 19  
20 20  
21   - scope :opened, where(:closed => false)
22   - scope :closed, where(:closed => true)
23   - scope :assigned, lambda { |u| where(:assignee_id => u.id)}
  21 + scope :opened, where(closed: false)
  22 + scope :closed, where(closed: true)
  23 + scope :assigned, lambda { |u| where(assignee_id: u.id)}
24 24  
25 25 delegate :name,
26 26 :email,
27   - :to => :author,
28   - :prefix => true
  27 + to: :author,
  28 + prefix: true
29 29  
30 30 delegate :name,
31 31 :email,
32   - :to => :assignee,
33   - :allow_nil => true,
34   - :prefix => true
  32 + to: :assignee,
  33 + allow_nil: true,
  34 + prefix: true
35 35  
36 36 attr_accessor :author_id_of_changes
37 37 end
38 38  
39 39 module ClassMethods
40 40 def search(query)
41   - where("title like :query", :query => "%#{query}%")
  41 + where("title like :query", query: "%#{query}%")
42 42 end
43 43 end
44 44  
... ...
app/roles/project_push.rb
... ... @@ -3,10 +3,10 @@ module ProjectPush
3 3 data = post_receive_data(oldrev, newrev, ref, user)
4 4  
5 5 Event.create(
6   - :project => self,
7   - :action => Event::Pushed,
8   - :data => data,
9   - :author_id => data[:user_id]
  6 + project: self,
  7 + action: Event::Pushed,
  8 + data: data,
  9 + author_id: data[:user_id]
10 10 )
11 11 end
12 12  
... ... @@ -20,7 +20,7 @@ module ProjectPush
20 20 mrs.each { |merge_request| merge_request.reload_code; merge_request.mark_as_unchecked }
21 21  
22 22 # Close merge requests
23   - mrs = self.merge_requests.opened.where(:target_branch => branch_name).all
  23 + mrs = self.merge_requests.opened.where(target_branch: branch_name).all
24 24 mrs = mrs.select(&:last_commit).select { |mr| c_ids.include?(mr.last_commit.id) }
25 25 mrs.each { |merge_request| merge_request.merge!(user.id) }
26 26  
... ...
app/roles/ssh_key.rb
... ... @@ -9,7 +9,7 @@ module SshKey
9 9 def repository_delete_key
10 10 Gitlab::GitHost.system.new.configure do |c|
11 11 #delete key file is there is no identically deploy keys
12   - if !is_deploy_key || Key.where(:identifier => identifier).count() == 0
  12 + if !is_deploy_key || Key.where(identifier: identifier).count() == 0
13 13 c.delete_key(identifier)
14 14 end
15 15 c.update_projects(projects)
... ...
app/roles/team.rb
... ... @@ -25,8 +25,8 @@ module Team
25 25 # with passed access role by user id
26 26 def add_user_id_to_team(user_id, access_role)
27 27 users_projects.create(
28   - :user_id => user_id,
29   - :project_access => access_role
  28 + user_id: user_id,
  29 + project_access: access_role
30 30 )
31 31 end
32 32  
... ...
app/uploaders/attachment_uploader.rb
... ... @@ -23,7 +23,7 @@ class AttachmentUploader &lt; CarrierWave::Uploader::Base
23 23 # end
24 24  
25 25 # Process files as they are uploaded:
26   - # process :scale => [200, 300]
  26 + # process scale: [200, 300]
27 27 #
28 28 # def scale(width, height)
29 29 # # do something
... ... @@ -31,7 +31,7 @@ class AttachmentUploader &lt; CarrierWave::Uploader::Base
31 31  
32 32 # Create different versions of your uploaded files:
33 33 # version :thumb do
34   - # process :scale => [50, 50]
  34 + # process scale: [50, 50]
35 35 # end
36 36  
37 37 # Add a white list of extensions which are allowed to be uploaded.
... ...
app/views/admin/dashboard/index.html.haml
... ... @@ -5,11 +5,11 @@
5 5 Resque Workers
6 6 .data.padded
7 7 = link_to admin_resque_path do
8   - %h1{:class => @workers.present? ? "cgreen" : "cred"}
  8 + %h1{class: @workers.present? ? "cgreen" : "cred"}
9 9 = @workers.count
10 10 %hr
11 11 %p
12   - %strong{:class => @pending_jobs > 0 ? "cred" : "cgreen"}
  12 + %strong{class: @pending_jobs > 0 ? "cred" : "cgreen"}
13 13 #{@pending_jobs} post receive jobs waiting
14 14  
15 15 .span4
... ... @@ -19,7 +19,7 @@
19 19 = link_to admin_projects_path do
20 20 %h1= Project.count
21 21 %hr
22   - = link_to 'New Project', new_admin_project_path, :class => "btn small"
  22 + = link_to 'New Project', new_admin_project_path, class: "btn small"
23 23 .span4
24 24 .ui-box
25 25 %h5 Users
... ... @@ -27,7 +27,7 @@
27 27 = link_to admin_users_path do
28 28 %h1= User.count
29 29 %hr
30   - = link_to 'New User', new_admin_user_path, :class => "btn small"
  30 + = link_to 'New User', new_admin_user_path, class: "btn small"
31 31  
32 32  
33 33 .row
... ...
app/views/admin/hooks/index.html.haml
... ... @@ -3,9 +3,9 @@
3 3 Post receive hooks for binding events.
4 4 %br
5 5 Read more about system hooks
6   - %strong #{link_to "here", help_system_hooks_path, :class => "vlink"}
  6 + %strong #{link_to "here", help_system_hooks_path, class: "vlink"}
7 7  
8   -= form_for @hook, :as => :hook, :url => admin_hooks_path do |f|
  8 += form_for @hook, as: :hook, url: admin_hooks_path do |f|
9 9 -if @hook.errors.any?
10 10 .alert-message.block-message.error
11 11 - @hook.errors.full_messages.each do |msg|
... ... @@ -13,9 +13,9 @@
13 13 .clearfix
14 14 = f.label :url, "URL:"
15 15 .input
16   - = f.text_field :url, :class => "text_field xxlarge"
  16 + = f.text_field :url, class: "text_field xxlarge"
17 17 &nbsp;
18   - = f.submit "Add System Hook", :class => "btn primary"
  18 + = f.submit "Add System Hook", class: "btn primary"
19 19 %hr
20 20  
21 21 -if @hooks.any?
... ... @@ -33,7 +33,7 @@
33 33 %td
34 34 = link_to admin_hook_path(hook) do
35 35 %strong= hook.url
36   - = link_to 'Test Hook', admin_hook_test_path(hook), :class => "btn small right"
  36 + = link_to 'Test Hook', admin_hook_test_path(hook), class: "btn small right"
37 37 %td POST
38 38 %td
39   - = link_to 'Remove', admin_hook_path(hook), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn small right"
  39 + = link_to 'Remove', admin_hook_path(hook), confirm: 'Are you sure?', method: :delete, class: "danger btn small right"
... ...
app/views/admin/projects/_form.html.haml
... ... @@ -9,8 +9,8 @@
9 9 = f.label :name do
10 10 Project name is
11 11 .input
12   - = f.text_field :name, :placeholder => "Example Project", :class => "xxlarge"
13   - = f.submit project.new_record? ? 'Create project' : 'Save Project', :class => "btn primary"
  12 + = f.text_field :name, placeholder: "Example Project", class: "xxlarge"
  13 + = f.submit project.new_record? ? 'Create project' : 'Save Project', class: "btn primary"
14 14  
15 15 %hr
16 16 .alert.alert-info
... ... @@ -21,7 +21,7 @@
21 21 .input
22 22 .input-prepend
23 23 %span.add-on= Gitlab.config.ssh_path
24   - = f.text_field :path, :placeholder => "example_project", :disabled => !!project.id
  24 + = f.text_field :path, placeholder: "example_project", disabled: !!project.id
25 25 %span.add-on= ".git"
26 26 .clearfix
27 27 = f.label :code do
... ... @@ -29,7 +29,7 @@
29 29 .input
30 30 .input-prepend
31 31 %span.add-on= web_app_url
32   - = f.text_field :code, :placeholder => "example"
  32 + = f.text_field :code, placeholder: "example"
33 33  
34 34 - unless project.new_record?
35 35 .clearfix
... ... @@ -39,7 +39,7 @@
39 39 - if project.repo_exists?
40 40 .clearfix
41 41 = f.label :default_branch, "Default Branch"
42   - .input= f.select(:default_branch, project.heads.map(&:name), {}, :style => "width:210px;")
  42 + .input= f.select(:default_branch, project.heads.map(&:name), {}, style: "width:210px;")
43 43  
44 44 - unless project.new_record?
45 45 .alert.alert-info
... ... @@ -63,7 +63,7 @@
63 63  
64 64 - unless project.new_record?
65 65 .actions
66   - = f.submit 'Save Project', :class => "btn primary"
  66 + = f.submit 'Save Project', class: "btn primary"
67 67  
68 68  
69 69  
... ...
app/views/admin/projects/edit.html.haml
1 1 %h3.page_title #{@admin_project.name} &rarr; Edit project
2 2 %hr
3   -= render 'form', :project => @admin_project
  3 += render 'form', project: @admin_project
... ...
app/views/admin/projects/index.html.haml
1 1 %h3
2 2 Projects
3   - = link_to 'New Project', new_admin_project_path, :class => "btn small right"
  3 + = link_to 'New Project', new_admin_project_path, class: "btn small right"
4 4 %br
5   -= form_tag admin_projects_path, :method => :get do
6   - = text_field_tag :name, params[:name], :class => "xlarge"
7   - = submit_tag "Search", :class => "btn submit primary"
  5 += form_tag admin_projects_path, method: :get do
  6 + = text_field_tag :name, params[:name], class: "xlarge"
  7 + = submit_tag "Search", class: "btn submit primary"
8 8  
9 9 %table.admin-table
10 10 %thead
... ... @@ -21,8 +21,8 @@
21 21 %td= link_to project.name, [:admin, project]
22 22 %td= project.path
23 23 %td= project.users_projects.count
24   - %td= check_box_tag :post_receive_file, 1, project.has_post_receive_file?, :disabled => true
  24 + %td= check_box_tag :post_receive_file, 1, project.has_post_receive_file?, disabled: true
25 25 %td= last_commit(project)
26   - %td= link_to 'Edit', edit_admin_project_path(project), :id => "edit_#{dom_id(project)}", :class => "btn small"
27   - %td.bgred= link_to 'Destroy', [:admin, project], :confirm => "REMOVE #{project.name}? Are you sure?", :method => :delete, :class => "btn small danger"
28   -= paginate @admin_projects, :theme => "admin"
  26 + %td= link_to 'Edit', edit_admin_project_path(project), id: "edit_#{dom_id(project)}", class: "btn small"
  27 + %td.bgred= link_to 'Destroy', [:admin, project], confirm: "REMOVE #{project.name}? Are you sure?", method: :delete, class: "btn small danger"
  28 += paginate @admin_projects, theme: "admin"
... ...
app/views/admin/projects/new.html.haml
1 1 %h3.page_title New project
2 2 %hr
3   -= render 'form', :project => @admin_project
  3 += render 'form', project: @admin_project
... ...
app/views/admin/projects/show.html.haml
1 1 %h3
2 2 = @admin_project.name
3   - = link_to 'Edit', edit_admin_project_path(@admin_project), :class => "btn right small"
  3 + = link_to 'Edit', edit_admin_project_path(@admin_project), class: "btn right small"
4 4  
5 5 %br
6 6 %table.zebra-striped.table-bordered
... ... @@ -33,7 +33,7 @@
33 33 %b
34 34 Post Receive File:
35 35 %td
36   - = check_box_tag :post_receive_file, 1, @admin_project.has_post_receive_file?, :disabled => true
  36 + = check_box_tag :post_receive_file, 1, @admin_project.has_post_receive_file?, disabled: true
37 37 %br
38 38 %h3
39 39 Team
... ... @@ -52,14 +52,14 @@
52 52 %tr
53 53 %td
54 54 = link_to tm.user_name, admin_user_path(tm.user)
55   - %td= select_tag :tm_project_access, options_for_select(Project.access_options, tm.project_access), :class => "medium project-access-select", :disabled => :disabled
56   - %td= link_to 'Edit Access', edit_admin_team_member_path(tm), :class => "btn small"
57   - %td= link_to 'Remove from team', admin_team_member_path(tm), :confirm => 'Are you sure?', :method => :delete, :class => "btn danger small"
  55 + %td= select_tag :tm_project_access, options_for_select(Project.access_options, tm.project_access), class: "medium project-access-select", disabled: :disabled
  56 + %td= link_to 'Edit Access', edit_admin_team_member_path(tm), class: "btn small"
  57 + %td= link_to 'Remove from team', admin_team_member_path(tm), confirm: 'Are you sure?', method: :delete, class: "btn danger small"
58 58  
59 59 %br
60 60 %h3 Add new team member
61 61 %br
62   -= form_tag team_update_admin_project_path(@admin_project), :class => "bulk_import", :method => :put do
  62 += form_tag team_update_admin_project_path(@admin_project), class: "bulk_import", method: :put do
63 63 %table.zebra-striped.table-bordered
64 64 %thead
65 65 %tr
... ... @@ -67,14 +67,14 @@
67 67 %th Project Access:
68 68  
69 69 %tr
70   - %td= select_tag :user_ids, options_from_collection_for_select(@users , :id, :name), :multiple => true
71   - %td= select_tag :project_access, options_for_select(Project.access_options), :class => "project-access-select"
  70 + %td= select_tag :user_ids, options_from_collection_for_select(@users , :id, :name), multiple: true
  71 + %td= select_tag :project_access, options_for_select(Project.access_options), class: "project-access-select"
72 72  
73 73 %tr
74   - %td= submit_tag 'Add', :class => "btn primary"
  74 + %td= submit_tag 'Add', class: "btn primary"
75 75 %td
76 76 Read more about project permissions
77   - %strong= link_to "here", help_permissions_path, :class => "vlink"
  77 + %strong= link_to "here", help_permissions_path, class: "vlink"
78 78  
79 79 :css
80 80 form select {
... ...
app/views/admin/resque/show.html.haml
1 1 %h3 Resque
2   -%iframe{:src => "/info/resque", :width => 1168, :height => 600, :style => "border: none"}
3 2 \ No newline at end of file
  3 +%iframe{src: "/info/resque", width: 1168, height: 600, style: "border: none"}
4 4 \ No newline at end of file
... ...
app/views/admin/team_members/_form.html.haml
1   -= form_for @admin_team_member, :as => :team_member, :url => admin_team_member_path(@admin_team_member) do |f|
  1 += form_for @admin_team_member, as: :team_member, url: admin_team_member_path(@admin_team_member) do |f|
2 2 -if @admin_team_member.errors.any?
3 3 .alert-message.block-message.error
4 4 %ul
... ... @@ -8,12 +8,12 @@
8 8 .clearfix
9 9 %label Project Access:
10 10 .input
11   - = f.select :project_access, options_for_select(Project.access_options, @admin_team_member.project_access), {}, :class => "project-access-select"
  11 + = f.select :project_access, options_for_select(Project.access_options, @admin_team_member.project_access), {}, class: "project-access-select"
12 12  
13 13 %br
14 14 .actions
15   - = f.submit 'Save', :class => "btn primary"
16   - = link_to 'Cancel', :back, :class => "btn"
  15 + = f.submit 'Save', class: "btn primary"
  16 + = link_to 'Cancel', :back, class: "btn"
17 17  
18 18 :css
19 19 form select {
... ...
app/views/admin/users/_form.html.haml
... ... @@ -22,17 +22,17 @@
22 22  
23 23 -if f.object.new_record?
24 24 .clearfix
25   - = f.label :admin, :class => "checkbox" do
  25 + = f.label :admin, class: "checkbox" do
26 26 = f.check_box :force_random_password, {}, true, nil
27 27 %span Generate random password
28 28  
29 29 %div.password-fields
30 30 .clearfix
31 31 = f.label :password
32   - .input= f.password_field :password, :disabled => f.object.force_random_password
  32 + .input= f.password_field :password, disabled: f.object.force_random_password
33 33 .clearfix
34 34 = f.label :password_confirmation
35   - .input= f.password_field :password_confirmation, :disabled => f.object.force_random_password
  35 + .input= f.password_field :password_confirmation, disabled: f.object.force_random_password
36 36 %hr
37 37 .clearfix
38 38 = f.label :skype
... ... @@ -46,27 +46,27 @@
46 46 .span6
47 47 .clearfix
48 48 = f.label :projects_limit
49   - .input= f.text_field :projects_limit, :class => "small_input"
  49 + .input= f.text_field :projects_limit, class: "small_input"
50 50  
51 51 .alert
52 52 .clearfix
53 53 %p Make the user a GitLab administrator.
54   - = f.label :admin, :class => "checkbox" do
  54 + = f.label :admin, class: "checkbox" do
55 55 = f.check_box :admin
56 56 %span Administrator
57 57 - unless @admin_user.new_record?
58 58 .alert.alert-error
59 59 - if @admin_user.blocked
60 60 %span
61   - = link_to 'Unblock', unblock_admin_user_path(@admin_user), :method => :put, :class => "btn small"
  61 + = link_to 'Unblock', unblock_admin_user_path(@admin_user), method: :put, class: "btn small"
62 62 This user is blocked and is not able to login to GitLab
63 63 - else
64 64 %span
65   - = link_to 'Block', block_admin_user_path(@admin_user), :confirm => 'USER WILL BE BLOCKED! Are you sure?', :method => :put, :class => "btn small danger"
  65 + = link_to 'Block', block_admin_user_path(@admin_user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn small danger"
66 66 Blocked users will be removed from all projects &amp; will not be able to login to GitLab.
67 67 .actions
68   - = f.submit 'Save', :class => "btn primary"
  68 + = f.submit 'Save', class: "btn primary"
69 69 - if @admin_user.new_record?
70   - = link_to 'Cancel', admin_users_path, :class => "btn"
  70 + = link_to 'Cancel', admin_users_path, class: "btn"
71 71 - else
72   - = link_to 'Cancel', admin_user_path(@admin_user), :class => "btn"
  72 + = link_to 'Cancel', admin_user_path(@admin_user), class: "btn"
... ...
app/views/admin/users/index.html.haml
1 1 %h3
2 2 Users
3   - = link_to 'New User', new_admin_user_path, :class => "btn small right"
  3 + = link_to 'New User', new_admin_user_path, class: "btn small right"
4 4 %br
5 5  
6   -= form_tag admin_users_path, :method => :get do
7   - = text_field_tag :name, params[:name], :class => "xlarge"
8   - = submit_tag "Search", :class => "btn submit primary"
  6 += form_tag admin_users_path, method: :get do
  7 + = text_field_tag :name, params[:name], class: "xlarge"
  8 + = submit_tag "Search", class: "btn submit primary"
9 9 %ul.nav.nav-pills
10   - %li{:class => "#{'active' unless params[:filter]}"}
  10 + %li{class: "#{'active' unless params[:filter]}"}
11 11 = link_to "Active", admin_users_path
12   - %li{:class => "#{'active' if params[:filter] == "admins"}"}
13   - = link_to admin_users_path(:filter => "admins") do
  12 + %li{class: "#{'active' if params[:filter] == "admins"}"}
  13 + = link_to admin_users_path(filter: "admins") do
14 14 Admins
15   - %li{:class => "#{'active' if params[:filter] == "blocked"}"}
16   - = link_to admin_users_path(:filter => "blocked") do
  15 + %li{class: "#{'active' if params[:filter] == "blocked"}"}
  16 + = link_to admin_users_path(filter: "blocked") do
17 17 Blocked
18   - %li{:class => "#{'active' if params[:filter] == "wop"}"}
19   - = link_to admin_users_path(:filter => "wop") do
  18 + %li{class: "#{'active' if params[:filter] == "wop"}"}
  19 + = link_to admin_users_path(filter: "wop") do
20 20 Without projects
21 21  
22 22 %table.admin-table
... ... @@ -31,16 +31,16 @@
31 31  
32 32 - @admin_users.each do |user|
33 33 %tr
34   - %td= check_box_tag "admin", 1, user.admin, :disabled => :disabled
  34 + %td= check_box_tag "admin", 1, user.admin, disabled: :disabled
35 35 %td= link_to user.name, [:admin, user]
36 36 %td= user.email
37 37 %td= user.users_projects.count
38   - %td= link_to 'Edit', edit_admin_user_path(user), :id => "edit_#{dom_id(user)}", :class => "btn small"
  38 + %td= link_to 'Edit', edit_admin_user_path(user), id: "edit_#{dom_id(user)}", class: "btn small"
39 39 %td
40 40 - if user.blocked
41   - = link_to 'Unblock', unblock_admin_user_path(user), :method => :put, :class => "btn small success"
  41 + = link_to 'Unblock', unblock_admin_user_path(user), method: :put, class: "btn small success"
42 42 - else
43   - = link_to 'Block', block_admin_user_path(user), :confirm => 'USER WILL BE BLOCKED! Are you sure?', :method => :put, :class => "btn small danger"
44   - %td.bgred= link_to 'Destroy', [:admin, user], :confirm => "USER #{user.name} WILL BE REMOVED! Are you sure?", :method => :delete, :class => "btn small danger"
  43 + = link_to 'Block', block_admin_user_path(user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn small danger"
  44 + %td.bgred= link_to 'Destroy', [:admin, user], confirm: "USER #{user.name} WILL BE REMOVED! Are you sure?", method: :delete, class: "btn small danger"
45 45  
46   -= paginate @admin_users, :theme => "admin"
  46 += paginate @admin_users, theme: "admin"
... ...
app/views/admin/users/show.html.haml
... ... @@ -4,7 +4,7 @@
4 4 %small Blocked
5 5 - if @admin_user.admin
6 6 %small Administrator
7   - = link_to 'Edit', edit_admin_user_path(@admin_user), :class => "btn small right"
  7 + = link_to 'Edit', edit_admin_user_path(@admin_user), class: "btn small right"
8 8  
9 9 %br
10 10  
... ... @@ -19,12 +19,12 @@
19 19 %td
20 20 %b
21 21 Admin:
22   - %td= check_box_tag "admin", 1, @admin_user.admin, :disabled => :disabled
  22 + %td= check_box_tag "admin", 1, @admin_user.admin, disabled: :disabled
23 23 %tr
24 24 %td
25 25 %b
26 26 Blocked:
27   - %td= check_box_tag "blocked", 1, @admin_user.blocked, :disabled => :disabled
  27 + %td= check_box_tag "blocked", 1, @admin_user.blocked, disabled: :disabled
28 28 %tr
29 29 %td
30 30 %b
... ... @@ -56,7 +56,7 @@
56 56 %br
57 57 %h3 Add User to Projects
58 58 %br
59   -= form_tag team_update_admin_user_path(@admin_user), :class => "bulk_import", :method => :put do
  59 += form_tag team_update_admin_user_path(@admin_user), class: "bulk_import", method: :put do
60 60 %table.table-bordered
61 61 %thead
62 62 %tr
... ... @@ -64,14 +64,14 @@
64 64 %th Project Access:
65 65  
66 66 %tr
67   - %td= select_tag :project_ids, options_from_collection_for_select(@projects , :id, :name), :multiple => true
68   - %td= select_tag :project_access, options_for_select(Project.access_options), :class => "project-access-select"
  67 + %td= select_tag :project_ids, options_from_collection_for_select(@projects , :id, :name), multiple: true
  68 + %td= select_tag :project_access, options_for_select(Project.access_options), class: "project-access-select"
69 69  
70 70 %tr
71   - %td= submit_tag 'Add', :class => "btn primary"
  71 + %td= submit_tag 'Add', class: "btn primary"
72 72 %td
73 73 Read more about project permissions
74   - %strong= link_to "here", help_permissions_path, :class => "vlink"
  74 + %strong= link_to "here", help_permissions_path, class: "vlink"
75 75 %br
76 76  
77 77 - if @admin_user.projects.present?
... ... @@ -90,9 +90,9 @@
90 90 - project = tm.project
91 91 %tr
92 92 %td= link_to project.name, admin_project_path(project)
93   - %td= select_tag :tm_project_access, options_for_select(Project.access_options, tm.project_access), :class => "medium project-access-select", :disabled => :disabled
94   - %td= link_to 'Edit Access', edit_admin_team_member_path(tm), :class => "btn small"
95   - %td= link_to 'Remove from team', admin_team_member_path(tm), :confirm => 'Are you sure?', :method => :delete, :class => "btn small danger"
  93 + %td= select_tag :tm_project_access, options_for_select(Project.access_options, tm.project_access), class: "medium project-access-select", disabled: :disabled
  94 + %td= link_to 'Edit Access', edit_admin_team_member_path(tm), class: "btn small"
  95 + %td= link_to 'Remove from team', admin_team_member_path(tm), confirm: 'Are you sure?', method: :delete, class: "btn small danger"
96 96  
97 97 :css
98 98 form select {
... ...
app/views/commits/_commit.html.haml
1 1 %li.commit
2 2 .browse_code_link_holder
3 3 %p
4   - %strong= link_to "Browse Code »", tree_project_ref_path(@project, commit.id), :class => "right"
  4 + %strong= link_to "Browse Code »", tree_project_ref_path(@project, commit.id), class: "right"
5 5 %p
6   - = link_to commit.short_id(8), project_commit_path(@project, :id => commit.id), :class => "commit_short_id"
  6 + = link_to commit.short_id(8), project_commit_path(@project, id: commit.id), class: "commit_short_id"
7 7 %strong.cgray= commit.author_name
8 8 &ndash;
9   - = image_tag gravatar_icon(commit.author_email), :class => "avatar", :width => 16
10   - = link_to_gfm truncate(commit.title, :length => 50), project_commit_path(@project, :id => commit.id), :class => "row_title"
  9 + = image_tag gravatar_icon(commit.author_email), class: "avatar", width: 16
  10 + = link_to_gfm truncate(commit.title, length: 50), project_commit_path(@project, id: commit.id), class: "row_title"
11 11  
12 12 %span.committed_ago
13 13 = time_ago_in_words(commit.committed_date)
... ...
app/views/commits/_commit_box.html.haml
... ... @@ -5,10 +5,10 @@
5 5 %span.btn.disabled.grouped
6 6 %i.icon-comment
7 7 = @notes_count
8   - = link_to patch_project_commit_path(@project, @commit.id), :class => "btn small grouped" do
  8 + = link_to patch_project_commit_path(@project, @commit.id), class: "btn small grouped" do
9 9 %i.icon-download-alt
10 10 Get Patch
11   - = link_to tree_project_ref_path(@project, @commit.id), :class => "browse-button primary grouped" do
  11 + = link_to tree_project_ref_path(@project, @commit.id), class: "browse-button primary grouped" do
12 12 %strong Browse Code »
13 13 %h3.commit-title.page_title
14 14 = gfm @commit.title
... ... @@ -18,7 +18,7 @@
18 18 .commit-info
19 19 .row
20 20 .span4
21   - = image_tag gravatar_icon(@commit.author_email, 40), :class => "avatar"
  21 + = image_tag gravatar_icon(@commit.author_email, 40), class: "avatar"
22 22 .author
23 23 %strong= @commit.author_name
24 24 authored
... ...
app/views/commits/_diff_head.html.haml
... ... @@ -3,24 +3,24 @@
3 3 %li
4 4 - if diff.deleted_file
5 5 %span.removed_file
6   - %a{:href => "##{diff.old_path}"}
  6 + %a{href: "##{diff.old_path}"}
7 7 = diff.old_path
8 8 = image_tag "diff_file_delete.png"
9 9 - elsif diff.renamed_file
10 10 %span.moved_file
11   - %a{:href => "##{diff.new_path}"}
  11 + %a{href: "##{diff.new_path}"}
12 12 = diff.old_path
13 13 = "->"
14 14 = diff.new_path
15 15 = image_tag "diff_file_notice.png"
16 16 - elsif diff.new_file
17 17 %span.new_file
18   - %a{:href => "##{diff.new_path}"}
  18 + %a{href: "##{diff.new_path}"}
19 19 = diff.new_path
20 20 = image_tag "diff_file_add.png"
21 21 - else
22 22 %span.edit_file
23   - %a{:href => "##{diff.new_path}"}
  23 + %a{href: "##{diff.new_path}"}
24 24 = diff.new_path
25 25 = image_tag "diff_file_info.png"
26 26  
... ...
app/views/commits/_diffs.html.haml
... ... @@ -5,12 +5,12 @@
5 5 %p To prevent performance issue we rejected diff information.
6 6 %p
7 7 But if you still want to see diff
8   - = link_to "click this link", project_commit_path(@project, @commit.id, :force_show_diff => true), :class => "dark"
  8 + = link_to "click this link", project_commit_path(@project, @commit.id, force_show_diff: true), class: "dark"
9 9  
10 10 %p.cgray
11 11 Showing #{pluralize(diffs.count, "changed file")}
12 12 .file_stats
13   - = render "commits/diff_head", :diffs => diffs
  13 + = render "commits/diff_head", diffs: diffs
14 14  
15 15 - unless @suppress_diff
16 16 - diffs.each_with_index do |diff, i|
... ... @@ -22,26 +22,26 @@
22 22 .diff_file_header
23 23 - if diff.deleted_file
24 24 %i.icon-file
25   - %span{:id => "#{diff.old_path}"}= diff.old_path
  25 + %span{id: "#{diff.old_path}"}= diff.old_path
26 26 - else
27 27 = link_to tree_file_project_ref_path(@project, @commit.id, diff.new_path) do
28 28 %i.icon-file
29   - %span{:id => "#{diff.new_path}"}= diff.new_path
  29 + %span{id: "#{diff.new_path}"}= diff.new_path
30 30 %br/
31 31 .diff_file_content
32 32 -# Skipp all non non-supported blobs
33 33 - next unless file.respond_to?('text?')
34 34  
35 35 - if file.text?
36   - = render "commits/text_file", :diff => diff, :index => i
  36 + = render "commits/text_file", diff: diff, index: i
37 37 - elsif file.image?
38 38 - if diff.renamed_file || diff.new_file || diff.deleted_file
39 39 .diff_file_content_image
40   - %img{:class => image_diff_class(diff), :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
  40 + %img{class: image_diff_class(diff), src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
41 41 - else
42 42 - old_file = (@commit.prev_commit.tree / diff.old_path)
43 43 .diff_file_content_image.img_compared
44   - %img{:class => "diff_image_removed", :src => "data:#{file.mime_type};base64,#{Base64.encode64(old_file.data)}"}
45   - %img{:class => "diff_image_added", :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
  44 + %img{class: "diff_image_removed", src: "data:#{file.mime_type};base64,#{Base64.encode64(old_file.data)}"}
  45 + %img{class: "diff_image_added", src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
46 46 - else
47 47 %p.nothing_here_message No preview for this file type
... ...
app/views/commits/_head.html.haml
1 1 %ul.nav.nav-tabs
2 2 %li
3   - = form_tag switch_project_refs_path(@project), :method => :get, :class => "project-refs-form" do
4   - = select_tag "ref", grouped_options_refs, :onchange => "$(this.form).trigger('submit');", :class => "project-refs-select"
  3 + = form_tag switch_project_refs_path(@project), method: :get, class: "project-refs-form" do
  4 + = select_tag "ref", grouped_options_refs, onchange: "$(this.form).trigger('submit');", class: "project-refs-select"
5 5 = hidden_field_tag :destination, "commits"
6 6  
7   - %li{:class => "#{'active' if current_page?(project_commits_path(@project)) }"}
  7 + %li{class: "#{'active' if current_page?(project_commits_path(@project)) }"}
8 8 = link_to project_commits_path(@project) do
9 9 Commits
10   - %li{:class => "#{'active' if current_page?(compare_project_commits_path(@project)) }"}
  10 + %li{class: "#{'active' if current_page?(compare_project_commits_path(@project)) }"}
11 11 = link_to compare_project_commits_path(@project) do
12 12 Compare
13   - %li{:class => "#{branches_tab_class}"}
  13 + %li{class: "#{branches_tab_class}"}
14 14 = link_to project_repository_path(@project) do
15 15 Branches
16 16 %span.badge= @project.repo.branch_count
17 17  
18   - %li{:class => "#{'active' if current_page?(tags_project_repository_path(@project)) }"}
  18 + %li{class: "#{'active' if current_page?(tags_project_repository_path(@project)) }"}
19 19 = link_to tags_project_repository_path(@project) do
20 20 Tags
21 21 %span.badge= @project.repo.tag_count
... ... @@ -24,8 +24,8 @@
24 24 - if current_page?(project_commits_path(@project)) && current_user.private_token
25 25 %li.right
26 26 %span.rss-icon
27   - = link_to project_commits_path(@project, :atom, { :private_token => current_user.private_token, :ref => @ref }), :title => "Feed" do
28   - = image_tag "rss_ui.png", :title => "feed"
  27 + = link_to project_commits_path(@project, :atom, { private_token: current_user.private_token, ref: @ref }), title: "Feed" do
  28 + = image_tag "rss_ui.png", title: "feed"
29 29  
30 30 :javascript
31 31 $(function(){
... ...
app/views/commits/_text_file.html.haml
... ... @@ -2,7 +2,7 @@
2 2 - if too_big
3 3 %a.supp_diff_link Diff suppressed. Click to show
4 4  
5   -%table{:class => "#{'hide' if too_big}"}
  5 +%table{class: "#{'hide' if too_big}"}
6 6 - each_diff_line(diff.diff.lines.to_a, index) do |line, type, line_code, line_new, line_old|
7 7 %tr.line_holder
8 8 - if type == "match"
... ... @@ -11,16 +11,16 @@
11 11 %td.line_content.matched= line
12 12 - else
13 13 %td.old_line
14   - = link_to raw(type == "new" ? "&nbsp;" : line_old), "##{line_code}", :id => line_code
  14 + = link_to raw(type == "new" ? "&nbsp;" : line_old), "##{line_code}", id: line_code
15 15 - if @comments_allowed
16   - = link_to "", "#", :class => "line_note_link", "line_code" => line_code, :title => "Add note for this line"
17   - %td.new_line= link_to raw(type == "old" ? "&nbsp;" : line_new) , "##{line_code}", :id => line_code
18   - %td.line_content{:class => "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line} &nbsp;"
  16 + = link_to "", "#", class: "line_note_link", "line_code" => line_code, title: "Add note for this line"
  17 + %td.new_line= link_to raw(type == "old" ? "&nbsp;" : line_new) , "##{line_code}", id: line_code
  18 + %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line} &nbsp;"
19 19  
20 20 - if @comments_allowed
21 21 - comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at).reverse
22 22 - unless comments.empty?
23 23 - comments.each_with_index do |note, i|
24   - = render "notes/reply_button", :line_code => line_code if i.zero?
25   - = render "notes/per_line_show", :note => note
  24 + = render "notes/reply_button", line_code: line_code if i.zero?
  25 + = render "notes/per_line_show", note: note
26 26 - @line_notes.reject!{ |n| n == note }
... ...
app/views/commits/compare.html.haml
... ... @@ -14,13 +14,13 @@
14 14  
15 15 %br
16 16  
17   - = form_tag compare_project_commits_path(@project), :method => :get do
  17 + = form_tag compare_project_commits_path(@project), method: :get do
18 18 .clearfix
19   - = text_field_tag :from, params[:from], :placeholder => "master", :class => "xlarge"
  19 + = text_field_tag :from, params[:from], placeholder: "master", class: "xlarge"
20 20 = "..."
21   - = text_field_tag :to, params[:to], :placeholder => "aa8b4ef", :class => "xlarge"
  21 + = text_field_tag :to, params[:to], placeholder: "aa8b4ef", class: "xlarge"
22 22 .actions
23   - = submit_tag "Compare", :class => "btn btn-primary"
  23 + = submit_tag "Compare", class: "btn btn-primary"
24 24  
25 25  
26 26 - unless @commits.empty?
... ... @@ -30,7 +30,7 @@
30 30  
31 31 - unless @diffs.empty?
32 32 %h4 Diff
33   - = render "commits/diffs", :diffs => @diffs
  33 + = render "commits/diffs", diffs: @diffs
34 34  
35 35 :javascript
36 36 $(function() {
... ...
app/views/commits/index.html.haml
... ... @@ -9,12 +9,12 @@
9 9 %span.divider
10 10 \/
11 11 %li
12   - %a{:href => "#"}= params[:path].split("/").join(" / ")
  12 + %a{href: "#"}= params[:path].split("/").join(" / ")
13 13  
14   -%div{:id => dom_id(@project)}
  14 +%div{id: dom_id(@project)}
15 15 #commits_list= render "commits"
16 16 .clear
17   -.loading{ :style => "display:none;"}
  17 +.loading{ style: "display:none;"}
18 18  
19 19 - if @commits.count == @limit
20 20 :javascript
... ...
app/views/commits/index.js.haml
1 1 :plain
2   - CommitsList.append(#{@commits.count}, "#{escape_javascript(render(:partial => 'commits/commits'))}");
  2 + CommitsList.append(#{@commits.count}, "#{escape_javascript(render(partial: 'commits/commits'))}");
3 3  
... ...
app/views/commits/show.html.haml
1 1 = render "commits/commit_box"
2   -= render "commits/diffs", :diffs => @commit.diffs
3   -= render "notes/notes", :tid => @commit.id, :tt => "commit"
  2 += render "commits/diffs", diffs: @commit.diffs
  3 += render "notes/notes", tid: @commit.id, tt: "commit"
4 4 = render "notes/per_line_form"
5 5  
6 6  
... ...
app/views/dashboard/index.html.haml
... ... @@ -6,7 +6,7 @@
6 6 %span
7 7 You wont be able to pull/push project code unless you
8 8 %strong
9   - = link_to new_key_path, :class => "vlink" do
  9 + = link_to new_key_path, class: "vlink" do
10 10 add new key
11 11 to your profile
12 12 - if @events.any?
... ... @@ -15,7 +15,7 @@
15 15 %h4.nothing_here_message Projects activity will be displayed here
16 16 .loading.hide
17 17 .side
18   - = render "events/event_last_push", :event => @last_push
  18 + = render "events/event_last_push", event: @last_push
19 19 .projects_box
20 20 %h5
21 21 Projects
... ... @@ -23,23 +23,23 @@
23 23 (#{@projects.total_count})
24 24 - if current_user.can_create_project?
25 25 %span.right
26   - = link_to new_project_path, :class => "btn very_small info" do
  26 + = link_to new_project_path, class: "btn very_small info" do
27 27 %i.icon-plus
28 28 New Project
29 29 - @projects.each do |project|
30   - = link_to project_path(project), :class => dom_class(project) do
  30 + = link_to project_path(project), class: dom_class(project) do
31 31 %h4
32 32 %span.ico.project
33   - = truncate(project.name, :length => 25)
  33 + = truncate(project.name, length: 25)
34 34 %span.right
35 35 &rarr;
36   - .bottom= paginate @projects, :theme => "gitlab"
  36 + .bottom= paginate @projects, theme: "gitlab"
37 37  
38 38 %hr
39 39 %div
40 40 %span.rss-icon
41   - = link_to dashboard_path(:atom, { :private_token => current_user.private_token }) do
42   - = image_tag "rss_ui.png", :title => "feed"
  41 + = link_to dashboard_path(:atom, { private_token: current_user.private_token }) do
  42 + = image_tag "rss_ui.png", title: "feed"
43 43 %strong News Feed
44 44  
45 45 - else
... ... @@ -51,7 +51,7 @@
51 51 = current_user.projects_limit
52 52 projects. Click on button below to add a new one
53 53 .link_holder
54   - = link_to new_project_path, :class => "btn primary" do
  54 + = link_to new_project_path, class: "btn primary" do
55 55 New Project »
56 56 - else
57 57 If you will be added to project - it will be displayed here
... ...
app/views/dashboard/issues.html.haml
... ... @@ -12,8 +12,8 @@
12 12 %h5= @project.name
13 13 %ul.unstyled.issues_table
14 14 - group[1].each do |issue|
15   - = render(:partial => 'issues/show', :locals => {:issue => issue})
  15 + = render(partial: 'issues/show', locals: {issue: issue})
16 16 %hr
17   - = paginate @issues, :theme => "gitlab"
  17 + = paginate @issues, theme: "gitlab"
18 18 - else
19 19 %h3.nothing_here_message Nothing to show here
... ...
app/views/dashboard/merge_requests.html.haml
... ... @@ -10,9 +10,9 @@
10 10 - @project = group[0]
11 11 %h5= @project.name
12 12 - group[1].each do |merge_request|
13   - = render(:partial => 'merge_requests/merge_request', :locals => {:merge_request => merge_request})
  13 + = render(partial: 'merge_requests/merge_request', locals: {merge_request: merge_request})
14 14 %hr
15   - = paginate @merge_requests, :theme => "gitlab"
  15 + = paginate @merge_requests, theme: "gitlab"
16 16  
17 17 - else
18 18 %h3.nothing_here_message Nothing to show here
... ...
app/views/deploy_keys/_form.html.haml
1 1 %div
2   - = form_for [@project, @key], :url => project_deploy_keys_path do |f|
  2 + = form_for [@project, @key], url: project_deploy_keys_path do |f|
3 3 -if @key.errors.any?
4 4 .alert-message.block-message.error
5 5 %ul
... ... @@ -11,8 +11,8 @@
11 11 .input= f.text_field :title
12 12 .clearfix
13 13 = f.label :key
14   - .input= f.text_area :key, :class => "xlarge"
  14 + .input= f.text_area :key, class: "xlarge"
15 15 .actions
16   - = f.submit 'Save', :class => "primary btn"
17   - = link_to "Cancel", project_deploy_keys_path(@project), :class => "btn"
  16 + = f.submit 'Save', class: "primary btn"
  17 + = link_to "Cancel", project_deploy_keys_path(@project), class: "btn"
18 18  
... ...
app/views/deploy_keys/_show.html.haml
1 1 %tr
2 2 %td
3   - %a{:href => project_deploy_key_path(key.project, key)}
  3 + %a{href: project_deploy_key_path(key.project, key)}
4 4 %strong= key.title
5 5 %td
6 6 %span.update-author
... ... @@ -8,5 +8,5 @@
8 8 = time_ago_in_words(key.created_at)
9 9 ago
10 10 %td
11   - = link_to 'Remove', project_deploy_key_path(key.project, key), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn delete-key small right"
  11 + = link_to 'Remove', project_deploy_key_path(key.project, key), confirm: 'Are you sure?', method: :delete, class: "danger btn delete-key small right"
12 12  
... ...
app/views/deploy_keys/index.html.haml
... ... @@ -2,10 +2,10 @@
2 2 - if can? current_user, :admin_project, @project
3 3 .alert-message.block-message
4 4 Deploy keys allow read-only access to repository.
5   - = link_to new_project_deploy_key_path(@project), :class => "btn small", :title => "New Deploy Key" do
  5 + = link_to new_project_deploy_key_path(@project), class: "btn small", title: "New Deploy Key" do
6 6 Add Deploy Key
7 7  
8 8 - if @keys.any?
9 9 %table
10 10 - @keys.each do |key|
11   - = render(:partial => 'show', :locals => {:key => key})
  11 + = render(partial: 'show', locals: {key: key})
... ...
app/views/deploy_keys/show.html.haml
... ... @@ -3,5 +3,5 @@
3 3 %hr
4 4 %pre= @key.key
5 5 .actions
6   - = link_to 'Remove', project_deploy_key_path(@key.project, @key), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn delete-key"
  6 + = link_to 'Remove', project_deploy_key_path(@key.project, @key), confirm: 'Are you sure?', method: :delete, class: "danger btn delete-key"
7 7 .clear
... ...
app/views/devise/passwords/edit.html.haml
1   -= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, :class => "login-box" }) do |f|
2   - = image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo"
  1 += form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put, class: "login-box" }) do |f|
  2 + = image_tag "login-logo.png", width: "304", height: "66", class: "login-logo", alt: "Login Logo"
3 3 %h3 Change your password
4 4 = devise_error_messages!
5 5 = f.hidden_field :reset_password_token
6 6 %div
7   - = f.password_field :password, :class => "text top", :placeholder => "New password"
  7 + = f.password_field :password, class: "text top", placeholder: "New password"
8 8 %div
9   - = f.password_field :password_confirmation, :class => "text bottom", :placeholder => "Confirm new password"
  9 + = f.password_field :password_confirmation, class: "text bottom", placeholder: "Confirm new password"
10 10 %div
11   - = f.submit "Change my password", :class => "btn primary"
12   - .right= render :partial => "devise/shared/links"
  11 + = f.submit "Change my password", class: "btn primary"
  12 + .right= render partial: "devise/shared/links"
... ...
app/views/errors/access_denied.html.haml
... ... @@ -2,4 +2,4 @@
2 2 %h3 Access Denied
3 3 %hr
4 4 %p Youre not allowed to access this page
5   - %p Read more about project permissions #{link_to "here", help_permissions_path, :class => "vlink"}
  5 + %p Read more about project permissions #{link_to "here", help_permissions_path, class: "vlink"}
... ...
app/views/events/_commit.html.haml
1 1 - commit = CommitDecorator.decorate(commit)
2 2 %li.wll.commit
3 3 %p
4   - = link_to commit.short_id(8), project_commit_path(project, :id => commit.id), :class => "commit_short_id"
  4 + = link_to commit.short_id(8), project_commit_path(project, id: commit.id), class: "commit_short_id"
5 5 %strong.cdark= commit.author_name
6 6 &ndash;
7   - = image_tag gravatar_icon(commit.author_email), :class => "avatar", :width => 16
8   - = gfm truncate(commit.title, :length => 50), project_commit_path(project, :id => commit.id) rescue "--broken encoding"
  7 + = image_tag gravatar_icon(commit.author_email), class: "avatar", width: 16
  8 + = gfm truncate(commit.title, length: 50), project_commit_path(project, id: commit.id) rescue "--broken encoding"
9 9  
... ...
app/views/events/_event.html.haml
1 1 - if event.allowed?
2 2 - if event.issue?
3 3 .event_feed
4   - = render "events/event_issue", :event => event
  4 + = render "events/event_issue", event: event
5 5  
6 6 - elsif event.merge_request?
7 7 .event_feed
8   - = render "events/event_merge_request", :event => event
  8 + = render "events/event_merge_request", event: event
9 9  
10 10 - elsif event.push?
11 11 .event_feed
12   - = render "events/event_push", :event => event
  12 + = render "events/event_push", event: event
13 13  
... ...
app/views/events/_event_issue.html.haml
1   -= image_tag gravatar_icon(event.author_email), :class => "avatar"
  1 += image_tag gravatar_icon(event.author_email), class: "avatar"
2 2 %strong #{event.author_name}
3   -%span.event_label{:class => event.action_name}= event.action_name
  3 +%span.event_label{class: event.action_name}= event.action_name
4 4 issue
5 5 = link_to project_issue_path(event.project, event.issue) do
6 6 %strong= truncate event.issue_title
... ...
app/views/events/_event_last_push.html.haml
1 1 - if show_last_push_widget?(event)
2 2 .event_lp
3 3 %div
4   - = image_tag gravatar_icon(event.author_email), :class => "avatar"
  4 + = image_tag gravatar_icon(event.author_email), class: "avatar"
5 5 %span Your pushed to
6 6 = event.ref_type
7   - = link_to project_commits_path(event.project, :ref => event.ref_name) do
8   - %strong= truncate(event.ref_name, :length => 28)
  7 + = link_to project_commits_path(event.project, ref: event.ref_name) do
  8 + %strong= truncate(event.ref_name, length: 28)
9 9 at
10 10 %strong= link_to event.project.name, event.project
11 11  
12   - = link_to new_mr_path_from_push_event(event), :title => "New Merge Request", :class => "btn very_small primary" do
  12 + = link_to new_mr_path_from_push_event(event), title: "New Merge Request", class: "btn very_small primary" do
13 13 Create Merge Request
... ...
app/views/events/_event_merge_request.html.haml
1 1 - if event.action_name == "merged"
2 2 .event_icon= image_tag "event_mr_merged.png"
3   -= image_tag gravatar_icon(event.author_email), :class => "avatar"
  3 += image_tag gravatar_icon(event.author_email), class: "avatar"
4 4 %strong #{event.author_name}
5   -%span.event_label{:class => event.action_name}= event.action_name
  5 +%span.event_label{class: event.action_name}= event.action_name
6 6 merge request
7 7 = link_to project_merge_request_path(event.project, event.merge_request) do
8 8 %strong= truncate event.merge_request_title
... ...
app/views/events/_event_push.html.haml
1 1 %div
2 2 .event_icon= image_tag "event_push.png"
3   - = image_tag gravatar_icon(event.author_email), :class => "avatar"
  3 + = image_tag gravatar_icon(event.author_email), class: "avatar"
4 4 %strong #{event.author_name}
5 5 %span.event_label.pushed= event.push_action_name
6 6 = event.ref_type
7   - = link_to project_commits_path(event.project, :ref => event.ref_name) do
  7 + = link_to project_commits_path(event.project, ref: event.ref_name) do
8 8 %strong= event.ref_name
9 9 at
10 10 %strong= link_to event.project.name, event.project
... ... @@ -14,17 +14,17 @@
14 14  
15 15 - if event.push_with_commits?
16 16 - if event.commits_count > 1
17   - = link_to compare_project_commits_path(event.project, :from => event.parent_commit.id, :to => event.last_commit.id) do
  17 + = link_to compare_project_commits_path(event.project, from: event.parent_commit.id, to: event.last_commit.id) do
18 18 %strong #{event.parent_commit.id[0..7]}...#{event.last_commit.id[0..7]}
19 19 - project = event.project
20 20 %ul.unstyled.event_commits
21 21 - if event.commits_count > 3
22 22 - event.commits[0...2].each do |commit|
23   - = render "events/commit", :commit => commit, :project => project
  23 + = render "events/commit", commit: commit, project: project
24 24 %li
25 25 %br
26 26 \... and #{event.commits_count - 2} more commits
27 27 - else
28 28 - event.commits.each do |commit|
29   - = render "events/commit", :commit => commit, :project => project
  29 + = render "events/commit", commit: commit, project: project
30 30  
... ...
app/views/help/api.html.haml
... ... @@ -6,13 +6,13 @@
6 6  
7 7 %ol
8 8 %li
9   - %a{:href => "#README"} README
  9 + %a{href: "#README"} README
10 10 %li
11   - %a{:href => "#projects"} Projects
  11 + %a{href: "#projects"} Projects
12 12 %li
13   - %a{:href => "#users"} Users
  13 + %a{href: "#users"} Users
14 14 %li
15   - %a{:href => "#issues"} Issues
  15 + %a{href: "#issues"} Issues
16 16  
17 17 .file_holder#README
18 18 .file_title
... ...
app/views/hooks/index.html.haml
... ... @@ -6,9 +6,9 @@
6 6 Post receive hooks for binding events when someone push to repository.
7 7 %br
8 8 Read more about web hooks
9   - %strong #{link_to "here", help_web_hooks_path, :class => "vlink"}
  9 + %strong #{link_to "here", help_web_hooks_path, class: "vlink"}
10 10  
11   -= form_for [@project, @hook], :as => :hook, :url => project_hooks_path(@project) do |f|
  11 += form_for [@project, @hook], as: :hook, url: project_hooks_path(@project) do |f|
12 12 -if @hook.errors.any?
13 13 .alert-message.block-message.error
14 14 - @hook.errors.full_messages.each do |msg|
... ... @@ -16,9 +16,9 @@
16 16 .clearfix
17 17 = f.label :url, "URL:"
18 18 .input
19   - = f.text_field :url, :class => "text_field xxlarge"
  19 + = f.text_field :url, class: "text_field xxlarge"
20 20 &nbsp;
21   - = f.submit "Add Web Hook", :class => "btn primary"
  21 + = f.submit "Add Web Hook", class: "btn primary"
22 22 %hr
23 23  
24 24 -if @hooks.any?
... ... @@ -36,7 +36,7 @@
36 36 %td
37 37 = link_to project_hook_path(@project, hook) do
38 38 %strong= hook.url
39   - = link_to 'Test Hook', test_project_hook_path(@project, hook), :class => "btn small right"
  39 + = link_to 'Test Hook', test_project_hook_path(@project, hook), class: "btn small right"
40 40 %td POST
41 41 %td
42   - = link_to 'Remove', project_hook_path(@project, hook), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn small right"
  42 + = link_to 'Remove', project_hook_path(@project, hook), confirm: 'Are you sure?', method: :delete, class: "danger btn small right"
... ...
app/views/issues/_form.html.haml
1 1 %div.issue-form-holder
2 2 %h3= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}"
3   - = form_for [@project, @issue], :remote => request.xhr? do |f|
  3 + = form_for [@project, @issue], remote: request.xhr? do |f|
4 4 -if @issue.errors.any?
5 5 .alert-message.block-message.error
6 6 %ul
... ... @@ -12,18 +12,18 @@
12 12 = f.label :title do
13 13 %strong= "Subject *"
14 14 .input
15   - = f.text_field :title, :maxlength => 255, :class => "xxlarge"
  15 + = f.text_field :title, maxlength: 255, class: "xxlarge"
16 16 .issue_middle_block
17 17 .issue_assignee
18 18 = f.label :assignee_id do
19 19 %i.icon-user
20 20 Assign to
21   - .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select a user" })
  21 + .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { include_blank: "Select a user" })
22 22 .issue_milestone
23 23 = f.label :milestone_id do
24 24 %i.icon-time
25 25 Milestone
26   - .input= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { :include_blank => "Select milestone" })
  26 + .input= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" })
27 27  
28 28 .issue_description
29 29 .clearfix
... ... @@ -31,26 +31,26 @@
31 31 %i.icon-tag
32 32 Labels
33 33 .input
34   - = f.text_field :label_list, :maxlength => 2000, :class => "xxlarge"
  34 + = f.text_field :label_list, maxlength: 2000, class: "xxlarge"
35 35 %p.hint Separate with comma.
36 36  
37 37 .clearfix
38 38 = f.label :description, "Details"
39 39 .input
40   - = f.text_area :description, :maxlength => 2000, :class => "xxlarge", :rows => 14
  40 + = f.text_area :description, maxlength: 2000, class: "xxlarge", rows: 14
41 41 %p.hint Markdown is enabled.
42 42  
43 43  
44 44 .actions
45 45 - if @issue.new_record?
46   - = f.submit 'Submit new issue', :class => "primary btn"
  46 + = f.submit 'Submit new issue', class: "primary btn"
47 47 -else
48   - = f.submit 'Save changes', :class => "primary btn"
  48 + = f.submit 'Save changes', class: "primary btn"
49 49  
50 50 - if request.xhr?
51   - = link_to "Cancel", "#back", :onclick => "backToIssues();", :class => "btn"
  51 + = link_to "Cancel", "#back", onclick: "backToIssues();", class: "btn"
52 52 - else
53 53 - if @issue.new_record?
54   - = link_to "Cancel", project_issues_path(@project), :class => "btn"
  54 + = link_to "Cancel", project_issues_path(@project), class: "btn"
55 55 - else
56   - = link_to "Cancel", project_issue_path(@project, @issue), :class => "btn"
  56 + = link_to "Cancel", project_issue_path(@project, @issue), class: "btn"
... ...
app/views/issues/_head.html.haml
1 1 %ul.nav.nav-tabs
2   - %li{:class => "#{'active' if current_page?(project_issues_path(@project))}"}
3   - = link_to project_issues_path(@project), :class => "tab" do
  2 + %li{class: "#{'active' if current_page?(project_issues_path(@project))}"}
  3 + = link_to project_issues_path(@project), class: "tab" do
4 4 Browse Issues
5   - %li{:class => "#{'active' if current_page?(project_milestones_path(@project))}"}
6   - = link_to project_milestones_path(@project), :class => "tab" do
  5 + %li{class: "#{'active' if current_page?(project_milestones_path(@project))}"}
  6 + = link_to project_milestones_path(@project), class: "tab" do
7 7 Milestones
8 8 %li.right
9 9 %span.rss-icon
10   - = link_to project_issues_path(@project, :atom, { :private_token => current_user.private_token }) do
11   - = image_tag "rss_ui.png", :title => "feed"
  10 + = link_to project_issues_path(@project, :atom, { private_token: current_user.private_token }) do
  11 + = image_tag "rss_ui.png", title: "feed"
... ...
app/views/issues/_issues.html.haml
1 1 - @issues.each do |issue|
2   - = render(:partial => 'issues/show', :locals => {:issue => issue})
  2 + = render(partial: 'issues/show', locals: {issue: issue})
3 3  
4 4 - if @issues.present?
5 5 %li.bottom
6 6 .row
7   - .span7= paginate @issues, :remote => true, :theme => "gitlab"
  7 + .span7= paginate @issues, remote: true, theme: "gitlab"
8 8 .span3.right
9 9 %span.cgray.right
10 10 %span.issue_counter #{@issues.total_count}
... ...
app/views/issues/_show.html.haml
1   -%li.wll{ :id => dom_id(issue), :class => issue_css_classes(issue), :url => project_issue_path(issue.project, issue) }
  1 +%li.wll{ id: dom_id(issue), class: issue_css_classes(issue), url: project_issue_path(issue.project, issue) }
2 2 - if controller.controller_name == 'issues'
3 3 .issue_check
4   - = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, :class => "selected_issue", :disabled => !can?(current_user, :modify_issue, issue)
  4 + = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, class: "selected_issue", disabled: !can?(current_user, :modify_issue, issue)
5 5 .right
6 6 - issue.labels.each do |label|
7 7 %span.label.label-issue.grouped
... ... @@ -13,19 +13,19 @@
13 13 = issue.notes.count
14 14 - if can? current_user, :modify_issue, issue
15 15 - if issue.closed
16   - = link_to 'Reopen', project_issue_path(issue.project, issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "btn small grouped reopen_issue", :remote => true
  16 + = link_to 'Reopen', project_issue_path(issue.project, issue, issue: {closed: false }, status_only: true), method: :put, class: "btn small grouped reopen_issue", remote: true
17 17 - else
18   - = link_to 'Resolve', project_issue_path(issue.project, issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "success btn small grouped close_issue", :remote => true
19   - = link_to edit_project_issue_path(issue.project, issue), :class => "btn small edit-issue-link", :remote => true do
  18 + = link_to 'Resolve', project_issue_path(issue.project, issue, issue: {closed: true }, status_only: true), method: :put, class: "success btn small grouped close_issue", remote: true
  19 + = link_to edit_project_issue_path(issue.project, issue), class: "btn small edit-issue-link", remote: true do
20 20 %i.icon-edit
21 21 Edit
22 22  
23 23 - if issue.assignee
24   - = image_tag gravatar_icon(issue.assignee_email), :class => "avatar"
  24 + = image_tag gravatar_icon(issue.assignee_email), class: "avatar"
25 25 - else
26   - = image_tag "no_avatar.png", :class => "avatar"
  26 + = image_tag "no_avatar.png", class: "avatar"
27 27  
28   - %p= link_to_gfm truncate(issue.title, :length => 100), project_issue_path(issue.project, issue), :class => "row_title"
  28 + %p= link_to_gfm truncate(issue.title, length: 100), project_issue_path(issue.project, issue), class: "row_title"
29 29  
30 30 %span.update-author
31 31 %small.cdark= "##{issue.id}"
... ...
app/views/issues/create.js.haml
1 1 - if @issue.valid?
2 2 :plain
3 3 switchFromNewIssue();
4   - $("#issues-table").prepend("#{escape_javascript(render(:partial => 'show', :locals => {:issue => @issue}))}");
  4 + $("#issues-table").prepend("#{escape_javascript(render(partial: 'show', locals: {issue: @issue}))}");
5 5 $.ajax({type: "GET", url: location.href, dataType: "script"});
6 6 - else
7 7 :plain
... ...
app/views/issues/index.html.haml
... ... @@ -6,51 +6,51 @@
6 6 .right
7 7 .span5
8 8 - if can? current_user, :write_issue, @project
9   - = link_to new_project_issue_path(@project), :class => "right btn small", :title => "New Issue", :remote => true do
  9 + = link_to new_project_issue_path(@project), class: "right btn small", title: "New Issue", remote: true do
10 10 New Issue
11   - = form_tag search_project_issues_path(@project), :method => :get, :remote => true, :id => "issue_search_form", :class => :right do
12   - = hidden_field_tag :project_id, @project.id, { :id => 'project_id' }
  11 + = form_tag search_project_issues_path(@project), method: :get, remote: true, id: "issue_search_form", class: :right do
  12 + = hidden_field_tag :project_id, @project.id, { id: 'project_id' }
13 13 = hidden_field_tag :status, params[:f]
14   - = search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search span3 right neib' }
  14 + = search_field_tag :issue_search, nil, { placeholder: 'Search', class: 'issue_search span3 right neib' }
15 15  
16 16 .clearfix
17 17  
18 18 %div#issues-table-holder.ui-box
19 19 .title
20   - = check_box_tag "check_all_issues", nil, false, :class => "check_all_issues left"
  20 + = check_box_tag "check_all_issues", nil, false, class: "check_all_issues left"
21 21  
22 22  
23 23 .issues_bulk_update.hide
24   - = form_tag bulk_update_project_issues_path(@project), :method => :post do
  24 + = form_tag bulk_update_project_issues_path(@project), method: :post do
25 25 %span.update_issues_text Update selected issues with &nbsp;
26 26 .left
27   - = select_tag('update[status]', options_for_select(['open', 'closed']), :prompt => "Status")
28   - = select_tag('update[assignee_id]', options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), :prompt => "Assignee")
29   - = select_tag('update[milestone_id]', options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), :prompt => "Milestone")
  27 + = select_tag('update[status]', options_for_select(['open', 'closed']), prompt: "Status")
  28 + = select_tag('update[assignee_id]', options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee")
  29 + = select_tag('update[milestone_id]', options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), prompt: "Milestone")
30 30 = hidden_field_tag 'update[issues_ids]', []
31 31 = hidden_field_tag :f, params[:f]
32   - = button_tag "Save", :class => "btn update_selected_issues"
  32 + = button_tag "Save", class: "btn update_selected_issues"
33 33 .issues_filters
34 34 .left
35 35 %ul.nav.nav-pills.left
36   - %li{:class => ("active" if (params[:f] == issues_filter[:open] || !params[:f]))}
37   - = link_to project_issues_path(@project, :f => issues_filter[:open], :milestone_id => params[:milestone_id]) do
  36 + %li{class: ("active" if (params[:f] == issues_filter[:open] || !params[:f]))}
  37 + = link_to project_issues_path(@project, f: issues_filter[:open], milestone_id: params[:milestone_id]) do
38 38 Open
39   - %li{:class => ("active" if params[:f] == issues_filter[:closed])}
40   - = link_to project_issues_path(@project, :f => issues_filter[:closed], :milestone_id => params[:milestone_id]) do
  39 + %li{class: ("active" if params[:f] == issues_filter[:closed])}
  40 + = link_to project_issues_path(@project, f: issues_filter[:closed], milestone_id: params[:milestone_id]) do
41 41 Closed
42   - %li{:class => ("active" if params[:f] == issues_filter[:to_me])}
43   - = link_to project_issues_path(@project, :f => issues_filter[:to_me], :milestone_id => params[:milestone_id]) do
  42 + %li{class: ("active" if params[:f] == issues_filter[:to_me])}
  43 + = link_to project_issues_path(@project, f: issues_filter[:to_me], milestone_id: params[:milestone_id]) do
44 44 To Me
45   - %li{:class => ("active" if params[:f] == issues_filter[:all])}
46   - = link_to project_issues_path(@project, :f => issues_filter[:all], :milestone_id => params[:milestone_id]) do
  45 + %li{class: ("active" if params[:f] == issues_filter[:all])}
  46 + = link_to project_issues_path(@project, f: issues_filter[:all], milestone_id: params[:milestone_id]) do
47 47 All
48 48  
49 49 .right
50   - = form_tag project_issues_path(@project), :method => :get, :class => :right do
51   - = select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), :prompt => "Labels")
52   - = select_tag(:assignee_id, options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), :prompt => "Assignee")
53   - = select_tag(:milestone_id, options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), :prompt => "Milestone")
  50 + = form_tag project_issues_path(@project), method: :get, class: :right do
  51 + = select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), prompt: "Labels")
  52 + = select_tag(:assignee_id, options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee")
  53 + = select_tag(:milestone_id, options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), prompt: "Milestone")
54 54 = hidden_field_tag :f, params[:f]
55 55 .clearfix
56 56  
... ...
app/views/issues/show.html.haml
... ... @@ -8,11 +8,11 @@
8 8 %span.right
9 9 - if can?(current_user, :admin_project, @project) || @issue.author == current_user
10 10 - if @issue.closed
11   - = link_to 'Reopen', project_issue_path(@project, @issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "btn small"
  11 + = link_to 'Reopen', project_issue_path(@project, @issue, issue: {closed: false }, status_only: true), method: :put, class: "btn small"
12 12 - else
13   - = link_to 'Close', project_issue_path(@project, @issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "btn small", :title => "Close Issue"
  13 + = link_to 'Close', project_issue_path(@project, @issue, issue: {closed: true }, status_only: true), method: :put, class: "btn small", title: "Close Issue"
14 14 - if can?(current_user, :admin_project, @project) || @issue.author == current_user
15   - = link_to edit_project_issue_path(@project, @issue), :class => "btn small" do
  15 + = link_to edit_project_issue_path(@project, @issue), class: "btn small" do
16 16 %i.icon-edit
17 17 Edit
18 18  
... ... @@ -35,18 +35,18 @@
35 35  
36 36 .middle_box_content
37 37 %cite.cgray Created by
38   - = image_tag gravatar_icon(@issue.author_email), :width => 16, :class => "lil_av"
  38 + = image_tag gravatar_icon(@issue.author_email), width: 16, class: "lil_av"
39 39 %strong.author= link_to_issue_author(@issue)
40 40  
41 41 - if @issue.assignee
42 42 %cite.cgray and currently assigned to
43   - = image_tag gravatar_icon(@issue.assignee_email), :width => 16, :class => "lil_av"
  43 + = image_tag gravatar_icon(@issue.assignee_email), width: 16, class: "lil_av"
44 44 %strong.author= link_to_issue_assignee(@issue)
45 45  
46 46 - if @issue.milestone
47 47 - milestone = @issue.milestone
48 48 %cite.cgray and attached to milestone
49   - %strong= link_to_gfm truncate(milestone.title, :length => 20), project_milestone_path(milestone.project, milestone)
  49 + %strong= link_to_gfm truncate(milestone.title, length: 20), project_milestone_path(milestone.project, milestone)
50 50  
51 51 .right
52 52 - @issue.labels.each do |label|
... ... @@ -61,4 +61,4 @@
61 61 = markdown @issue.description
62 62  
63 63  
64   -.issue_notes#notes= render "notes/notes", :tid => @issue.id, :tt => "issue"
  64 +.issue_notes#notes= render "notes/notes", tid: @issue.id, tt: "issue"
... ...
app/views/kaminari/admin/_first_page.html.haml
... ... @@ -6,4 +6,4 @@
6 6 -# per_page: number of items to fetch per page
7 7 -# remote: data-remote
8 8 %span.first
9   - = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote
  9 + = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote
... ...