Commit ac525a74ee2862d0012a443059954288d4634acd

Authored by Dmitriy Zaporozhets
2 parents 1413c23c 42d3295d

Merge pull request #1219 from tsigo/ruby19_hashes

Fully embrace Ruby 1.9 hash syntax
Showing 256 changed files with 1448 additions and 1448 deletions   Show diff stats
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
... ...
app/views/kaminari/admin/_last_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.last
9   - = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote}
  9 + = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {remote: remote}
... ...
app/views/kaminari/admin/_next_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 %li.next
9   - = link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote
  9 + = link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote
... ...
app/views/kaminari/admin/_page.html.haml
... ... @@ -6,5 +6,5 @@
6 6 -# num_pages: total number of pages
7 7 -# per_page: number of items to fetch per page
8 8 -# remote: data-remote
9   -%li{:class => "page#{' active' if page.current?}"}
10   - = link_to page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil}
  9 +%li{class: "page#{' active' if page.current?}"}
  10 + = link_to page, url, {remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil}
... ...
app/views/kaminari/admin/_prev_page.html.haml
... ... @@ -5,5 +5,5 @@
5 5 -# num_pages: total number of pages
6 6 -# per_page: number of items to fetch per page
7 7 -# remote: data-remote
8   -%li{:class => "prev" }
9   - = link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote
  8 +%li{class: "prev" }
  9 + = link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote
... ...
app/views/kaminari/gitlab/_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
... ...
app/views/kaminari/gitlab/_last_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.last
9   - = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote}
  9 + = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {remote: remote}
... ...
app/views/kaminari/gitlab/_next_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.next
9   - = link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote
  9 + = link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote
... ...
app/views/kaminari/gitlab/_page.html.haml
... ... @@ -6,5 +6,5 @@
6 6 -# num_pages: total number of pages
7 7 -# per_page: number of items to fetch per page
8 8 -# remote: data-remote
9   -%span{:class => "page#{' current' if page.current?}"}
10   - = link_to_unless page.current?, page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil}
  9 +%span{class: "page#{' current' if page.current?}"}
  10 + = link_to_unless page.current?, page, url, {remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil}
... ...
app/views/kaminari/gitlab/_prev_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.prev
9   - = link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote
  9 + = link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote
... ...
app/views/keys/_form.html.haml
... ... @@ -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 => [:xxlarge, :thin_area]
  14 + .input= f.text_area :key, class: [:xxlarge, :thin_area]
15 15 .actions
16   - = f.submit 'Save', :class => "primary btn"
17   - = link_to "Cancel", keys_path, :class => "btn"
  16 + = f.submit 'Save', class: "primary btn"
  17 + = link_to "Cancel", keys_path, class: "btn"
18 18  
... ...
app/views/keys/_show.html.haml
... ... @@ -9,5 +9,5 @@
9 9 = time_ago_in_words(key.created_at)
10 10 ago
11 11 %td
12   - = link_to 'Remove', key, :confirm => 'Are you sure?', :method => :delete, :class => "btn small danger delete-key right"
  12 + = link_to 'Remove', key, confirm: 'Are you sure?', method: :delete, class: "btn small danger delete-key right"
13 13  
... ...
app/views/keys/create.js.haml
1 1 - if @key.valid?
2 2 :plain
3 3 $("#new_key_dialog").dialog("close");
4   - $("#keys-table .data").append("#{escape_javascript(render(:partial => 'show', :locals => {:key => @key}))}");
  4 + $("#keys-table .data").append("#{escape_javascript(render(partial: 'show', locals: {key: @key}))}");
5 5 $("#no_ssh_key_defined").hide();
6 6 - else
7 7 :plain
... ...
app/views/keys/index.html.haml
1 1 %h3.page_title
2 2 SSH Keys
3   - = link_to "Add new", new_key_path, :class => "btn small right"
  3 + = link_to "Add new", new_key_path, class: "btn small right"
4 4  
5 5 %hr
6 6 %p.slead
... ... @@ -14,9 +14,9 @@
14 14 %th Added
15 15 %th
16 16 - @keys.each do |key|
17   - = render(:partial => 'show', :locals => {:key => key})
  17 + = render(partial: 'show', locals: {key: key})
18 18 - if @keys.blank?
19 19 %tr
20   - %td{:colspan => 3}
  20 + %td{colspan: 3}
21 21 %h3.nothing_here_message There are no SSH keys with access to your account.
22 22  
... ...
app/views/keys/show.html.haml
... ... @@ -11,4 +11,4 @@
11 11  
12 12 %pre= @key.key
13 13 .actions
14   - = link_to 'Remove', @key, :confirm => 'Are you sure?', :method => :delete, :class => "btn danger delete-key"
  14 + = link_to 'Remove', @key, confirm: 'Are you sure?', method: :delete, class: "btn danger delete-key"
... ...
app/views/layouts/_app_menu.html.haml
1 1 %ul.main_menu
2   - %li.home{:class => tab_class(:root)}
3   - = link_to "Home", root_path, :title => "Home"
  2 + %li.home{class: tab_class(:root)}
  3 + = link_to "Home", root_path, title: "Home"
4 4  
5   - %li{:class => tab_class(:dash_issues)}
  5 + %li{class: tab_class(:dash_issues)}
6 6 = link_to dashboard_issues_path do
7 7 Issues
8 8 %span.count= current_user.assigned_issues.opened.count
9 9  
10   - %li{:class => tab_class(:dash_mr)}
  10 + %li{class: tab_class(:dash_mr)}
11 11 = link_to dashboard_merge_requests_path do
12 12 Merge Requests
13 13 %span.count= current_user.cared_merge_requests.count
14 14  
15   - %li{:class => tab_class(:search)}
  15 + %li{class: tab_class(:search)}
16 16 = link_to "Search", search_path
17 17  
18   - %li{:class => tab_class(:help)}
  18 + %li{class: tab_class(:help)}
19 19 = link_to "Help", help_path
... ...
app/views/layouts/_flash.html.haml
1 1 - if alert || notice
2 2 - text = alert || notice
3   - %div{:style => "display:none", :id => "flash_container"}
  3 + %div{style: "display:none", id: "flash_container"}
4 4 %center
5 5 %h4= text
6 6 :javascript
... ...
app/views/layouts/_head.html.haml
1 1 %head
2   - %meta{:charset => "utf-8"}
  2 + %meta{charset: "utf-8"}
3 3 %title
4 4 GitLab
5 5 = " > #{@project.name}" if @project && !@project.new_record?
... ... @@ -9,10 +9,10 @@
9 9  
10 10 -# Atom feed
11 11 - if controller_name == 'projects' && action_name == 'index'
12   - = auto_discovery_link_tag :atom, projects_url(:atom, :private_token => current_user.private_token), :title => "Dashboard feed"
  12 + = auto_discovery_link_tag :atom, projects_url(:atom, private_token: current_user.private_token), title: "Dashboard feed"
13 13 - if @project && !@project.new_record?
14 14 - if current_page?(tree_project_ref_path(@project, @project.root_ref)) || current_page?(project_commits_path(@project))
15   - = auto_discovery_link_tag(:atom, project_commits_url(@project, :atom, :ref => @ref, :private_token => current_user.private_token), :title => "Recent commits to #{@project.name}:#{@ref}")
  15 + = auto_discovery_link_tag(:atom, project_commits_url(@project, :atom, ref: @ref, private_token: current_user.private_token), title: "Recent commits to #{@project.name}:#{@ref}")
16 16 - if request.path == project_issues_path(@project)
17   - = auto_discovery_link_tag(:atom, project_issues_url(@project, :atom, :private_token => current_user.private_token), :title => "#{@project.name} issues")
  17 + = auto_discovery_link_tag(:atom, project_issues_url(@project, :atom, private_token: current_user.private_token), title: "#{@project.name} issues")
18 18 = csrf_meta_tags
... ...
app/views/layouts/_head_panel.html.haml
... ... @@ -3,30 +3,30 @@
3 3 .container
4 4 .top_panel_content
5 5 %div.app_logo
6   - = link_to root_path, :class => "home", :title => "Home" do
  6 + = link_to root_path, class: "home", title: "Home" do
7 7 %h1
8 8 GITLAB
9 9 %span.separator
10 10 %h1.project_name= title
11 11 .search
12   - = form_tag search_path, :method => :get do |f|
13   - = text_field_tag "search", nil, :placeholder => "Search", :class => "search-input"
  12 + = form_tag search_path, method: :get do |f|
  13 + = text_field_tag "search", nil, placeholder: "Search", class: "search-input"
14 14 .fbtn
15 15 - if current_user.is_admin?
16   - = link_to admin_root_path, :class => "btn small", :title => "Admin area" do
  16 + = link_to admin_root_path, class: "btn small", title: "Admin area" do
17 17 %i.icon-cog
18 18 Admin
19 19 - if current_user.can_create_project?
20   - = link_to new_project_path, :class => "btn small", :title => "Create New Project" do
  20 + = link_to new_project_path, class: "btn small", title: "Create New Project" do
21 21 %i.icon-plus
22 22 Project
23 23 .account-box
24   - = link_to profile_path, :class => "pic" do
  24 + = link_to profile_path, class: "pic" do
25 25 = image_tag gravatar_icon(current_user.email)
26 26 .account-links
27   - = link_to profile_path, :class => "username" do
  27 + = link_to profile_path, class: "username" do
28 28 My profile
29   - = link_to 'Logout', destroy_user_session_path, :class => "logout", :method => :delete
  29 + = link_to 'Logout', destroy_user_session_path, class: "logout", method: :delete
30 30  
31 31 :javascript
32 32 $(function(){
... ...
app/views/layouts/_project_menu.html.haml
1 1 %ul.main_menu
2   - %li.home{:class => project_tab_class}
3   - = link_to @project.code, project_path(@project), :title => "Project"
  2 + %li.home{class: project_tab_class}
  3 + = link_to @project.code, project_path(@project), title: "Project"
4 4  
5 5 - if @project.repo_exists?
6 6 - if can? current_user, :download_code, @project
7   - %li{:class => tree_tab_class}
  7 + %li{class: tree_tab_class}
8 8 = link_to tree_project_ref_path(@project, @project.root_ref) do
9 9 Files
10   - %li{:class => commit_tab_class}
  10 + %li{class: commit_tab_class}
11 11 = link_to "Commits", project_commits_path(@project)
12 12  
13   - %li{:class => tab_class(:network)}
  13 + %li{class: tab_class(:network)}
14 14 = link_to "Network", graph_project_path(@project)
15 15  
16 16 - if @project.issues_enabled
17   - %li{:class => tab_class(:issues)}
  17 + %li{class: tab_class(:issues)}
18 18 = link_to project_issues_filter_path(@project) do
19 19 Issues
20 20 %span.count.issue_counter= @project.issues.opened.count
21 21  
22 22 - if @project.repo_exists?
23 23 - if @project.merge_requests_enabled
24   - %li{:class => tab_class(:merge_requests)}
  24 + %li{class: tab_class(:merge_requests)}
25 25 = link_to project_merge_requests_path(@project) do
26 26 Merge Requests
27 27 %span.count.merge_counter= @project.merge_requests.opened.count
28 28  
29 29 - if @project.wall_enabled
30   - %li{:class => tab_class(:wall)}
  30 + %li{class: tab_class(:wall)}
31 31 = link_to wall_project_path(@project) do
32 32 Wall
33 33  
34 34 - if @project.wiki_enabled
35   - %li{:class => tab_class(:wiki)}
  35 + %li{class: tab_class(:wiki)}
36 36 = link_to project_wiki_path(@project, :index) do
37 37 Wiki
... ...
app/views/layouts/admin.html.haml
1 1 !!! 5
2   -%html{ :lang => "en"}
  2 +%html{ lang: "en"}
3 3 = render "layouts/head"
4   - %body{:class => "#{app_theme} admin"}
  4 + %body{class: "#{app_theme} admin"}
5 5 = render "layouts/flash"
6   - = render "layouts/head_panel", :title => "Admin area"
  6 + = render "layouts/head_panel", title: "Admin area"
7 7 .container
8 8 %ul.main_menu
9   - %li.home{:class => tab_class(:admin_root)}
  9 + %li.home{class: tab_class(:admin_root)}
10 10 = link_to "Stats", admin_root_path
11   - %li{:class => tab_class(:admin_projects)}
  11 + %li{class: tab_class(:admin_projects)}
12 12 = link_to "Projects", admin_projects_path
13   - %li{:class => tab_class(:admin_users)}
  13 + %li{class: tab_class(:admin_users)}
14 14 = link_to "Users", admin_users_path
15   - %li{:class => tab_class(:admin_logs)}
  15 + %li{class: tab_class(:admin_logs)}
16 16 = link_to "Logs", admin_logs_path
17   - %li{:class => tab_class(:admin_emails)}
  17 + %li{class: tab_class(:admin_emails)}
18 18 = link_to "Hooks", admin_hooks_path
19   - %li{:class => tab_class(:admin_resque)}
  19 + %li{class: tab_class(:admin_resque)}
20 20 = link_to "Resque", admin_resque_path
21 21  
22 22 .content= yield
... ...
app/views/layouts/application.html.haml
1 1 !!! 5
2   -%html{ :lang => "en"}
  2 +%html{ lang: "en"}
3 3 = render "layouts/head"
4   - %body{:class => "#{app_theme} application"}
  4 + %body{class: "#{app_theme} application"}
5 5 = render "layouts/flash"
6   - = render "layouts/head_panel", :title => "Dashboard"
  6 + = render "layouts/head_panel", title: "Dashboard"
7 7 .container
8   - = render :partial => "layouts/app_menu"
  8 + = render partial: "layouts/app_menu"
9 9 .content
10 10 = yield
... ...
app/views/layouts/devise_layout.html.haml
1 1 !!! 5
2   -%html{ :lang => "en"}
  2 +%html{ lang: "en"}
3 3 = render "layouts/head"
4 4 %body.ui_basic.login-page
5   - = render :partial => "layouts/flash"
  5 + = render partial: "layouts/flash"
6 6 .container= yield
... ...
app/views/layouts/error.html.haml
1 1 !!! 5
2   -%html{ :lang => "en"}
  2 +%html{ lang: "en"}
3 3 = render "layouts/head"
4   - %body{:class => "#{app_theme} application"}
  4 + %body{class: "#{app_theme} application"}
5 5 = render "layouts/flash"
6   - = render "layouts/head_panel", :title => ""
  6 + = render "layouts/head_panel", title: ""
7 7 .container
8 8 .content
9 9 %br
... ...
app/views/layouts/notify.html.haml
1   -%html{:lang => "en"}
  1 +%html{lang: "en"}
2 2 %head
3   - %meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"}
  3 + %meta{content: "text/html; charset=utf-8", "http-equiv" => "Content-Type"}
4 4 %title
5 5 gitlabhq
6 6 :css
... ... @@ -11,28 +11,28 @@
11 11 .content a {color: #0eb6ce; text-decoration: none;}
12 12 .footer p {font-size: 11px; color:#7d7a7a; margin: 0; padding: 0; font-family: Helvetica, Arial, sans-serif;}
13 13 .footer a {color: #0eb6ce; text-decoration: none;}
14   - %body{:bgcolor => "#EAEAEA", :style => "margin: 0; padding: 0; background: #EAEAEA"}
15   - %table{:align => "center", :border => "0", :cellpadding => "0", :cellspacing => "0", :style => "padding: 35px 0; background: #EAEAEA;", :width => "100%"}
  14 + %body{bgcolor: "#EAEAEA", style: "margin: 0; padding: 0; background: #EAEAEA"}
  15 + %table{align: "center", border: "0", cellpadding: "0", cellspacing: "0", style: "padding: 35px 0; background: #EAEAEA;", width: "100%"}
16 16 %tr
17   - %td{:align => "center", :style => "margin: 0; padding: 0; background: #EAEAEA;"}
18   - %table.header{:align => "center", :border => "0", :cellpadding => "0", :cellspacing => "0", :style => "font-family: Helvetica, Arial, sans-serif; background:#333", :width => "600"}
  17 + %td{align: "center", style: "margin: 0; padding: 0; background: #EAEAEA;"}
  18 + %table.header{align: "center", border: "0", cellpadding: "0", cellspacing: "0", style: "font-family: Helvetica, Arial, sans-serif; background:#333", width: "600"}
19 19 %tr
20   - %td{:style => "font-size: 0px;", :width => "20"}
  20 + %td{style: "font-size: 0px;", width: "20"}
21 21
22   - %td{:align => "left", :style => "padding: 18px 0 10px;", :width => "580"}
23   - %h1{:style => "color: #BBBBBB; font: normal 32px Helvetica, Arial, sans-serif; margin: 0; padding: 0; line-height: 40px;"}
  22 + %td{align: "left", style: "padding: 18px 0 10px;", width: "580"}
  23 + %h1{style: "color: #BBBBBB; font: normal 32px Helvetica, Arial, sans-serif; margin: 0; padding: 0; line-height: 40px;"}
24 24 gitlab
25 25 - if @project
26 26 | #{@project.name}
27   - %table{:align => "center", :bgcolor => "#fff", :border => "0", :cellpadding => "0", :cellspacing => "0", :style => "font-family: Helvetica, Arial, sans-serif; background: #fff;", :width => "600"}
  27 + %table{align: "center", bgcolor: "#fff", border: "0", cellpadding: "0", cellspacing: "0", style: "font-family: Helvetica, Arial, sans-serif; background: #fff;", width: "600"}
28 28 %tr= yield
29 29 %tr
30   - %td{:align => "left", :colspan => "2", :height => "3", :style => "padding: font-size: 0; line-height: 0; height: 3px;", :width => "600"}
31   - %table.footer{:align => "center", :border => "0", :cellpadding => "0", :cellspacing => "0", :style => "font-family: Helvetica, Arial, sans-serif; line-height: 10px;", :width => "600"}
  30 + %td{align: "left", colspan: "2", height: "3", style: "padding: font-size: 0; line-height: 0; height: 3px;", width: "600"}
  31 + %table.footer{align: "center", border: "0", cellpadding: "0", cellspacing: "0", style: "font-family: Helvetica, Arial, sans-serif; line-height: 10px;", width: "600"}
32 32 %tr
33   - %td{:align => "center", :style => "padding: 5px 0 10px; font-size: 11px; color:#7d7a7a; margin: 0; line-height: 1.2;font-family: Helvetica, Arial, sans-serif;", :valign => "top"}
  33 + %td{align: "center", style: "padding: 5px 0 10px; font-size: 11px; color:#7d7a7a; margin: 0; line-height: 1.2;font-family: Helvetica, Arial, sans-serif;", valign: "top"}
34 34 %br
35   - %p{:style => "font-size: 11px; color:#7d7a7a; margin: 0; padding: 0; font-family: Helvetica, Arial, sans-serif;"}
  35 + %p{style: "font-size: 11px; color:#7d7a7a; margin: 0; padding: 0; font-family: Helvetica, Arial, sans-serif;"}
36 36 You're receiving this notification because you are a member of the
37 37 - if @project
38 38 #{@project.name}
... ...
app/views/layouts/profile.html.haml
1 1 !!! 5
2   -%html{ :lang => "en"}
  2 +%html{ lang: "en"}
3 3 = render "layouts/head"
4   - %body{:class => "#{app_theme} profile"}
  4 + %body{class: "#{app_theme} profile"}
5 5 = render "layouts/flash"
6   - = render "layouts/head_panel", :title => "Profile"
  6 + = render "layouts/head_panel", title: "Profile"
7 7 .container
8 8 %ul.main_menu
9   - %li.home{:class => tab_class(:profile)}
  9 + %li.home{class: tab_class(:profile)}
10 10 = link_to "Profile", profile_path
11 11  
12   - %li{:class => tab_class(:password)}
  12 + %li{class: tab_class(:password)}
13 13 = link_to "Password", profile_password_path
14 14  
15   - %li{:class => tab_class(:ssh_keys)}
  15 + %li{class: tab_class(:ssh_keys)}
16 16 = link_to keys_path do
17 17 SSH Keys
18 18 %span.count= current_user.keys.count
19 19  
20   - %li{:class => tab_class(:token)}
  20 + %li{class: tab_class(:token)}
21 21 = link_to "Token", profile_token_path
22 22  
23   - %li{:class => tab_class(:design)}
  23 + %li{class: tab_class(:design)}
24 24 = link_to "Design", profile_design_path
25 25  
26 26  
... ...
app/views/layouts/project.html.haml
1 1 !!! 5
2   -%html{ :lang => "en"}
  2 +%html{ lang: "en"}
3 3 = render "layouts/head"
4   - %body{:class => "#{app_theme} project"}
  4 + %body{class: "#{app_theme} project"}
5 5 = render "layouts/flash"
6   - = render "layouts/head_panel", :title => @project.name
  6 + = render "layouts/head_panel", title: @project.name
7 7 .container
8   - = render :partial => "layouts/project_menu"
  8 + = render partial: "layouts/project_menu"
9 9 .content
10 10 = yield
11 11  
... ...
app/views/merge_requests/_form.html.haml
1   -= form_for [@project, @merge_request], :html => { :class => "new_merge_request form-horizontal" } do |f|
  1 += form_for [@project, @merge_request], html: { class: "new_merge_request form-horizontal" } do |f|
2 2 -if @merge_request.errors.any?
3 3 .alert-message.block-message.error
4 4 %ul
... ... @@ -14,9 +14,9 @@
14 14 %h5 From (Head Branch)
15 15 .body
16 16 .padded
17   - = f.label :source_branch, "From", :class => "control-label"
  17 + = f.label :source_branch, "From", class: "control-label"
18 18 .controls
19   - = f.select(:source_branch, @project.heads.map(&:name), { :include_blank => "Select branch" }, :style => "width:250px")
  19 + = f.select(:source_branch, @project.heads.map(&:name), { include_blank: "Select branch" }, style: "width:250px")
20 20 .bottom_commit
21 21 .mr_source_commit
22 22  
... ... @@ -25,9 +25,9 @@
25 25 %h5 To (Base Branch)
26 26 .body
27 27 .padded
28   - = f.label :target_branch, "To", :class => "control-label"
  28 + = f.label :target_branch, "To", class: "control-label"
29 29 .controls
30   - = f.select(:target_branch, @project.heads.map(&:name), { :include_blank => "Select branch" }, :style => "width:250px")
  30 + = f.select(:target_branch, @project.heads.map(&:name), { include_blank: "Select branch" }, style: "width:250px")
31 31 .bottom_commit
32 32 .mr_target_commit
33 33  
... ... @@ -38,22 +38,22 @@
38 38 .top_box_content
39 39 = f.label :title do
40 40 %strong= "Title *"
41   - .input= f.text_field :title, :class => "input-xxlarge pad", :maxlength => 255, :rows => 5
  41 + .input= f.text_field :title, class: "input-xxlarge pad", maxlength: 255, rows: 5
42 42 .middle_box_content
43 43 = f.label :assignee_id do
44 44 %i.icon-user
45 45 Assign to
46   - .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }, :style => "width:250px")
  46 + .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { include_blank: "Select user" }, style: "width:250px")
47 47  
48 48 .control-group
49 49  
50 50 .form-actions
51   - = f.submit 'Save', :class => "btn-primary btn"
  51 + = f.submit 'Save', class: "btn-primary btn"
52 52 - if @merge_request.new_record?
53   - = link_to project_merge_requests_path(@project), :class => "btn" do
  53 + = link_to project_merge_requests_path(@project), class: "btn" do
54 54 Cancel
55 55 - else
56   - = link_to project_merge_request_path(@project, @merge_request), :class => "btn" do
  56 + = link_to project_merge_request_path(@project, @merge_request), class: "btn" do
57 57 Cancel
58 58  
59 59  
... ...
app/views/merge_requests/_head.html.haml
1 1 .top-tabs
2   - = link_to project_merge_requests_path(@project), :class => "tab #{'active' if current_page?(project_merge_requests_path(@project)) }" do
  2 + = link_to project_merge_requests_path(@project), class: "tab #{'active' if current_page?(project_merge_requests_path(@project)) }" do
3 3 %span
4 4 Merge Requests
5 5  
... ...
app/views/merge_requests/_merge_request.html.haml
1   -%li.wll{ :class => mr_css_classes(merge_request) }
  1 +%li.wll{ class: mr_css_classes(merge_request) }
2 2 .right
3 3 .left
4 4 - if merge_request.merged?
... ... @@ -14,9 +14,9 @@
14 14 = merge_request.source_branch
15 15 &rarr;
16 16 = merge_request.target_branch
17   - = image_tag gravatar_icon(merge_request.author_email), :class => "avatar"
  17 + = image_tag gravatar_icon(merge_request.author_email), class: "avatar"
18 18  
19   - %p= link_to_gfm truncate(merge_request.title, :length => 80), project_merge_request_path(merge_request.project, merge_request), :class => "row_title"
  19 + %p= link_to_gfm truncate(merge_request.title, length: 80), project_merge_request_path(merge_request.project, merge_request), class: "row_title"
20 20  
21 21 %span.update-author
22 22 %small.cdark= "##{merge_request.id}"
... ...
app/views/merge_requests/_show.html.haml
... ... @@ -7,16 +7,16 @@
7 7 - if @commits.present?
8 8 %ul.nav.nav-tabs.mr_nav_tabs
9 9 %li
10   - = link_to "#notes", "data-url" => project_merge_request_path(@project, @merge_request), :class => "merge-notes-tab tab" do
  10 + = link_to "#notes", "data-url" => project_merge_request_path(@project, @merge_request), class: "merge-notes-tab tab" do
11 11 %i.icon-comment
12 12 Comments
13 13 %li
14   - = link_to "#diffs", "data-url" => diffs_project_merge_request_path(@project, @merge_request), :class => "merge-diffs-tab tab" do
  14 + = link_to "#diffs", "data-url" => diffs_project_merge_request_path(@project, @merge_request), class: "merge-diffs-tab tab" do
15 15 %i.icon-list-alt
16 16 Diff
17 17  
18   -.merge_request_notes#notes{ :class => (controller.action_name == 'show') ? "" : "hide" }
19   - = render("notes/notes", :tid => @merge_request.id, :tt => "merge_request")
  18 +.merge_request_notes#notes{ class: (controller.action_name == 'show') ? "" : "hide" }
  19 + = render("notes/notes", tid: @merge_request.id, tt: "merge_request")
20 20 .merge-request-diffs
21 21 = render "merge_requests/show/diffs" if @diffs
22 22 .status
... ...
app/views/merge_requests/branch_from.js.haml
1 1 :plain
2   - $(".mr_source_commit").html("#{escape_javascript(render 'commits/commit', :commit => @commit)}");
  2 + $(".mr_source_commit").html("#{escape_javascript(render 'commits/commit', commit: @commit)}");
... ...
app/views/merge_requests/branch_to.js.haml
1 1 :plain
2   - $(".mr_target_commit").html("#{escape_javascript(render 'commits/commit', :commit => @commit)}");
  2 + $(".mr_target_commit").html("#{escape_javascript(render 'commits/commit', commit: @commit)}");
3 3  
... ...
app/views/merge_requests/commits.js.haml
1 1 :plain
2   - $(".merge-request-commits").html("#{escape_javascript(render(:partial => "commits"))}");
  2 + $(".merge-request-commits").html("#{escape_javascript(render(partial: "commits"))}");
3 3  
4 4  
... ...
app/views/merge_requests/diffs.js.haml
1 1 :plain
2   - $(".merge-request-diffs").html("#{escape_javascript(render(:partial => "merge_requests/show/diffs"))}");
  2 + $(".merge-request-diffs").html("#{escape_javascript(render(partial: "merge_requests/show/diffs"))}");
3 3  
4 4  
... ...
app/views/merge_requests/index.html.haml
1 1 %h3.page_title
2 2 Merge Requests
3 3 - if can? current_user, :write_issue, @project
4   - = link_to new_project_merge_request_path(@project), :class => "right btn small", :title => "New Merge Request" do
  4 + = link_to new_project_merge_request_path(@project), class: "right btn small", title: "New Merge Request" do
5 5 New Merge Request
6 6  
7 7 %br
... ... @@ -10,17 +10,17 @@
10 10 .ui-box
11 11 .title
12 12 %ul.nav.nav-pills
13   - %li{:class => ("active" if (params[:f] == "0" || !params[:f]))}
14   - = link_to project_merge_requests_path(@project, :f => 0) do
  13 + %li{class: ("active" if (params[:f] == "0" || !params[:f]))}
  14 + = link_to project_merge_requests_path(@project, f: 0) do
15 15 Open
16   - %li{:class => ("active" if params[:f] == "2")}
17   - = link_to project_merge_requests_path(@project, :f => 2) do
  16 + %li{class: ("active" if params[:f] == "2")}
  17 + = link_to project_merge_requests_path(@project, f: 2) do
18 18 Closed
19   - %li{:class => ("active" if params[:f] == "3")}
20   - = link_to project_merge_requests_path(@project, :f => 3) do
  19 + %li{class: ("active" if params[:f] == "3")}
  20 + = link_to project_merge_requests_path(@project, f: 3) do
21 21 To Me
22   - %li{:class => ("active" if params[:f] == "1")}
23   - = link_to project_merge_requests_path(@project, :f => 1) do
  22 + %li{class: ("active" if params[:f] == "1")}
  23 + = link_to project_merge_requests_path(@project, f: 1) do
24 24 All
25 25  
26 26 %ul.unstyled
... ... @@ -31,7 +31,7 @@
31 31 - if @merge_requests.present?
32 32 %li.bottom
33 33 .row
34   - .span7= paginate @merge_requests, :theme => "gitlab"
  34 + .span7= paginate @merge_requests, theme: "gitlab"
35 35 .span4.right
36 36 %span.cgray.right #{@merge_requests.total_count} merge requests for this filter
37 37  
... ...
app/views/merge_requests/show.js.haml
1 1 :plain
2   - $(".merge-request-notes").html("#{escape_javascript(render("notes/notes", :tid => @merge_request.id, :tt => "merge_request"))}");
  2 + $(".merge-request-notes").html("#{escape_javascript(render("notes/notes", tid: @merge_request.id, tt: "merge_request"))}");
... ...
app/views/merge_requests/show/_commits.html.haml
... ... @@ -7,19 +7,19 @@
7 7 - if @commits.count > 8
8 8 %ul.first_mr_commits.unstyled
9 9 - @commits.first(8).each do |commit|
10   - = render "commits/commit", :commit => commit
  10 + = render "commits/commit", commit: commit
11 11 %li.bottom
12 12 8 of #{@commits.count} commits displayed.
13 13 %strong
14 14 %a.mr_show_all_commits Click here to show all
15 15 %ul.all_mr_commits.hide.unstyled
16 16 - @commits.each do |commit|
17   - = render "commits/commit", :commit => commit
  17 + = render "commits/commit", commit: commit
18 18  
19 19 - else
20 20 %ul.unstyled
21 21 - @commits.each do |commit|
22   - = render "commits/commit", :commit => commit
  22 + = render "commits/commit", commit: commit
23 23  
24 24 - else
25 25 %h5
... ...
app/views/merge_requests/show/_diffs.html.haml
1 1 - if @merge_request.valid_diffs?
2   - = render "commits/diffs", :diffs => @diffs
  2 + = render "commits/diffs", diffs: @diffs
3 3 - elsif @merge_request.broken_diffs?
4 4 %h4.nothing_here_message
5 5 Can't load diff.
6   - You can #{link_to "download MR patch", raw_project_merge_request_path(@project, @merge_request), :class => "vlink"} instead.
  6 + You can #{link_to "download MR patch", raw_project_merge_request_path(@project, @merge_request), class: "vlink"} instead.
7 7 - else
8 8 %h4.nothing_here_message Nothing to merge
... ...
app/views/merge_requests/show/_how_to_merge.html.haml
1 1 %div#modal_merge_info.modal.hide
2 2 .modal-header
3   - %a.close{:href => "#"} ×
  3 + %a.close{href: "#"} ×
4 4 %h3 How To Merge
5 5 .modal-body
6 6 %pre
... ...
app/views/merge_requests/show/_mr_accept.html.haml
... ... @@ -4,29 +4,29 @@
4 4  
5 5  
6 6 - if @merge_request.open? && @commits.any? && can?(current_user, :accept_mr, @project)
7   - .automerge_widget.can_be_merged{:style => "display:none"}
  7 + .automerge_widget.can_be_merged{style: "display:none"}
8 8 .alert.alert-success
9 9 %span
10   - = form_for [:automerge, @project, @merge_request], :remote => true, :method => :get do |f|
  10 + = form_for [:automerge, @project, @merge_request], remote: true, method: :get do |f|
11 11 %p
12 12 You can accept this request automatically.
13 13 If you still want to do it manually -
14   - %strong= link_to "click here", "#", :class => "how_to_merge_link vlink", :title => "How To Merge"
  14 + %strong= link_to "click here", "#", class: "how_to_merge_link vlink", title: "How To Merge"
15 15 for instructions
16 16 .accept_group
17   - = f.submit "Accept Merge Request", :class => "btn small success accept_merge_request"
  17 + = f.submit "Accept Merge Request", class: "btn small success accept_merge_request"
18 18 - unless @project.root_ref? @merge_request.source_branch
19 19 .remove_branch_holder
20   - = label_tag :should_remove_source_branch, :class => "checkbox" do
  20 + = label_tag :should_remove_source_branch, class: "checkbox" do
21 21 = check_box_tag :should_remove_source_branch
22 22 Remove source-branch
23 23 .clearfix
24 24  
25 25  
26   - .automerge_widget.cannot_be_merged{:style => "display:none"}
  26 + .automerge_widget.cannot_be_merged{style: "display:none"}
27 27 .alert.alert-info
28 28 %span
29   - = link_to "Show how to merge", "#", :class => "how_to_merge_link btn small padded", :title => "How To Merge"
  29 + = link_to "Show how to merge", "#", class: "how_to_merge_link btn small padded", title: "How To Merge"
30 30 &nbsp;
31 31 %strong This request cant be merged with GitLab. You should do it manually
32 32  
... ... @@ -36,7 +36,7 @@
36 36 %i.icon-refresh
37 37 Checking for ability to automatically merge…
38 38  
39   - .automerge_widget.already_cannot_be_merged{:style => "display:none"}
  39 + .automerge_widget.already_cannot_be_merged{style: "display:none"}
40 40 .alert.alert-info
41 41 %strong This merge request already can not be merged. Try to reload page.
42 42  
... ...
app/views/merge_requests/show/_mr_box.html.haml
... ... @@ -10,12 +10,12 @@
10 10 .middle_box_content
11 11 %div
12 12 %cite.cgray Created at #{@merge_request.created_at.stamp("Aug 21, 2011")} by
13   - = image_tag gravatar_icon(@merge_request.author_email), :width => 16, :class => "lil_av"
  13 + = image_tag gravatar_icon(@merge_request.author_email), width: 16, class: "lil_av"
14 14 %strong.author= link_to_merge_request_author(@merge_request)
15 15  
16 16 - if @merge_request.assignee
17 17 %cite.cgray and currently assigned to
18   - = image_tag gravatar_icon(@merge_request.assignee_email), :width => 16, :class => "lil_av"
  18 + = image_tag gravatar_icon(@merge_request.assignee_email), width: 16, class: "lil_av"
19 19 %strong.author= link_to_merge_request_assignee(@merge_request)
20 20  
21 21  
... ...
app/views/merge_requests/show/_mr_title.html.haml
... ... @@ -13,13 +13,13 @@
13 13 = "MERGED"
14 14 - if can?(current_user, :modify_merge_request, @merge_request)
15 15 - if @merge_request.open?
16   - = link_to raw_project_merge_request_path(@project, @merge_request), :class => "btn grouped" do
  16 + = link_to raw_project_merge_request_path(@project, @merge_request), class: "btn grouped" do
17 17 %i.icon-download-alt
18 18 Get Patch
19 19  
20   - = link_to 'Close', project_merge_request_path(@project, @merge_request, :merge_request => {:closed => true }, :status_only => true), :method => :put, :class => "btn grouped danger", :title => "Close merge request"
  20 + = link_to 'Close', project_merge_request_path(@project, @merge_request, merge_request: {closed: true }, status_only: true), method: :put, class: "btn grouped danger", title: "Close merge request"
21 21  
22   - = link_to edit_project_merge_request_path(@project, @merge_request), :class => "btn grouped" do
  22 + = link_to edit_project_merge_request_path(@project, @merge_request), class: "btn grouped" do
23 23 %i.icon-edit
24 24 Edit
25 25  
... ...
app/views/milestones/_form.html.haml
... ... @@ -5,7 +5,7 @@
5 5  
6 6 %hr
7 7  
8   -= form_for [@project, @milestone], :html => {:class => "new_milestone form-horizontal"} do |f|
  8 += form_for [@project, @milestone], html: {class: "new_milestone form-horizontal"} do |f|
9 9 -if @milestone.errors.any?
10 10 .alert-message.block-message.error
11 11 %ul
... ... @@ -14,35 +14,35 @@
14 14 .row
15 15 .span6
16 16 .control-group
17   - = f.label :title, "Title", :class => "control-label"
  17 + = f.label :title, "Title", class: "control-label"
18 18 .controls
19   - = f.text_field :title, :maxlength => 255, :class => "input-xlarge"
  19 + = f.text_field :title, maxlength: 255, class: "input-xlarge"
20 20 %p.help-block Required
21 21 .control-group
22   - = f.label :description, "Description", :class => "control-label"
  22 + = f.label :description, "Description", class: "control-label"
23 23 .controls
24   - = f.text_area :description, :maxlength => 2000, :class => "input-xlarge", :rows => 10
  24 + = f.text_area :description, maxlength: 2000, class: "input-xlarge", rows: 10
25 25 %p.help-block Markdown is enabled.
26 26 .span6
27 27 .control-group
28   - = f.label :due_date, "Due Date", :class => "control-label"
  28 + = f.label :due_date, "Due Date", class: "control-label"
29 29 .input= f.hidden_field :due_date
30 30 .controls
31 31 .datepicker
32 32  
33 33 .form-actions
34 34 - if @milestone.new_record?
35   - = f.submit 'Create milestone', :class => "primary btn"
  35 + = f.submit 'Create milestone', class: "primary btn"
36 36 -else
37   - = f.submit 'Save changes', :class => "primary btn"
  37 + = f.submit 'Save changes', class: "primary btn"
38 38  
39 39 - if request.xhr?
40   - = link_to "Cancel", "#back", :onclick => "backToIssues();", :class => "btn"
  40 + = link_to "Cancel", "#back", onclick: "backToIssues();", class: "btn"
41 41 - else
42 42 - if @milestone.new_record?
43   - = link_to "Cancel", project_milestones_path(@project), :class => "btn"
  43 + = link_to "Cancel", project_milestones_path(@project), class: "btn"
44 44 - else
45   - = link_to "Cancel", project_milestone_path(@project, @milestone), :class => "btn"
  45 + = link_to "Cancel", project_milestone_path(@project, @milestone), class: "btn"
46 46  
47 47 :javascript
48 48 $(function() {
... ...
app/views/milestones/_milestone.html.haml
1   -%li{:class => "milestone", :id => dom_id(milestone) }
  1 +%li{class: "milestone", id: dom_id(milestone) }
2 2 .right
3 3 - if milestone.issues.any?
4 4 %span.btn.small.disabled.grouped= pluralize milestone.issues.count, 'issues'
5 5 - if milestone.issues.count > 0
6   - = link_to 'Browse Issues', project_issues_path(milestone.project, :milestone_id => milestone.id), :class => "btn small grouped"
  6 + = link_to 'Browse Issues', project_issues_path(milestone.project, milestone_id: milestone.id), class: "btn small grouped"
7 7 - if can? current_user, :admin_milestone, milestone.project
8   - = link_to 'Edit', edit_project_milestone_path(milestone.project, milestone), :class => "btn small edit-milestone-link grouped"
  8 + = link_to 'Edit', edit_project_milestone_path(milestone.project, milestone), class: "btn small edit-milestone-link grouped"
9 9 %h4
10   - = link_to_gfm truncate(milestone.title, :length => 100), project_milestone_path(milestone.project, milestone), :class => "row_title"
  10 + = link_to_gfm truncate(milestone.title, length: 100), project_milestone_path(milestone.project, milestone), class: "row_title"
11 11 %small
12 12 = milestone.expires_at
13 13 %br
14 14 .progress.progress-success.span3
15   - .bar{:style => "width: #{milestone.percent_complete}%;"}
  15 + .bar{style: "width: #{milestone.percent_complete}%;"}
16 16  
17 17  
18 18 &nbsp;
... ...
app/views/milestones/index.html.haml
... ... @@ -3,23 +3,23 @@
3 3 %h3.page_title
4 4 Milestones
5 5 - if can? current_user, :admin_milestone, @project
6   - = link_to "New Milestone", new_project_milestone_path(@project), :class => "right btn small", :title => "New Milestone"
  6 + = link_to "New Milestone", new_project_milestone_path(@project), class: "right btn small", title: "New Milestone"
7 7 %br
8 8 %div.ui-box
9 9 .title
10 10 %ul.nav.nav-pills
11   - %li{:class => ("active" if (params[:f] == "0" || !params[:f]))}
12   - = link_to project_milestones_path(@project, :f => 0) do
  11 + %li{class: ("active" if (params[:f] == "0" || !params[:f]))}
  12 + = link_to project_milestones_path(@project, f: 0) do
13 13 Active
14   - %li{:class => ("active" if params[:f] == "1")}
15   - = link_to project_milestones_path(@project, :f => 1) do
  14 + %li{class: ("active" if params[:f] == "1")}
  15 + = link_to project_milestones_path(@project, f: 1) do
16 16 All
17 17  
18 18 %ul.unstyled
19 19 = render @milestones
20 20  
21 21 - if @milestones.present?
22   - %li.bottom= paginate @milestones, :remote => true, :theme => "gitlab"
  22 + %li.bottom= paginate @milestones, remote: true, theme: "gitlab"
23 23 - else
24 24 %li
25 25 %h3.nothing_here_message Nothing to show here
... ...
app/views/milestones/show.html.haml
... ... @@ -4,9 +4,9 @@
4 4 = @milestone.expires_at
5 5  
6 6 %span.right
7   - = link_to 'Browse Issues', project_issues_path(@milestone.project, :milestone_id => @milestone.id), :class => "btn edit-milestone-link small grouped"
  7 + = link_to 'Browse Issues', project_issues_path(@milestone.project, milestone_id: @milestone.id), class: "btn edit-milestone-link small grouped"
8 8 - if can?(current_user, :admin_milestone, @project)
9   - = link_to edit_project_milestone_path(@project, @milestone), :class => "btn small grouped" do
  9 + = link_to edit_project_milestone_path(@project, @milestone), class: "btn small grouped" do
10 10 %i.icon-edit
11 11 Edit
12 12  
... ... @@ -32,7 +32,7 @@
32 32 &ndash;
33 33 #{@milestone.issues.closed.count} closed
34 34 .progress.progress-success
35   - .bar{:style => "width: #{@milestone.percent_complete}%;"}
  35 + .bar{style: "width: #{@milestone.percent_complete}%;"}
36 36  
37 37  
38 38 - if @milestone.description.present?
... ... @@ -51,9 +51,9 @@
51 51 = link_to [@project, issue] do
52 52 %span.badge.badge-info ##{issue.id}
53 53 &ndash;
54   - = link_to_gfm truncate(issue.title, :length => 60), [@project, issue]
  54 + = link_to_gfm truncate(issue.title, length: 60), [@project, issue]
55 55 %br
56   - = paginate @issues, :theme => "gitlab"
  56 + = paginate @issues, theme: "gitlab"
57 57  
58 58 .span6
59 59 %table.admin-table
... ... @@ -62,6 +62,6 @@
62 62 - @users.each do |user|
63 63 %tr
64 64 %td
65   - = image_tag gravatar_icon(user.email, 24), :width => "24"
  65 + = image_tag gravatar_icon(user.email, 24), width: "24"
66 66 &nbsp;
67 67 = user.name
... ...
app/views/notes/_create_common.js.haml
... ... @@ -2,7 +2,7 @@
2 2 :plain
3 3 $("#new_note .errors").remove();
4 4 $('#new_note textarea').val("");
5   - NoteList.prepend(#{note.id}, "#{escape_javascript(render :partial => "notes/show", :locals => {:note => note})}");
  5 + NoteList.prepend(#{note.id}, "#{escape_javascript(render partial: "notes/show", locals: {note: note})}");
6 6 - else
7 7 :plain
8 8 $("#new_note").replaceWith("#{escape_javascript(render('form'))}");
... ...
app/views/notes/_create_line.js.haml
... ... @@ -4,5 +4,5 @@
4 4 $('#new_note textarea').val("");
5 5 $("a.line_note_reply_link[line_code='#{note.line_code}']").closest("tr").remove();
6 6 var trEl = $(".#{note.line_code}").parent();
7   - trEl.after("#{escape_javascript(render :partial => "notes/per_line_show", :locals => {:note => note})}");
8   - trEl.after("#{escape_javascript(render :partial => "notes/reply_button", :locals => {:line_code => note.line_code})}");
  7 + trEl.after("#{escape_javascript(render partial: "notes/per_line_show", locals: {note: note})}");
  8 + trEl.after("#{escape_javascript(render partial: "notes/reply_button", locals: {line_code: note.line_code})}");
... ...
app/views/notes/_form.html.haml
1   -= form_for [@project, @note], :remote => "true", :multipart => true do |f|
  1 += form_for [@project, @note], remote: "true", multipart: true do |f|
2 2 %h3.page_title Leave a comment
3 3 -if @note.errors.any?
4 4 .alert-message.block-message.error
... ... @@ -7,16 +7,16 @@
7 7  
8 8 = f.hidden_field :noteable_id
9 9 = f.hidden_field :noteable_type
10   - = f.text_area :note, :size => 255
  10 + = f.text_area :note, size: 255
11 11 #preview-note.well.hide
12 12 %p.hint
13   - = link_to "Gitlab Markdown", help_markdown_path, :target => '_blank'
  13 + = link_to "Gitlab Markdown", help_markdown_path, target: '_blank'
14 14 is enabled.
15   - = link_to 'Preview', preview_project_notes_path(@project), :id => 'preview-link'
  15 + = link_to 'Preview', preview_project_notes_path(@project), id: 'preview-link'
16 16  
17 17 .row.note_advanced_opts.hide
18 18 .span2
19   - = f.submit 'Add Comment', :class => "btn primary submit_note", :id => "submit_note"
  19 + = f.submit 'Add Comment', class: "btn primary submit_note", id: "submit_note"
20 20 .span4.notify_opts
21 21 %h6.left Notify via email:
22 22 = label_tag :notify do
... ... @@ -33,6 +33,6 @@
33 33  
34 34 .input.input_file
35 35 %a.file_upload.btn.small Upload File
36   - = f.file_field :attachment, :class => "input-file"
  36 + = f.file_field :attachment, class: "input-file"
37 37 %span.hint Any file less than 10 MB
38 38  
... ...
app/views/notes/_load.js.haml
1 1 - unless @notes.blank?
2 2 - if params[:last_id]
3 3 :plain
4   - NoteList.replace("#{escape_javascript(render(:partial => 'notes/notes_list'))}");
  4 + NoteList.replace("#{escape_javascript(render(partial: 'notes/notes_list'))}");
5 5  
6 6 - elsif params[:first_id]
7 7 :plain
8   - NoteList.append(#{@notes.last.id}, "#{escape_javascript(render(:partial => 'notes/notes_list'))}");
  8 + NoteList.append(#{@notes.last.id}, "#{escape_javascript(render(partial: 'notes/notes_list'))}");
9 9  
10 10 - else
11 11 :plain
12   - NoteList.setContent(#{@notes.last.id}, #{@notes.first.id}, "#{escape_javascript(render(:partial => 'notes/notes_list'))}");
  12 + NoteList.setContent(#{@notes.last.id}, #{@notes.first.id}, "#{escape_javascript(render(partial: 'notes/notes_list'))}");
13 13  
14 14 - else
15 15 - if params[:first_id]
... ...
app/views/notes/_notes_list.html.haml
1 1 - @notes.each do |note|
2 2 - next unless note.author
3   - = render :partial => "notes/show", :locals => {:note => note}
  3 + = render partial: "notes/show", locals: {note: note}
4 4  
... ...
app/views/notes/_per_line_form.html.haml
1   -%table{:style => "display:none;"}
  1 +%table{style: "display:none;"}
2 2 %tr.per_line_form
3   - %td{:colspan => 3 }
4   - = form_for [@project, @note], :remote => "true", :multipart => true do |f|
  3 + %td{colspan: 3 }
  4 + = form_for [@project, @note], remote: "true", multipart: true do |f|
5 5 %h3.page_title Leave a note
6 6 %div.span10
7 7 -if @note.errors.any?
... ... @@ -12,11 +12,11 @@
12 12 = f.hidden_field :noteable_id
13 13 = f.hidden_field :noteable_type
14 14 = f.hidden_field :line_code
15   - = f.text_area :note, :size => 255
  15 + = f.text_area :note, size: 255
16 16 .note_actions
17 17 .buttons
18   - = f.submit 'Add note', :class => "btn primary submit_note", :id => "submit_note"
19   - = link_to "Cancel", "#", :class => "btn hide-button"
  18 + = f.submit 'Add note', class: "btn primary submit_note", id: "submit_note"
  19 + = link_to "Cancel", "#", class: "btn hide-button"
20 20 .options
21 21 %h6.left Notify via email:
22 22 .labels
... ...
app/views/notes/_per_line_show.html.haml
1 1 %tr.line_notes_row
2   - %td{:colspan => 3}
  2 + %td{colspan: 3}
3 3 %ul
4   - = render :partial => "notes/show", :locals => {:note => note}
  4 + = render partial: "notes/show", locals: {note: note}
5 5  
... ...
app/views/notes/_reply_button.html.haml
1 1 %tr.line_notes_row.reply
2   - %td{:colspan => 3}
  2 + %td{colspan: 3}
3 3 %i.icon-comment
4   - = link_to "Reply", "#", :class => "line_note_reply_link", "line_code" => line_code, :title => "Add note for this line"
  4 + = link_to "Reply", "#", class: "line_note_reply_link", "line_code" => line_code, title: "Add note for this line"
... ...
app/views/notes/_show.html.haml
1   -%li{:id => dom_id(note), :class => "note"}
2   - = image_tag gravatar_icon(note.author.email), :class => "avatar"
  1 +%li{id: dom_id(note), class: "note"}
  2 + = image_tag gravatar_icon(note.author.email), class: "avatar"
3 3 %div.note-author
4 4 %strong= note.author_name
5 5 = link_to "##{dom_id(note)}", name: dom_id(note) do
... ... @@ -7,7 +7,7 @@
7 7 = time_ago_in_words(note.updated_at)
8 8 ago
9 9 - if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project)
10   - = link_to [@project, note], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-note btn very_small" do
  10 + = link_to [@project, note], confirm: 'Are you sure?', method: :delete, remote: true, class: "cred delete-note btn very_small" do
11 11 %i.icon-trash
12 12 Remove
13 13  
... ... @@ -17,5 +17,5 @@
17 17 - if note.attachment.url
18 18 .right
19 19 %div.file
20   - = link_to note.attachment_identifier, note.attachment.url, :target => "_blank"
  20 + = link_to note.attachment_identifier, note.attachment.url, target: "_blank"
21 21 .clear
... ...
app/views/notes/create.js.haml
1 1 - if @note.line_code
2   - = render "create_line", :note => @note
  2 + = render "create_line", note: @note
3 3 - else
4   - = render "create_common", :note => @note
  4 + = render "create_common", note: @note
5 5  
6 6 -# Enable submit button
7 7 :plain
... ...
app/views/notify/new_issue_email.html.haml
1   -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"}
2   - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"}
  1 +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"}
  2 + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
3 3 %tr
4   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
5   - %td{:align => "left", :style => "padding: 20px 0 0;"}
6   - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
  4 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
  5 + %td{align: "left", style: "padding: 20px 0 0;"}
  6 + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
7 7 New Issue was created and assigned to you.
8   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
  8 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
9 9 %tr
10   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
11   - %td{:align => "left", :style => "padding: 20px 0 0;"}
12   - %h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
  10 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
  11 + %td{align: "left", style: "padding: 20px 0 0;"}
  12 + %h2{style: "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
13 13 = "Issue ##{@issue.id}"
14   - = link_to_gfm truncate(@issue.title, :length => 45), project_issue_url(@issue.project, @issue), :title => @issue.title
  14 + = link_to_gfm truncate(@issue.title, length: 45), project_issue_url(@issue.project, @issue), title: @issue.title
15 15 %br
... ...
app/views/notify/new_merge_request_email.html.haml
1   -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"}
2   - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"}
  1 +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"}
  2 + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
3 3 %tr
4   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
5   - %td{:align => "left", :style => "padding: 20px 0 0;"}
6   - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
  4 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
  5 + %td{align: "left", style: "padding: 20px 0 0;"}
  6 + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
7 7 = "New Merge Request !#{@merge_request.id}"
8   - = link_to_gfm truncate(@merge_request.title, :length => 16), project_merge_request_url(@merge_request.project, @merge_request)
9   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
  8 + = link_to_gfm truncate(@merge_request.title, length: 16), project_merge_request_url(@merge_request.project, @merge_request)
  9 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
10 10 %tr
11   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
12   - %td{:style => "padding: 15px 0 15px;", :valign => "top"}
13   - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
  11 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
  12 + %td{style: "padding: 15px 0 15px;", valign: "top"}
  13 + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
14 14 Branches: #{@merge_request.source_branch} &rarr; #{@merge_request.target_branch}
15   - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
  15 + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
16 16 Asignee: #{@merge_request.author_name} &rarr; #{@merge_request.assignee_name}
17 17 %td
18 18  
... ...
app/views/notify/new_user_email.html.haml
1   -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"}
2   - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"}
  1 +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"}
  2 + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
3 3 %tr
4   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
5   - %td{:align => "left", :style => "padding: 20px 0 0;"}
6   - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
  4 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
  5 + %td{align: "left", style: "padding: 20px 0 0;"}
  6 + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
7 7 Hi #{@user['name']}!
8   - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
  8 + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
9 9 Administrator created account for you. Now you are a member of company gitlab application.
10   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
  10 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
11 11 %tr
12   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
13   - %td{:style => "padding: 15px 0 15px;", :valign => "top"}
14   - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 16px;font-family: Helvetica, Arial, sans-serif; "}
  12 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
  13 + %td{style: "padding: 15px 0 15px;", valign: "top"}
  14 + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 16px;font-family: Helvetica, Arial, sans-serif; "}
15 15 login..........................................
16 16 %code= @user['email']
17   - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 16px;font-family: Helvetica, Arial, sans-serif; "}
  17 + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 16px;font-family: Helvetica, Arial, sans-serif; "}
18 18 password..................................
19 19 %code= @password
20   - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
  20 + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
21 21 = link_to "Click here to login", root_url
22   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
  22 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
23 23  
... ...
app/views/notify/note_commit_email.html.haml
1   -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"}
2   - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"}
  1 +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"}
  2 + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
3 3 %tr
4   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
5   - %td{:align => "left", :style => "padding: 20px 0 0;"}
6   - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
  4 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
  5 + %td{align: "left", style: "padding: 20px 0 0;"}
  6 + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
7 7 = "New comment for Commit #{@commit.short_id}"
8   - = link_to_gfm truncate(@commit.title, :length => 16), project_commit_url(@note.project, :id => @commit.id, :anchor => "note_#{@note.id}")
9   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
  8 + = link_to_gfm truncate(@commit.title, length: 16), project_commit_url(@note.project, id: @commit.id, anchor: "note_#{@note.id}")
  9 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
10 10 %tr
11   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
12   - %td{:style => "padding: 15px 0 15px;", :valign => "top"}
13   - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
14   - %a{:href => "#", :style => "color: #0eb6ce; text-decoration: none;"} #{@note.author_name}
  11 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
  12 + %td{style: "padding: 15px 0 15px;", valign: "top"}
  13 + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
  14 + %a{href: "#", style: "color: #0eb6ce; text-decoration: none;"} #{@note.author_name}
15 15 left next message:
16 16 %br
17   - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"}
  17 + %table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"}
18 18 %tr
19   - %td{:valign => "top"}
20   - %div{ :style => "background:#f5f5f5; padding:20px;border:1px solid #ddd" }
  19 + %td{valign: "top"}
  20 + %div{ style: "background:#f5f5f5; padding:20px;border:1px solid #ddd" }
21 21 = markdown(@note.note)
22   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
  22 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
23 23  
... ...
app/views/notify/note_issue_email.html.haml
1   -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"}
2   - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"}
  1 +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"}
  2 + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
3 3 %tr
4   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
5   - %td{:align => "left", :style => "padding: 20px 0 0;"}
6   - %h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
  4 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
  5 + %td{align: "left", style: "padding: 20px 0 0;"}
  6 + %h2{style: "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
7 7 = "New comment for Issue ##{@issue.id}"
8   - = link_to_gfm truncate(@issue.title, :length => 35), project_issue_url(@issue.project, @issue, :anchor => "note_#{@note.id}")
9   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
  8 + = link_to_gfm truncate(@issue.title, length: 35), project_issue_url(@issue.project, @issue, anchor: "note_#{@note.id}")
  9 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
10 10 %tr
11   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
12   - %td{:style => "padding: 15px 0 15px;", :valign => "top"}
13   - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
14   - %a{:href => "#", :style => "color: #0eb6ce; text-decoration: none;"} #{@note.author_name}
  11 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
  12 + %td{style: "padding: 15px 0 15px;", valign: "top"}
  13 + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
  14 + %a{href: "#", style: "color: #0eb6ce; text-decoration: none;"} #{@note.author_name}
15 15 left next message:
16 16 %br
17   - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"}
  17 + %table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"}
18 18 %tr
19   - %td{:valign => "top"}
20   - %div{ :style => "background:#f5f5f5; padding:20px;border:1px solid #ddd" }
  19 + %td{valign: "top"}
  20 + %div{ style: "background:#f5f5f5; padding:20px;border:1px solid #ddd" }
21 21 = markdown(@note.note)
22   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
  22 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
23 23  
... ...
app/views/notify/note_merge_request_email.html.haml
1   -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"}
2   - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"}
  1 +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"}
  2 + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
3 3 %tr
4   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
5   - %td{:align => "left", :style => "padding: 20px 0 0;"}
6   - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
  4 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
  5 + %td{align: "left", style: "padding: 20px 0 0;"}
  6 + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
7 7 = "New comment for Merge Request !#{@merge_request.id}"
8   - = link_to_gfm truncate(@merge_request.title, :length => 16), project_merge_request_url(@merge_request.project, @merge_request, :anchor => "note_#{@note.id}")
9   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
  8 + = link_to_gfm truncate(@merge_request.title, length: 16), project_merge_request_url(@merge_request.project, @merge_request, anchor: "note_#{@note.id}")
  9 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
10 10 %tr
11   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
12   - %td{:style => "padding: 15px 0 15px;", :valign => "top"}
13   - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
14   - %a{:href => "#", :style => "color: #0eb6ce; text-decoration: none;"} #{@note.author_name}
  11 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
  12 + %td{style: "padding: 15px 0 15px;", valign: "top"}
  13 + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
  14 + %a{href: "#", style: "color: #0eb6ce; text-decoration: none;"} #{@note.author_name}
15 15 left next message:
16 16 %br
17   - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"}
  17 + %table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"}
18 18 %tr
19   - %td{:valign => "top"}
20   - %div{ :style => "background:#f5f5f5; padding:20px;border:1px solid #ddd" }
  19 + %td{valign: "top"}
  20 + %div{ style: "background:#f5f5f5; padding:20px;border:1px solid #ddd" }
21 21 = markdown(@note.note)
22   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
  22 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
23 23  
... ...
app/views/notify/note_wall_email.html.haml
1   -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"}
2   - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"}
  1 +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"}
  2 + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
3 3 %tr
4   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
5   - %td{:align => "left", :style => "padding: 20px 0 0;"}
6   - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
  4 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
  5 + %td{align: "left", style: "padding: 20px 0 0;"}
  6 + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
7 7 New message on
8   - = link_to "Project Wall", wall_project_url(@note.project, :anchor => "note_#{@note.id}")
9   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
  8 + = link_to "Project Wall", wall_project_url(@note.project, anchor: "note_#{@note.id}")
  9 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
10 10 %tr
11   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
12   - %td{:style => "padding: 15px 0 15px;", :valign => "top"}
13   - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
14   - %a{:href => "#", :style => "color: #0eb6ce; text-decoration: none;"} #{@note.author_name}
  11 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
  12 + %td{style: "padding: 15px 0 15px;", valign: "top"}
  13 + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
  14 + %a{href: "#", style: "color: #0eb6ce; text-decoration: none;"} #{@note.author_name}
15 15 left next message:
16 16 %br
17   - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"}
  17 + %table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"}
18 18 %tr
19   - %td{:valign => "top"}
20   - %div{ :style => "background:#f5f5f5; padding:20px;border:1px solid #ddd" }
  19 + %td{valign: "top"}
  20 + %div{ style: "background:#f5f5f5; padding:20px;border:1px solid #ddd" }
21 21 = markdown(@note.note)
22   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
  22 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
... ...
app/views/notify/note_wiki_email.html.haml
1   -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"}
2   - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"}
  1 +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"}
  2 + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
3 3 %tr
4   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
5   - %td{:align => "left", :style => "padding: 20px 0 0;"}
6   - %h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
  4 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
  5 + %td{align: "left", style: "padding: 20px 0 0;"}
  6 + %h2{style: "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
7 7 New comment for Wiki page
8   - = link_to_gfm @wiki.title, project_issue_url(@wiki.project, @wiki, :anchor => "note_#{@note.id}")
9   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
  8 + = link_to_gfm @wiki.title, project_issue_url(@wiki.project, @wiki, anchor: "note_#{@note.id}")
  9 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
10 10 %tr
11   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
12   - %td{:style => "padding: 15px 0 15px;", :valign => "top"}
13   - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
14   - %a{:href => "#", :style => "color: #0eb6ce; text-decoration: none;"} #{@note.author_name}
  11 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
  12 + %td{style: "padding: 15px 0 15px;", valign: "top"}
  13 + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
  14 + %a{href: "#", style: "color: #0eb6ce; text-decoration: none;"} #{@note.author_name}
15 15 commented on Wiki page:
16 16 %br
17   - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"}
  17 + %table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"}
18 18 %tr
19   - %td{:valign => "top"}
20   - %div{ :style => "background:#f5f5f5; padding:20px;border:1px solid #ddd" }
  19 + %td{valign: "top"}
  20 + %div{ style: "background:#f5f5f5; padding:20px;border:1px solid #ddd" }
21 21 = markdown(@note.note)
22   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
  22 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
23 23  
... ...
app/views/notify/reassigned_issue_email.html.haml
1   -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"}
2   - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"}
  1 +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"}
  2 + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
3 3 %tr
4   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
5   - %td{:align => "left", :style => "padding: 20px 0 0;"}
6   - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
  4 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
  5 + %td{align: "left", style: "padding: 20px 0 0;"}
  6 + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
7 7 = "Reassigned Issue ##{@issue.id}"
8   - = link_to_gfm truncate(@issue.title, :length => 16), project_issue_url(@issue.project, @issue)
9   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
  8 + = link_to_gfm truncate(@issue.title, length: 16), project_issue_url(@issue.project, @issue)
  9 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
10 10 %tr
11   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
12   - %td{:style => "padding: 15px 0 15px;", :valign => "top"}
13   - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
  11 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
  12 + %td{style: "padding: 15px 0 15px;", valign: "top"}
  13 + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
14 14 Assignee changed from #{@previous_assignee.name} to #{@issue.assignee_name}
15 15 %td
16 16  
... ...
app/views/notify/reassigned_merge_request_email.html.haml
1   -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"}
2   - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"}
  1 +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"}
  2 + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
3 3 %tr
4   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
5   - %td{:align => "left", :style => "padding: 20px 0 0;"}
6   - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
  4 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
  5 + %td{align: "left", style: "padding: 20px 0 0;"}
  6 + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
7 7 = "Reassigned Merge Request !#{@merge_request.id}"
8   - = link_to_gfm truncate(@merge_request.title, :length => 16), project_merge_request_url(@merge_request.project, @merge_request)
9   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
  8 + = link_to_gfm truncate(@merge_request.title, length: 16), project_merge_request_url(@merge_request.project, @merge_request)
  9 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
10 10 %tr
11   - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
12   - %td{:style => "padding: 15px 0 15px;", :valign => "top"}
13   - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
  11 + %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
  12 + %td{style: "padding: 15px 0 15px;", valign: "top"}
  13 + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
14 14 Assignee changed from #{@previous_assignee.name} to #{@merge_request.assignee_name}
15 15 %td
16 16  
... ...
app/views/profile/design.html.haml
1   -= form_for @user, :url => profile_update_path, :remote => true, :method => :put do |f|
  1 += form_for @user, url: profile_update_path, remote: true, method: :put do |f|
2 2 %div
3 3 %h3 Application theme
4 4 %hr
... ... @@ -18,16 +18,16 @@
18 18 %h3 Code review
19 19 %hr
20 20 .row
21   - %label.span3{:for => "user_dark_scheme_false"}
  21 + %label.span3{for: "user_dark_scheme_false"}
22 22 .thumbnail
23   - = image_tag "white.png", :width => 260, :class => "styled_image"
  23 + = image_tag "white.png", width: 260, class: "styled_image"
24 24 .caption
25 25 %h5
26 26 = f.radio_button :dark_scheme, false
27 27 White code preview
28   - %label.span3{:for => "user_dark_scheme_true"}
  28 + %label.span3{for: "user_dark_scheme_true"}
29 29 .thumbnail
30   - = image_tag "dark.png", :width => 260, :class => "styled_image"
  30 + = image_tag "dark.png", width: 260, class: "styled_image"
31 31 .caption
32 32 %h5
33 33 = f.radio_button :dark_scheme, true
... ...
app/views/profile/password.html.haml
1 1 %h3.page_title Password
2 2 %hr
3   -= form_for @user, :url => profile_password_path, :method => :put do |f|
  3 += form_for @user, url: profile_password_path, method: :put do |f|
4 4 .data
5 5 %p.slead After successful password update you will be redirected to login page where you should login with new password
6 6 -if @user.errors.any?
... ... @@ -16,4 +16,4 @@
16 16 = f.label :password_confirmation
17 17 .input= f.password_field :password_confirmation
18 18 .actions
19   - = f.submit 'Save', :class => "btn primary"
  19 + = f.submit 'Save', class: "btn primary"
... ...
app/views/profile/show.html.haml
1 1 .profile_avatar_holder
2   - = image_tag gravatar_icon(@user.email, 90), :class => "styled_image"
  2 + = image_tag gravatar_icon(@user.email, 90), class: "styled_image"
3 3 %h3.page_title
4 4 = @user.name
5 5 %br
... ... @@ -9,7 +9,7 @@
9 9  
10 10 %hr
11 11  
12   -= form_for @user, :url => profile_update_path, :method => :put, :html => { :class => "edit_user form-horizontal" } do |f|
  12 += form_for @user, url: profile_update_path, method: :put, html: { class: "edit_user form-horizontal" } do |f|
13 13 -if @user.errors.any?
14 14 %div.alert-message.block-message.error
15 15 %ul
... ... @@ -18,30 +18,30 @@
18 18 .row
19 19 .span7
20 20 .control-group
21   - = f.label :name, :class => "control-label"
  21 + = f.label :name, class: "control-label"
22 22 .controls
23   - = f.text_field :name, :class => "input-xlarge"
  23 + = f.text_field :name, class: "input-xlarge"
24 24 %span.help-block Enter your name, so people you know can recognize you.
25 25 .control-group
26   - = f.label :email, :class => "control-label"
  26 + = f.label :email, class: "control-label"
27 27 .controls
28   - = f.text_field :email, :class => "input-xlarge"
  28 + = f.text_field :email, class: "input-xlarge"
29 29 %span.help-block We also use email for avatar detection.
30 30  
31 31 %hr
32 32 .control-group
33   - = f.label :skype, :class => "control-label"
34   - .controls= f.text_field :skype, :class => "input-xlarge"
  33 + = f.label :skype, class: "control-label"
  34 + .controls= f.text_field :skype, class: "input-xlarge"
35 35 .control-group
36   - = f.label :linkedin, :class => "control-label"
37   - .controls= f.text_field :linkedin, :class => "input-xlarge"
  36 + = f.label :linkedin, class: "control-label"
  37 + .controls= f.text_field :linkedin, class: "input-xlarge"
38 38 .control-group
39   - = f.label :twitter, :class => "control-label"
40   - .controls= f.text_field :twitter, :class => "input-xlarge"
  39 + = f.label :twitter, class: "control-label"
  40 + .controls= f.text_field :twitter, class: "input-xlarge"
41 41 .control-group
42   - = f.label :bio, :class => "control-label"
  42 + = f.label :bio, class: "control-label"
43 43 .controls
44   - = f.text_area :bio, :rows => 6, :class => "input-xlarge", :maxlength => 250
  44 + = f.text_area :bio, rows: 6, class: "input-xlarge", maxlength: 250
45 45 %span.help-block Tell us about yourself in fewer than 250 characters.
46 46 .span5.right
47 47  
... ... @@ -56,14 +56,14 @@
56 56 of
57 57 %span= current_user.projects_limit
58 58 .progress
59   - .bar{:style => "width: #{current_user.projects_limit_percent}%;"}
  59 + .bar{style: "width: #{current_user.projects_limit_percent}%;"}
60 60  
61 61 %h4
62 62 SSH public keys:
63 63 %small.right
64 64 %span= link_to current_user.keys.count, keys_path
65 65  
66   - = link_to "Add Public Key", new_key_path, :class => "btn small right"
  66 + = link_to "Add Public Key", new_key_path, class: "btn small right"
67 67  
68 68 .form-actions
69   - = f.submit 'Save', :class => "btn-primary btn"
  69 + = f.submit 'Save', class: "btn-primary btn"
... ...
app/views/profile/token.html.haml
... ... @@ -3,7 +3,7 @@
3 3 %span.cred.right
4 4 keep it in secret!
5 5 %hr
6   -= form_for @user, :url => profile_reset_private_token_path, :method => :put do |f|
  6 += form_for @user, url: profile_reset_private_token_path, method: :put do |f|
7 7 .data
8 8 %p.slead
9 9 Private token used to access application resources without authentication.
... ... @@ -11,13 +11,13 @@
11 11 It can be used for atom feed or API
12 12 %p.cgray
13 13 - if current_user.private_token
14   - = text_field_tag "token", current_user.private_token, :class => "xxlarge large_text"
  14 + = text_field_tag "token", current_user.private_token, class: "xxlarge large_text"
15 15 - else
16 16 You don`t have one yet. Click generate to fix it.
17 17 .actions
18 18 - if current_user.private_token
19   - = f.submit 'Reset', :confirm => "Are you sure?", :class => "btn"
  19 + = f.submit 'Reset', confirm: "Are you sure?", class: "btn"
20 20 - else
21   - = f.submit 'Generate', :class => "btn primary"
  21 + = f.submit 'Generate', class: "btn primary"
22 22  
23 23  
... ...
app/views/projects/_form.html.haml
1   -= form_for(@project, :remote => true) do |f|
  1 += form_for(@project, remote: true) do |f|
2 2 - if @project.errors.any?
3 3 .alert-message.block-message.error
4 4 %ul
... ... @@ -8,7 +8,7 @@
8 8 = f.label :name do
9 9 Project name is
10 10 .input
11   - = f.text_field :name, :placeholder => "Example Project", :class => "xxlarge"
  11 + = f.text_field :name, placeholder: "Example Project", class: "xxlarge"
12 12  
13 13 %h5.page_title
14 14 .alert.alert-info
... ... @@ -19,19 +19,19 @@
19 19 .input
20 20 .input-prepend
21 21 %strong
22   - = text_field_tag :ppath, @project.path_to_repo, :class => "xlarge", :disabled => true
  22 + = text_field_tag :ppath, @project.path_to_repo, class: "xlarge", disabled: true
23 23 .clearfix
24 24 = f.label :code do
25 25 URL
26 26 .input
27 27 .input-prepend
28 28 %span.add-on= web_app_url
29   - = f.text_field :code, :placeholder => "example"
  29 + = f.text_field :code, placeholder: "example"
30 30  
31 31 - unless @project.new_record? || @project.heads.empty?
32 32 .clearfix
33 33 = f.label :default_branch, "Default Branch"
34   - .input= f.select(:default_branch, @project.heads.map(&:name), {}, :style => "width:210px;")
  34 + .input= f.select(:default_branch, @project.heads.map(&:name), {}, style: "width:210px;")
35 35  
36 36 - unless @project.new_record?
37 37 .alert.alert-info
... ... @@ -56,8 +56,8 @@
56 56 %br
57 57  
58 58 .actions
59   - = f.submit 'Save', :class => "btn primary"
60   - = link_to 'Cancel', @project, :class => "btn"
  59 + = f.submit 'Save', class: "btn primary"
  60 + = link_to 'Cancel', @project, class: "btn"
61 61 - unless @project.new_record?
62 62 .right
63   - = link_to 'Remove', @project, :confirm => 'Are you sure?', :method => :delete, :class => "btn danger"
  63 + = link_to 'Remove', @project, confirm: 'Are you sure?', method: :delete, class: "btn danger"
... ...
app/views/projects/_new_form.html.haml
1   -= form_for(@project, :remote => true) do |f|
  1 += form_for(@project, remote: true) do |f|
2 2 - if @project.errors.any?
3 3 .alert-message.block-message.error
4 4 %span= @project.errors.full_messages.first
... ... @@ -6,8 +6,8 @@
6 6 = f.label :name do
7 7 Project name is
8 8 .input
9   - = f.text_field :name, :placeholder => "Example Project", :class => "xxlarge"
10   - = f.submit 'Create project', :class => "btn primary"
  9 + = f.text_field :name, placeholder: "Example Project", class: "xxlarge"
  10 + = f.submit 'Create project', class: "btn primary"
11 11  
12 12 %hr
13 13 .alert.alert-info
... ... @@ -18,7 +18,7 @@
18 18 .input
19 19 .input-prepend
20 20 %span.add-on= Gitlab.config.ssh_path
21   - = f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record?
  21 + = f.text_field :path, placeholder: "example_project", disabled: !@project.new_record?
22 22 %span.add-on= ".git"
23 23 .clearfix
24 24 = f.label :code do
... ... @@ -26,4 +26,4 @@
26 26 .input
27 27 .input-prepend
28 28 %span.add-on= web_app_url
29   - = f.text_field :code, :placeholder => "example"
  29 + = f.text_field :code, placeholder: "example"
... ...
app/views/projects/_project_head.html.haml
1 1 %ul.nav.nav-tabs
2   - %li{ :class => "#{'active' if current_page?(project_path(@project)) }" }
3   - = link_to project_path(@project), :class => "activities-tab tab" do
  2 + %li{ class: "#{'active' if current_page?(project_path(@project)) }" }
  3 + = link_to project_path(@project), class: "activities-tab tab" do
4 4 %i.icon-home
5 5 Show
6   - %li{ :class => " #{'active' if (controller.controller_name == "team_members") || current_page?(team_project_path(@project)) }" }
7   - = link_to team_project_path(@project), :class => "team-tab tab" do
  6 + %li{ class: " #{'active' if (controller.controller_name == "team_members") || current_page?(team_project_path(@project)) }" }
  7 + = link_to team_project_path(@project), class: "team-tab tab" do
8 8 %i.icon-user
9 9 Team
10   - %li{ :class => "#{'active' if current_page?(files_project_path(@project)) }" }
11   - = link_to files_project_path(@project), :class => "files-tab tab " do
  10 + %li{ class: "#{'active' if current_page?(files_project_path(@project)) }" }
  11 + = link_to files_project_path(@project), class: "files-tab tab " do
12 12 Attachments
13   - %li{ :class => " #{'active' if (controller.controller_name == "snippets") }" }
14   - = link_to project_snippets_path(@project), :class => "snippets-tab tab" do
  13 + %li{ class: " #{'active' if (controller.controller_name == "snippets") }" }
  14 + = link_to project_snippets_path(@project), class: "snippets-tab tab" do
15 15 Snippets
16 16  
17 17 - if can? current_user, :admin_project, @project
18   - %li.right{:class => "#{'active' if controller.controller_name == "deploy_keys"}"}
  18 + %li.right{class: "#{'active' if controller.controller_name == "deploy_keys"}"}
19 19 = link_to project_deploy_keys_path(@project) do
20 20 %span
21 21 Deploy Keys
22   - %li.right{:class => "#{'active' if controller.controller_name == "hooks" }"}
  22 + %li.right{class: "#{'active' if controller.controller_name == "hooks" }"}
23 23 = link_to project_hooks_path(@project) do
24 24 %span
25 25 Hooks
26   - %li.right{ :class => "#{'active' if current_page?(edit_project_path(@project)) }" }
27   - = link_to edit_project_path(@project), :class => "stat-tab tab " do
  26 + %li.right{ class: "#{'active' if current_page?(edit_project_path(@project)) }" }
  27 + = link_to edit_project_path(@project), class: "stat-tab tab " do
28 28 %i.icon-edit
29 29 Edit
... ...
app/views/projects/_refs.html.haml
1   -= form_tag switch_project_refs_path(@project), :method => :get, :class => "project-refs-form" do
2   - = select_tag "ref", grouped_options_refs, :onchange => "this.form.submit();", :class => "project-refs-select"
  1 += form_tag switch_project_refs_path(@project), method: :get, class: "project-refs-form" do
  2 + = select_tag "ref", grouped_options_refs, onchange: "this.form.submit();", class: "project-refs-select"
3 3 = hidden_field_tag :destination, destination
4 4  
5 5 :javascript
... ...
app/views/projects/_show.html.haml
... ... @@ -2,9 +2,9 @@
2 2 = @project.name
3 3 %br
4 4 %div
5   - %a.btn.info{:href => tree_project_ref_path(@project, @project.root_ref)} Browse code
  5 + %a.btn.info{href: tree_project_ref_path(@project, @project.root_ref)} Browse code
6 6 &nbsp;
7   - %a.btn{:href => project_commits_path(@project)} Commits
  7 + %a.btn{href: project_commits_path(@project)} Commits
8 8 %strong.right
9 9 = link_to project_path(@project) do
10 10 Switch to project &rarr;
... ... @@ -13,7 +13,7 @@
13 13 .input
14 14 .input-prepend
15 15 %span.add-on git clone
16   - = text_field_tag :project_clone, @project.url_to_repo, :class => "xlarge one_click_select git_clone_url"
  16 + = text_field_tag :project_clone, @project.url_to_repo, class: "xlarge one_click_select git_clone_url"
17 17  
18 18 = simple_format @project.description
19 19 - unless @events.blank?
... ...
app/views/projects/_team.html.haml
... ... @@ -5,7 +5,7 @@
5 5 %th Permissions
6 6 %tbody
7 7 - @project.users_projects.each do |up|
8   - = render(:partial => 'team_members/show', :locals => {:member => up})
  8 + = render(partial: 'team_members/show', locals: {member: up})
9 9  
10 10  
11 11 :javascript
... ...
app/views/projects/create.js.haml
1 1 - if @project.saved?
2 2 :plain
3   - location.href = "#{project_path(@project, :notice => 'Project was successfully created.')}";
  3 + location.href = "#{project_path(@project, notice: 'Project was successfully created.')}";
4 4 - else
5 5 - if @project.git_error?
6 6 location.href = "#{errors_githost_path}";
... ...
app/views/projects/empty.html.haml
... ... @@ -16,7 +16,7 @@
16 16 - setup_str = ["git config --global user.name \"#{current_user.name}\"",
17 17 "git config --global user.email \"#{current_user.email}\""].join("\n")
18 18 = preserve do
19   - = raw bash_lexer.highlight(setup_str, :lexer => 'bash', :options => {:encoding => 'utf-8'})
  19 + = raw bash_lexer.highlight(setup_str, lexer: 'bash', options: {encoding: 'utf-8'})
20 20  
21 21 %br
22 22 %br
... ... @@ -44,4 +44,4 @@
44 44  
45 45 - if can? current_user, :admin_project, @project
46 46 .alert-message.block-message.error.prepend-top-20
47   - = link_to 'Remove project', @project, :confirm => 'Are you sure?', :method => :delete, :class => "btn danger"
  47 + = link_to 'Remove project', @project, confirm: 'Are you sure?', method: :delete, class: "btn danger"
... ...
app/views/projects/files.html.haml
... ... @@ -4,8 +4,8 @@
4 4 - @notes.each do |note|
5 5 %tr
6 6 %td
7   - %a{:href => note.attachment.url}
8   - = image_tag gravatar_icon(note.author_email), :class => "left", :width => 16
  7 + %a{href: note.attachment.url}
  8 + = image_tag gravatar_icon(note.author_email), class: "left", width: 16
9 9 &nbsp;
10 10 = note.attachment_identifier
11 11 %td
... ...
app/views/projects/show.html.haml
... ... @@ -7,23 +7,23 @@
7 7 .input-prepend.project_clone_holder
8 8  
9 9 %span.add-on git clone
10   - = link_to "SSH", "#", :class => "btn small active", :"data-clone" => @project.ssh_url_to_repo
11   - = link_to "HTTP", "#", :class => "btn small", :"data-clone" => @project.http_url_to_repo
12   - = text_field_tag :project_clone, @project.url_to_repo, :class => "one_click_select span5"
  10 + = link_to "SSH", "#", class: "btn small active", :"data-clone" => @project.ssh_url_to_repo
  11 + = link_to "HTTP", "#", class: "btn small", :"data-clone" => @project.http_url_to_repo
  12 + = text_field_tag :project_clone, @project.url_to_repo, class: "one_click_select span5"
13 13 .span4.right
14 14 .right
15 15 - if can? current_user, :download_code, @project
16   - = link_to archive_project_repository_path(@project), :class => "btn small grouped" do
  16 + = link_to archive_project_repository_path(@project), class: "btn small grouped" do
17 17 %i.icon-download-alt
18 18 Download
19 19 - if @project.merge_requests_enabled && can?(current_user, :write_merge_request, @project)
20   - = link_to new_project_merge_request_path(@project), :title => "New Merge Request", :class => "btn small grouped" do
  20 + = link_to new_project_merge_request_path(@project), title: "New Merge Request", class: "btn small grouped" do
21 21 Merge Request
22 22 - if @project.issues_enabled && can?(current_user, :write_issue, @project)
23   - = link_to new_project_issue_path(@project), :title => "New Issue", :class => "btn small grouped" do
  23 + = link_to new_project_issue_path(@project), title: "New Issue", class: "btn small grouped" do
24 24 Issue
25 25  
26   -= render "events/event_last_push", :event => @last_push
  26 += render "events/event_last_push", event: @last_push
27 27 .content_list= render @events
28 28  
29 29 :javascript
... ...
app/views/projects/team.html.haml
... ... @@ -5,11 +5,11 @@
5 5  
6 6 - if can? current_user, :admin_team_member, @project
7 7 %p.slead
8   - = link_to new_project_team_member_path(@project), :class => "btn small right", :title => "New Team Member" do
  8 + = link_to new_project_team_member_path(@project), class: "btn small right", title: "New Team Member" do
9 9 New Team Member
10 10 Read more about project permissions
11   - %strong= link_to "here", help_permissions_path, :class => "vlink"
  11 + %strong= link_to "here", help_permissions_path, class: "vlink"
12 12  
13 13  
14   -= render :partial => "team", :locals => {:project => @project}
  14 += render partial: "team", locals: {project: @project}
15 15  
... ...
app/views/projects/tree.js.haml
1 1 :plain
2 2 $("#tree-holder table").hide("slide", { direction: "left" }, 150, function(){
3   - $("#tree-holder").html("#{escape_javascript(render(:partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree}))}");
  3 + $("#tree-holder").html("#{escape_javascript(render(partial: "tree", locals: {repo: @repo, commit: @commit, tree: @tree}))}");
4 4 $("#tree-holder table").show("slide", { direction: "right" }, 150);
5 5 });
... ...
app/views/projects/update.js.haml
1 1 - if @project.valid?
2 2 :plain
3   - location.href = "#{edit_project_path(@project, :notice => 'Project was successfully updated.')}";
  3 + location.href = "#{edit_project_path(@project, notice: 'Project was successfully updated.')}";
4 4 - else
5 5 :plain
6 6 $('.project_edit_holder').show();
... ...
app/views/projects/wall.html.haml
1 1 %div.wall_page
2   - = render "notes/notes", :tid => nil, :tt => "wall"
  2 + = render "notes/notes", tid: nil, tt: "wall"
... ...
app/views/protected_branches/index.html.haml
1 1 = render "repositories/branches_head"
2 2  
3 3 .alert
4   - %p Protected branches designed to prevent push for all except #{link_to "masters", help_permissions_path, :class => "vlink"}.
  4 + %p Protected branches designed to prevent push for all except #{link_to "masters", help_permissions_path, class: "vlink"}.
5 5 %p This ability allows:
6 6 %ul
7 7 %li keep stable branches secured
8 8 %li forced code review before merge to protected branches
9   - %p Read more about project permissions #{link_to "here", help_permissions_path, :class => "vlink"}
  9 + %p Read more about project permissions #{link_to "here", help_permissions_path, class: "vlink"}
10 10  
11 11 - if can? current_user, :admin_project, @project
12 12 = form_for [@project, @protected_branch] do |f|
... ... @@ -19,9 +19,9 @@
19 19 .entry.clearfix
20 20 = f.label :name, "Branch"
21 21 .span3
22   - = f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , { :include_blank => "-- Select branch" }, { :class => "span3" })
  22 + = f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , { include_blank: "-- Select branch" }, { class: "span3" })
23 23 &nbsp;
24   - = f.submit 'Protect', :class => "primary btn"
  24 + = f.submit 'Protect', class: "primary btn"
25 25  
26 26 - unless @branches.empty?
27 27 %table.admin-table
... ... @@ -34,18 +34,18 @@
34 34 - @branches.each do |branch|
35 35 %tr
36 36 %td
37   - = link_to project_commits_path(@project, :ref => branch.name) do
  37 + = link_to project_commits_path(@project, ref: branch.name) do
38 38 %strong= branch.name
39 39 - if branch.name == @project.root_ref
40 40 %span.label default
41 41 %td
42 42 = link_to project_commit_path(@project, branch.commit.id) do
43   - = truncate branch.commit.id.to_s, :length => 10
  43 + = truncate branch.commit.id.to_s, length: 10
44 44 = time_ago_in_words(branch.commit.committed_date)
45 45 ago
46 46 %td
47 47 - if can? current_user, :admin_project, @project
48   - = link_to 'Unprotect', [@project, branch], :confirm => 'Are you sure?', :method => :delete, :class => "danger btn small"
  48 + = link_to 'Unprotect', [@project, branch], confirm: 'Are you sure?', method: :delete, class: "danger btn small"
49 49  
50 50 :javascript
51 51 $('select#protected_branch_name').chosen();
... ...
app/views/refs/_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", :remote => true 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", remote: true do
  4 + = select_tag "ref", grouped_options_refs, onchange: "$(this.form).trigger('submit');", class: "project-refs-select"
5 5 = hidden_field_tag :destination, "tree"
6 6 = hidden_field_tag :path, params[:path]
7   - %li{:class => "#{'active' if (controller.controller_name == "refs") }"}
  7 + %li{class: "#{'active' if (controller.controller_name == "refs") }"}
8 8 = link_to tree_project_ref_path(@project, @ref) do
9 9 Source
10 10  
... ...
app/views/refs/_submodule_item.html.haml
1 1 - url = content.url(@ref) rescue nil
2 2 - name = content.basename
3 3 - return unless url
4   -%tr{ :class => "tree-item", :url => url }
  4 +%tr{ class: "tree-item", url: url }
5 5 %td.tree-item-file-name
6 6 = image_tag "submodule.png"
7   - %strong= truncate(name, :length => 40)
  7 + %strong= truncate(name, length: 40)
8 8 %td
9 9 %code= content.id[0..10]
10 10 %td
11   - = link_to truncate(url, :length => 40), url
  11 + = link_to truncate(url, length: 40), url
12 12  
13 13  
... ...
app/views/refs/_tree.html.haml
1 1 %ul.breadcrumb
2 2 %li
3 3 %span.arrow
4   - = link_to tree_project_ref_path(@project, @ref, :path => nil), :remote => true do
  4 + = link_to tree_project_ref_path(@project, @ref, path: nil), remote: true do
5 5 = @project.name
6 6 - tree.breadcrumbs(6) do |link|
7 7 \/
... ... @@ -10,32 +10,32 @@
10 10 %div.tree_progress
11 11 #tree-content-holder
12 12 - if tree.is_blob?
13   - = render :partial => "refs/tree_file", :locals => { :name => tree.name, :content => tree.data, :file => tree }
  13 + = render partial: "refs/tree_file", locals: { name: tree.name, content: tree.data, file: tree }
14 14 - else
15 15 - contents = tree.contents
16   - %table#tree-slider.bordered-table.table{:class => "table_#{@hex_path}" }
  16 + %table#tree-slider.bordered-table.table{class: "table_#{@hex_path}" }
17 17 %thead
18 18 %th Name
19 19 %th Last Update
20 20 %th
21 21 Last commit
22   - = link_to "History", tree.history_path, :class => "right"
  22 + = link_to "History", tree.history_path, class: "right"
23 23  
24 24 - if tree.up_dir?
25   - %tr{ :class => "tree-item", :url => tree.up_dir_path }
  25 + %tr{ class: "tree-item", url: tree.up_dir_path }
26 26 %td.tree-item-file-name
27 27 = image_tag "file_empty.png"
28   - = link_to "..", tree.up_dir_path, :remote => :true
  28 + = link_to "..", tree.up_dir_path, remote: :true
29 29 %td
30 30 %td
31 31  
32 32 - index = 0
33 33 - contents.select{ |i| i.is_a?(Grit::Tree)}.each do |content|
34   - = render :partial => "refs/tree_item", :locals => { :content => content, :index => (index += 1) }
  34 + = render partial: "refs/tree_item", locals: { content: content, index: (index += 1) }
35 35 - contents.select{ |i| i.is_a?(Grit::Blob)}.each do |content|
36   - = render :partial => "refs/tree_item", :locals => { :content => content, :index => (index += 1) }
  36 + = render partial: "refs/tree_item", locals: { content: content, index: (index += 1) }
37 37 - contents.select{ |i| i.is_a?(Grit::Submodule)}.each do |content|
38   - = render :partial => "refs/submodule_item", :locals => { :content => content, :index => (index += 1) }
  38 + = render partial: "refs/submodule_item", locals: { content: content, index: (index += 1) }
39 39  
40 40 - if content = contents.select{ |c| c.is_a?(Grit::Blob) and c.name =~ /^readme/i }.first
41 41 .file_holder#README
... ...
app/views/refs/_tree_commit.html.haml
1 1 - if tm
2 2 %strong= link_to "[#{tm.user_name}]", project_team_member_path(@project, tm)
3   -= link_to_gfm truncate(content_commit.title, :length => tm ? 30 : 50), project_commit_path(@project, content_commit.id), :class => "tree-commit-link"
  3 += link_to_gfm truncate(content_commit.title, length: tm ? 30 : 50), project_commit_path(@project, content_commit.id), class: "tree-commit-link"
... ...
app/views/refs/_tree_file.html.haml
... ... @@ -5,9 +5,9 @@
5 5 = name
6 6 %small #{file.mode}
7 7 %span.options
8   - = link_to "raw", blob_project_ref_path(@project, @ref, :path => params[:path]), :class => "btn very_small", :target => "_blank"
9   - = link_to "history", project_commits_path(@project, :path => params[:path], :ref => @ref), :class => "btn very_small"
10   - = link_to "blame", blame_file_project_ref_path(@project, @ref, :path => params[:path]), :class => "btn very_small"
  8 + = link_to "raw", blob_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small", target: "_blank"
  9 + = link_to "history", project_commits_path(@project, path: params[:path], ref: @ref), class: "btn very_small"
  10 + = link_to "blame", blame_file_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small"
11 11 - if file.text?
12 12 - if name =~ /\.(md|markdown)$/i
13 13 .file_content.wiki
... ... @@ -16,7 +16,7 @@
16 16 - else
17 17 .file_content.code
18 18 - unless file.empty?
19   - %div{:class => current_user.dark_scheme ? "black" : "white"}
  19 + %div{class: current_user.dark_scheme ? "black" : "white"}
20 20 = preserve do
21 21 = raw file.colorize(options: { linenos: 'True'})
22 22 - else
... ... @@ -24,14 +24,14 @@
24 24  
25 25 - elsif file.image?
26 26 .file_content.image_file
27   - %img{ :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
  27 + %img{ src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
28 28  
29 29 - else
30 30 .file_content.blob_file
31 31 %center
32   - = link_to blob_project_ref_path(@project, @ref, :path => params[:path]) do
  32 + = link_to blob_project_ref_path(@project, @ref, path: params[:path]) do
33 33 %div.padded
34 34 %br
35   - = image_tag "download.png", :width => 64
  35 + = image_tag "download.png", width: 64
36 36 %h3
37 37 Download (#{file.mb_size})
... ...
app/views/refs/_tree_item.html.haml
1 1 - file = tree_full_path(content)
2   -%tr{ :class => "tree-item #{tree_hex_class(content)}", :url => tree_file_project_ref_path(@project, @ref, file) }
  2 +%tr{ class: "tree-item #{tree_hex_class(content)}", url: tree_file_project_ref_path(@project, @ref, file) }
3 3 %td.tree-item-file-name
4 4 = tree_icon(content)
5   - = link_to truncate(content.name, :length => 40), tree_file_project_ref_path(@project, @ref || @commit.id, file), :remote => :true
  5 + = link_to truncate(content.name, length: 40), tree_file_project_ref_path(@project, @ref || @commit.id, file), remote: :true
6 6 %td.tree_time_ago.cgray
7 7 - if index == 1
8 8 %span.log_loading
9 9 Loading commit data..
10   - = image_tag "ajax_loader_tree.gif", :width => 14
  10 + = image_tag "ajax_loader_tree.gif", width: 14
11 11 %td.tree_commit
... ...
app/views/refs/blame.html.haml
... ... @@ -4,7 +4,7 @@
4 4 %ul.breadcrumb
5 5 %li
6 6 %span.arrow
7   - = link_to tree_project_ref_path(@project, @ref, :path => nil) do
  7 + = link_to tree_project_ref_path(@project, @ref, path: nil) do
8 8 = @project.name
9 9 - @tree.breadcrumbs(6) do |link|
10 10 \/
... ... @@ -18,9 +18,9 @@
18 18 = @tree.name
19 19 %small blame
20 20 %span.options
21   - = link_to "raw", blob_project_ref_path(@project, @ref, :path => params[:path]), :class => "btn very_small", :target => "_blank"
22   - = link_to "history", project_commits_path(@project, :path => params[:path], :ref => @ref), :class => "btn very_small"
23   - = link_to "source", tree_file_project_ref_path(@project, @ref, :path => params[:path]), :class => "btn very_small"
  21 + = link_to "raw", blob_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small", target: "_blank"
  22 + = link_to "history", project_commits_path(@project, path: params[:path], ref: @ref), class: "btn very_small"
  23 + = link_to "source", tree_file_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small"
24 24 .file_content.blame
25 25 %table
26 26 - @blame.each do |commit, lines|
... ... @@ -32,8 +32,8 @@
32 32 = commit.author_name
33 33 %td.blame_commit
34 34 &nbsp;
35   - %code= link_to commit.short_id, project_commit_path(@project, :id => commit.id)
36   - = link_to_gfm truncate(commit.title, :length => 30), project_commit_path(@project, :id => commit.id), :class => "row_title" rescue "--broken encoding"
  35 + %code= link_to commit.short_id, project_commit_path(@project, id: commit.id)
  36 + = link_to_gfm truncate(commit.title, length: 30), project_commit_path(@project, id: commit.id), class: "row_title" rescue "--broken encoding"
37 37 %td.lines
38 38 = preserve do
39 39 %pre
... ...
app/views/refs/logs_tree.js.haml
... ... @@ -6,4 +6,4 @@
6 6 :plain
7 7 var row = $("table.table_#{@hex_path} tr.file_#{hexdigest(file_name)}");
8 8 row.find("td.tree_time_ago").html('#{escape_javascript(time_ago_in_words(content_commit.committed_date))} ago');
9   - row.find("td.tree_commit").html('#{escape_javascript(render("tree_commit", :tm => tm, :content_commit => content_commit))}');
  9 + row.find("td.tree_commit").html('#{escape_javascript(render("tree_commit", tm: tm, content_commit: content_commit))}');
... ...
app/views/refs/tree.html.haml
1 1 = render "head"
2   -#tree-holder= render :partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree}
  2 +#tree-holder= render partial: "tree", locals: {repo: @repo, commit: @commit, tree: @tree}
3 3  
4 4 :javascript
5 5 $(function() {
... ...
app/views/refs/tree.js.haml
1 1 :plain
2 2 // Load Files list
3   - $("#tree-holder").html("#{escape_javascript(render(:partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree}))}");
  3 + $("#tree-holder").html("#{escape_javascript(render(partial: "tree", locals: {repo: @repo, commit: @commit, tree: @tree}))}");
4 4 $("#tree-content-holder").show("slide", { direction: "right" }, 150);
5 5 $('.project-refs-form #path').val("#{params[:path]}");
6 6  
... ...
app/views/repositories/_branch.html.haml
... ... @@ -2,20 +2,20 @@
2 2 - commit = CommitDecorator.decorate(commit)
3 3 %tr
4 4 %td
5   - = link_to project_commits_path(@project, :ref => branch.name) do
6   - %strong= truncate(branch.name, :length => 60)
  5 + = link_to project_commits_path(@project, ref: branch.name) do
  6 + %strong= truncate(branch.name, length: 60)
7 7 - if branch.name == @project.root_ref
8 8 %span.label default
9 9 %td
10   - = link_to project_commit_path(@project, :id => commit.id) do
  10 + = link_to project_commit_path(@project, id: commit.id) do
11 11 %code= commit.short_id
12 12  
13   - = image_tag gravatar_icon(commit.author_email), :class => "", :width => 16
14   - = gfm truncate(commit.title, :length => 40)
  13 + = image_tag gravatar_icon(commit.author_email), class: "", width: 16
  14 + = gfm truncate(commit.title, length: 40)
15 15 %span.update-author.right
16 16 = time_ago_in_words(commit.committed_date)
17 17 ago
18 18 %td
19 19 - if can? current_user, :download_code, @project
20   - = link_to "Download", archive_project_repository_path(@project, :ref => branch.name), :class => "visible_link download_repo_link"
  20 + = link_to "Download", archive_project_repository_path(@project, ref: branch.name), class: "visible_link download_repo_link"
21 21  
... ...
app/views/repositories/_branches_head.html.haml
1 1 = render "commits/head"
2 2 %ul.nav.nav-pills
3   - %li{:class => ("active" if current_page?(project_repository_path(@project)))}
  3 + %li{class: ("active" if current_page?(project_repository_path(@project)))}
4 4 = link_to project_repository_path(@project) do
5 5 Recent
6   - %li{:class => ("active" if current_page?(project_protected_branches_path(@project)))}
  6 + %li{class: ("active" if current_page?(project_protected_branches_path(@project)))}
7 7 = link_to project_protected_branches_path(@project) do
8 8 Protected
9   - %li{:class => ("active" if current_page?(branches_project_repository_path(@project)))}
  9 + %li{class: ("active" if current_page?(branches_project_repository_path(@project)))}
10 10 = link_to branches_project_repository_path(@project) do
11 11 All
... ...
app/views/repositories/_feed.html.haml
... ... @@ -2,7 +2,7 @@
2 2 - commit = CommitDecorator.new(commit)
3 3 %tr
4 4 %td
5   - = link_to project_commits_path(@project, :ref => commit.head.name) do
  5 + = link_to project_commits_path(@project, ref: commit.head.name) do
6 6 %strong
7 7 = commit.head.name
8 8 - if commit.head.name == @project.root_ref
... ... @@ -12,8 +12,8 @@
12 12 %div
13 13 = link_to project_commits_path(@project, commit.id) do
14 14 %code= commit.short_id
15   - = image_tag gravatar_icon(commit.author_email), :class => "", :width => 16
16   - = gfm truncate(commit.title, :length => 40)
  15 + = image_tag gravatar_icon(commit.author_email), class: "", width: 16
  16 + = gfm truncate(commit.title, length: 40)
17 17 %td
18 18 %span.right.cgray
19 19 = time_ago_in_words(commit.committed_date)
... ...
app/views/repositories/branches.html.haml
... ... @@ -9,4 +9,4 @@
9 9  
10 10 %tbody
11 11 - @branches.each do |branch|
12   - = render "repositories/branch", :branch => branch
  12 + = render "repositories/branch", branch: branch
... ...
app/views/repositories/show.html.haml
... ... @@ -7,5 +7,5 @@
7 7 %th Last commit
8 8 %th
9 9 - @activities.each do |update|
10   - = render "repositories/branch", :branch => update.head
  10 + = render "repositories/branch", branch: update.head
11 11  
... ...
app/views/repositories/tags.html.haml
... ... @@ -12,12 +12,12 @@
12 12 - commit = CommitDecorator.decorate(commit)
13 13 %tr
14 14 %td
15   - %strong= link_to tag.name, project_commits_path(@project, :ref => tag.name), :class => ""
  15 + %strong= link_to tag.name, project_commits_path(@project, ref: tag.name), class: ""
16 16 %td
17 17 = link_to project_commit_path(@project, commit.id) do
18 18 %code= commit.short_id
19   - = image_tag gravatar_icon(commit.author_email), :class => "", :width => 16
20   - = gfm truncate(commit.title, :length => 40)
  19 + = image_tag gravatar_icon(commit.author_email), class: "", width: 16
  20 + = gfm truncate(commit.title, length: 40)
21 21 %td
22 22 %span.update-author.right
23 23 = time_ago_in_words(commit.committed_date)
... ... @@ -25,7 +25,7 @@
25 25 &nbsp;
26 26 %td
27 27 - if can? current_user, :download_code, @project
28   - = link_to "Download", archive_project_repository_path(@project, :ref => tag.name), :class => "visible_link download_repo_link"
  28 + = link_to "Download", archive_project_repository_path(@project, ref: tag.name), class: "visible_link download_repo_link"
29 29  
30 30 - else
31 31 %h3 No tags
... ...
app/views/search/show.html.haml
1   -= form_tag search_path, :method => :get do |f|
  1 += form_tag search_path, method: :get do |f|
2 2 .padded
3 3 = label_tag :search do
4 4 %strong Looking for
5 5 .input
6   - = text_field_tag :search, params[:search], :placeholder => "issue 143", :class => "input-xxlarge", :id => "dashboard_search"
7   - = submit_tag 'Search', :class => "btn btn-primary"
  6 + = text_field_tag :search, params[:search], placeholder: "issue 143", class: "input-xxlarge", id: "dashboard_search"
  7 + = submit_tag 'Search', class: "btn btn-primary"
8 8 - if params[:search].present?
9 9 %br
10 10 %h3
... ... @@ -41,7 +41,7 @@
41 41 = link_to [merge_request.project, merge_request] do
42 42 %span.badge.badge-info ##{merge_request.id}
43 43 &ndash;
44   - %strong.term= truncate merge_request.title, :length => 50
  44 + %strong.term= truncate merge_request.title, length: 50
45 45 %strong.right
46 46 %span.label= merge_request.project.name
47 47 - if @merge_requests.blank?
... ... @@ -59,7 +59,7 @@
59 59 = link_to [issue.project, issue] do
60 60 %span.badge.badge-info ##{issue.id}
61 61 &ndash;
62   - %strong.term= truncate issue.title, :length => 40
  62 + %strong.term= truncate issue.title, length: 40
63 63 %strong.right
64 64 %span.label= issue.project.name
65 65 - if @issues.blank?
... ...
app/views/snippets/_form.html.haml
... ... @@ -10,22 +10,22 @@
10 10  
11 11 .clearfix
12 12 = f.label :title
13   - .input= f.text_field :title, :placeholder => "Example Snippet"
  13 + .input= f.text_field :title, placeholder: "Example Snippet"
14 14 .clearfix
15 15 = f.label :file_name
16   - .input= f.text_field :file_name, :placeholder => "example.rb"
  16 + .input= f.text_field :file_name, placeholder: "example.rb"
17 17 .clearfix
18 18 = f.label "Lifetime"
19   - .input= f.select :expires_at, lifetime_select_options, {}, :style => "width:200px;"
  19 + .input= f.select :expires_at, lifetime_select_options, {}, style: "width:200px;"
20 20 .clearfix
21 21 = f.label :content, "Code"
22   - .input= f.text_area :content, :class => "span8"
  22 + .input= f.text_area :content, class: "span8"
23 23  
24 24 .actions
25   - = f.submit 'Save', :class => "primary btn"
26   - = link_to "Cancel", project_snippets_path(@project), :class => " btn"
  25 + = f.submit 'Save', class: "primary btn"
  26 + = link_to "Cancel", project_snippets_path(@project), class: " btn"
27 27 - unless @snippet.new_record?
28   - .right= link_to 'Destroy', [@project, @snippet], :confirm => 'Are you sure?', :method => :delete, :class => "btn right danger delete-snippet", :id => "destroy_snippet_#{@snippet.id}"
  28 + .right= link_to 'Destroy', [@project, @snippet], confirm: 'Are you sure?', method: :delete, class: "btn right danger delete-snippet", id: "destroy_snippet_#{@snippet.id}"
29 29  
30 30  
31 31  
... ...
app/views/snippets/_snippet.html.haml
1 1 %tr
2 2 %td
3   - %a{:href => project_snippet_path(snippet.project, snippet)}
4   - %strong= truncate(snippet.title, :length => 60)
  3 + %a{href: project_snippet_path(snippet.project, snippet)}
  4 + %strong= truncate(snippet.title, length: 60)
5 5 %td
6 6 = snippet.file_name
7 7 %td
... ...
app/views/snippets/index.html.haml
... ... @@ -2,7 +2,7 @@
2 2  
3 3 - if can? current_user, :write_snippet, @project
4 4 .alert-message.block-message
5   - = link_to new_project_snippet_path(@project), :class => "btn small add_new right", :title => "New Snippet" do
  5 + = link_to new_project_snippet_path(@project), class: "btn small add_new right", title: "New Snippet" do
6 6 Add new snippet
7 7 Share code pastes with others if it cant be in a git repository
8 8 %br
... ... @@ -17,5 +17,5 @@
17 17 = render @snippets.fresh
18 18 - if @snippets.fresh.empty?
19 19 %tr
20   - %td{:colspan => 3}
  20 + %td{colspan: 3}
21 21 %h3.nothing_here_message Nothing here.
... ...
app/views/snippets/show.html.haml
... ... @@ -4,7 +4,7 @@
4 4 = @snippet.title
5 5 %small= @snippet.file_name
6 6 - if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
7   - = link_to "Edit", edit_project_snippet_path(@project, @snippet), :class => "btn small right"
  7 + = link_to "Edit", edit_project_snippet_path(@project, @snippet), class: "btn small right"
8 8  
9 9 %br
10 10 .file_holder
... ... @@ -12,9 +12,9 @@
12 12 %i.icon-file
13 13 %strong= @snippet.file_name
14 14 %span.options
15   - = link_to "raw", raw_project_snippet_path(@project, @snippet), :class => "btn very_small", :target => "_blank"
  15 + = link_to "raw", raw_project_snippet_path(@project, @snippet), class: "btn very_small", target: "_blank"
16 16 .file_content.code
17   - %div{:class => current_user.dark_scheme ? "black" : ""}
  17 + %div{class: current_user.dark_scheme ? "black" : ""}
18 18 = raw @snippet.colorize(options: { linenos: 'True'})
19 19  
20   -= render "notes/notes", :tid => @snippet.id, :tt => "snippet"
  20 += render "notes/notes", tid: @snippet.id, tt: "snippet"
... ...
app/views/team_members/_form.html.haml
1 1 %h3= "New Team member"
2 2 %hr
3   -= form_for @team_member, :as => :team_member, :url => project_team_members_path(@project, @team_member) do |f|
  3 += form_for @team_member, as: :team_member, url: project_team_members_path(@project, @team_member) do |f|
4 4 -if @team_member.errors.any?
5 5 .alert-message.block-message.error
6 6 %ul
... ... @@ -9,17 +9,17 @@
9 9  
10 10 .clearfix
11 11 = f.label :user_id, "Name"
12   - .input= f.select(:user_id, User.not_in_project(@project).all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }, { :style => "width:300px" })
  12 + .input= f.select(:user_id, User.not_in_project(@project).all.collect {|p| [ p.name, p.id ] }, { include_blank: "Select user" }, { style: "width:300px" })
13 13  
14 14  
15 15 .clearfix
16 16 = f.label :project_access, "Project Access"
17   - .input= f.select :project_access, options_for_select(Project.access_options, @team_member.project_access), {}, :class => "project-access-select"
  17 + .input= f.select :project_access, options_for_select(Project.access_options, @team_member.project_access), {}, class: "project-access-select"
18 18  
19 19  
20 20 .actions
21   - = f.submit 'Save', :class => "btn primary"
22   - = link_to "Cancel", team_project_path(@project), :class => "btn"
  21 + = f.submit 'Save', class: "btn primary"
  22 + = link_to "Cancel", team_project_path(@project), class: "btn"
23 23  
24 24 :css
25 25 form select {
... ...
app/views/team_members/_show.html.haml
1 1 - user = member.user
2 2 - allow_admin = can? current_user, :admin_project, @project
3   -%tr{:id => dom_id(member), :class => "team_member_row user_#{user.id}"}
  3 +%tr{id: dom_id(member), class: "team_member_row user_#{user.id}"}
4 4 %td
5 5 .right
6 6 - if @project.owner == user
... ... @@ -8,13 +8,13 @@
8 8 - if user.blocked
9 9 %span.label Blocked
10 10  
11   - = link_to project_team_member_path(@project, member), :title => user.name, :class => "dark" do
12   - = image_tag gravatar_icon(user.email, 40), :class => "avatar"
13   - = link_to project_team_member_path(@project, member), :title => user.name, :class => "dark" do
14   - %strong= truncate(user.name, :lenght => 40)
  11 + = link_to project_team_member_path(@project, member), title: user.name, class: "dark" do
  12 + = image_tag gravatar_icon(user.email, 40), class: "avatar"
  13 + = link_to project_team_member_path(@project, member), title: user.name, class: "dark" do
  14 + %strong= truncate(user.name, lenght: 40)
15 15 %br
16 16 %div.cgray= user.email
17 17  
18 18 %td
19   - = form_for(member, :as => :team_member, :url => project_team_member_path(@project, member)) do |f|
20   - = f.select :project_access, options_for_select(UsersProject.access_roles, member.project_access), {}, :class => "medium project-access-select", :disabled => !allow_admin
  19 + = form_for(member, as: :team_member, url: project_team_member_path(@project, member)) do |f|
  20 + = f.select :project_access, options_for_select(UsersProject.access_roles, member.project_access), {}, class: "medium project-access-select", disabled: !allow_admin
... ...
app/views/team_members/show.html.haml
... ... @@ -3,9 +3,9 @@
3 3  
4 4 .team_member_show
5 5 - if can? current_user, :admin_project, @project
6   - = link_to 'Remove from team', project_team_member_path(:project_id => @project, :id => @team_member.id), :confirm => 'Are you sure?', :method => :delete, :class => "right btn btn-danger"
  6 + = link_to 'Remove from team', project_team_member_path(project_id: @project, id: @team_member.id), confirm: 'Are you sure?', method: :delete, class: "right btn btn-danger"
7 7 .profile_avatar_holder
8   - = image_tag gravatar_icon(user.email, 60), :class => "borders"
  8 + = image_tag gravatar_icon(user.email, 60), class: "borders"
9 9 %h3
10 10 = user.name
11 11 %small
... ... @@ -14,7 +14,7 @@
14 14 %hr
15 15 .back_link
16 16 %br
17   - = link_to team_project_path(@project), :class => "" do
  17 + = link_to team_project_path(@project), class: "" do
18 18 &larr; To team list
19 19 %br
20 20 .row
... ... @@ -46,10 +46,10 @@
46 46 %tr
47 47 %td
48 48 Project Access:
49   - %small (#{link_to "read more", help_permissions_path, :class => "vlink"})
  49 + %small (#{link_to "read more", help_permissions_path, class: "vlink"})
50 50 %td
51   - = form_for(@team_member, :as => :team_member, :url => project_team_member_path(@project, @team_member)) do |f|
52   - = f.select :project_access, options_for_select(Project.access_options, @team_member.project_access), {}, :class => "project-access-select", :disabled => !allow_admin
  51 + = form_for(@team_member, as: :team_member, url: project_team_member_path(@project, @team_member)) do |f|
  52 + = f.select :project_access, options_for_select(Project.access_options, @team_member.project_access), {}, class: "project-access-select", disabled: !allow_admin
53 53 %hr
54 54 = render user.recent_events.limit(5)
55 55 :javascript
... ...
app/views/wikis/_form.html.haml
... ... @@ -9,7 +9,7 @@
9 9 .main_box
10 10 .top_box_content
11 11 = f.label :title
12   - .input= f.text_field :title, :class => 'span8'
  12 + .input= f.text_field :title, class: 'span8'
13 13 = f.hidden_field :slug
14 14 .middle_box_content
15 15 .input
... ... @@ -20,7 +20,7 @@
20 20  
21 21 .bottom_box_content
22 22 = f.label :content
23   - .input= f.text_area :content, :class => 'span8'
  23 + .input= f.text_area :content, class: 'span8'
24 24 .actions
25   - = f.submit 'Save', :class => "primary btn"
26   - = link_to "Cancel", project_wiki_path(@project, :index), :class => "btn"
  25 + = f.submit 'Save', class: "primary btn"
  26 + = link_to "Cancel", project_wiki_path(@project, :index), class: "btn"
... ...
app/views/wikis/history.html.haml
... ... @@ -13,7 +13,7 @@
13 13 %tr
14 14 %td= i + 1
15 15 %td
16   - = link_to wiki_page.created_at.to_s(:short), project_wiki_path(@project, wiki_page, :old_page_id => wiki_page.id)
  16 + = link_to wiki_page.created_at.to_s(:short), project_wiki_path(@project, wiki_page, old_page_id: wiki_page.id)
17 17 (#{time_ago_in_words(wiki_page.created_at)}
18 18 ago)
19 19 %td= wiki_page.user.name
... ...
app/views/wikis/pages.html.haml
... ... @@ -10,7 +10,7 @@
10 10 - @wikis.each_with_index do |wiki_page, i|
11 11 %tr
12 12 %td
13   - = link_to wiki_page.title, project_wiki_path(@project, wiki_page, :old_page_id => wiki_page.id)
  13 + = link_to wiki_page.title, project_wiki_path(@project, wiki_page, old_page_id: wiki_page.id)
14 14 (#{time_ago_in_words(wiki_page.created_at)}
15 15 ago)
16 16 %td= wiki_page.slug
... ...
app/views/wikis/show.html.haml
1 1 %h3.page_title
2 2 = @wiki.title
3 3 %span.right
4   - = link_to pages_project_wikis_path(@project), :class => "btn small grouped" do
  4 + = link_to pages_project_wikis_path(@project), class: "btn small grouped" do
5 5 Pages
6 6 - if can? current_user, :write_wiki, @project
7   - = link_to history_project_wiki_path(@project, @wiki), :class => "btn small grouped" do
  7 + = link_to history_project_wiki_path(@project, @wiki), class: "btn small grouped" do
8 8 History
9   - = link_to edit_project_wiki_path(@project, @wiki), :class => "btn small grouped" do
  9 + = link_to edit_project_wiki_path(@project, @wiki), class: "btn small grouped" do
10 10 %i.icon-edit
11 11 Edit
12 12 %br
... ... @@ -17,8 +17,8 @@
17 17  
18 18 %p.time Last edited by #{@wiki.user.name}, #{time_ago_in_words @wiki.created_at} ago
19 19 - if can? current_user, :admin_wiki, @project
20   - = link_to project_wiki_path(@project, @wiki), :confirm => "Are you sure you want to delete this page?", :method => :delete do
  20 + = link_to project_wiki_path(@project, @wiki), confirm: "Are you sure you want to delete this page?", method: :delete do
21 21 Delete this page
22 22  
23 23 %hr
24   -.wiki_notes#notes= render "notes/notes", :tid => @wiki.id, :tt => "wiki"
  24 +.wiki_notes#notes= render "notes/notes", tid: @wiki.id, tt: "wiki"
... ...
lib/api.rb
... ... @@ -3,7 +3,7 @@ Dir[&quot;#{Rails.root}/lib/api/*.rb&quot;].each {|file| require file}
3 3 module Gitlab
4 4 class API < Grape::API
5 5 VERSION = 'v2'
6   - version VERSION, :using => :path
  6 + version VERSION, using: :path
7 7  
8 8 rescue_from ActiveRecord::RecordNotFound do
9 9 rack_response({'message' => '404 Not found'}.to_json, 404)
... ...
lib/api/entities.rb
... ... @@ -11,8 +11,8 @@ module Gitlab
11 11  
12 12 class Project < Grape::Entity
13 13 expose :id, :code, :name, :description, :path, :default_branch
14   - expose :owner, :using => Entities::UserBasic
15   - expose :private_flag, :as => :private
  14 + expose :owner, using: Entities::UserBasic
  15 + expose :private_flag, as: :private
16 16 expose :issues_enabled, :merge_requests_enabled, :wall_enabled, :wiki_enabled, :created_at
17 17 end
18 18  
... ... @@ -22,7 +22,7 @@ module Gitlab
22 22  
23 23 class ProjectSnippet < Grape::Entity
24 24 expose :id, :title, :file_name
25   - expose :author, :using => Entities::UserBasic
  25 + expose :author, using: Entities::UserBasic
26 26 expose :expires_at, :updated_at, :created_at
27 27 end
28 28  
... ... @@ -34,9 +34,9 @@ module Gitlab
34 34 expose :id
35 35 expose (:project_id) {|issue| issue.project.id}
36 36 expose :title, :description
37   - expose :label_list, :as => :labels
38   - expose :milestone, :using => Entities::Milestone
39   - expose :assignee, :author, :using => Entities::UserBasic
  37 + expose :label_list, as: :labels
  38 + expose :milestone, using: Entities::Milestone
  39 + expose :assignee, :author, using: Entities::UserBasic
40 40 expose :closed, :updated_at, :created_at
41 41 end
42 42 end
... ...
lib/api/issues.rb
... ... @@ -9,7 +9,7 @@ module Gitlab
9 9 # Example Request:
10 10 # GET /issues
11 11 get do
12   - present current_user.issues, :with => Entities::Issue
  12 + present current_user.issues, with: Entities::Issue
13 13 end
14 14 end
15 15  
... ... @@ -21,7 +21,7 @@ module Gitlab
21 21 # Example Request:
22 22 # GET /projects/:id/issues
23 23 get ":id/issues" do
24   - present user_project.issues, :with => Entities::Issue
  24 + present user_project.issues, with: Entities::Issue
25 25 end
26 26  
27 27 # Get a single project issue
... ... @@ -33,7 +33,7 @@ module Gitlab
33 33 # GET /projects/:id/issues/:issue_id
34 34 get ":id/issues/:issue_id" do
35 35 @issue = user_project.issues.find(params[:issue_id])
36   - present @issue, :with => Entities::Issue
  36 + present @issue, with: Entities::Issue
37 37 end
38 38  
39 39 # Create a new project issue
... ... @@ -49,16 +49,16 @@ module Gitlab
49 49 # POST /projects/:id/issues
50 50 post ":id/issues" do
51 51 @issue = user_project.issues.new(
52   - :title => params[:title],
53   - :description => params[:description],
54   - :assignee_id => params[:assignee_id],
55   - :milestone_id => params[:milestone_id],
56   - :label_list => params[:labels]
  52 + title: params[:title],
  53 + description: params[:description],
  54 + assignee_id: params[:assignee_id],
  55 + milestone_id: params[:milestone_id],
  56 + label_list: params[:labels]
57 57 )
58 58 @issue.author = current_user
59 59  
60 60 if @issue.save
61   - present @issue, :with => Entities::Issue
  61 + present @issue, with: Entities::Issue
62 62 else
63 63 error!({'message' => '404 Not found'}, 404)
64 64 end
... ... @@ -80,16 +80,16 @@ module Gitlab
80 80 put ":id/issues/:issue_id" do
81 81 @issue = user_project.issues.find(params[:issue_id])
82 82 parameters = {
83   - :title => (params[:title] || @issue.title),
84   - :description => (params[:description] || @issue.description),
85   - :assignee_id => (params[:assignee_id] || @issue.assignee_id),
86   - :milestone_id => (params[:milestone_id] || @issue.milestone_id),
87   - :label_list => (params[:labels] || @issue.label_list),
88   - :closed => (params[:closed] || @issue.closed)
  83 + title: (params[:title] || @issue.title),
  84 + description: (params[:description] || @issue.description),
  85 + assignee_id: (params[:assignee_id] || @issue.assignee_id),
  86 + milestone_id: (params[:milestone_id] || @issue.milestone_id),
  87 + label_list: (params[:labels] || @issue.label_list),
  88 + closed: (params[:closed] || @issue.closed)
89 89 }
90 90  
91 91 if @issue.update_attributes(parameters)
92   - present @issue, :with => Entities::Issue
  92 + present @issue, with: Entities::Issue
93 93 else
94 94 error!({'message' => '404 Not found'}, 404)
95 95 end
... ...
lib/api/projects.rb
... ... @@ -10,7 +10,7 @@ module Gitlab
10 10 # GET /projects
11 11 get do
12 12 @projects = current_user.projects
13   - present @projects, :with => Entities::Project
  13 + present @projects, with: Entities::Project
14 14 end
15 15  
16 16 # Get a single project
... ... @@ -20,7 +20,7 @@ module Gitlab
20 20 # Example Request:
21 21 # GET /projects/:id
22 22 get ":id" do
23   - present user_project, :with => Entities::Project
  23 + present user_project, with: Entities::Project
24 24 end
25 25  
26 26 # Get a project repository branches
... ... @@ -30,7 +30,7 @@ module Gitlab
30 30 # Example Request:
31 31 # GET /projects/:id/repository/branches
32 32 get ":id/repository/branches" do
33   - present user_project.repo.heads.sort_by(&:name), :with => Entities::RepoObject
  33 + present user_project.repo.heads.sort_by(&:name), with: Entities::RepoObject
34 34 end
35 35  
36 36 # Get a single branch
... ... @@ -42,7 +42,7 @@ module Gitlab
42 42 # GET /projects/:id/repository/branches/:branch
43 43 get ":id/repository/branches/:branch" do
44 44 @branch = user_project.repo.heads.find { |item| item.name == params[:branch] }
45   - present @branch, :with => Entities::RepoObject
  45 + present @branch, with: Entities::RepoObject
46 46 end
47 47  
48 48 # Get a project repository tags
... ... @@ -52,7 +52,7 @@ module Gitlab
52 52 # Example Request:
53 53 # GET /projects/:id/repository/tags
54 54 get ":id/repository/tags" do
55   - present user_project.repo.tags.sort_by(&:name).reverse, :with => Entities::RepoObject
  55 + present user_project.repo.tags.sort_by(&:name).reverse, with: Entities::RepoObject
56 56 end
57 57  
58 58 # Get a project snippet
... ... @@ -64,7 +64,7 @@ module Gitlab
64 64 # GET /projects/:id/snippets/:snippet_id
65 65 get ":id/snippets/:snippet_id" do
66 66 @snippet = user_project.snippets.find(params[:snippet_id])
67   - present @snippet, :with => Entities::ProjectSnippet
  67 + present @snippet, with: Entities::ProjectSnippet
68 68 end
69 69  
70 70 # Create a new project snippet
... ... @@ -79,15 +79,15 @@ module Gitlab
79 79 # POST /projects/:id/snippets
80 80 post ":id/snippets" do
81 81 @snippet = user_project.snippets.new(
82   - :title => params[:title],
83   - :file_name => params[:file_name],
84   - :expires_at => params[:lifetime],
85   - :content => params[:code]
  82 + title: params[:title],
  83 + file_name: params[:file_name],
  84 + expires_at: params[:lifetime],
  85 + content: params[:code]
86 86 )
87 87 @snippet.author = current_user
88 88  
89 89 if @snippet.save
90   - present @snippet, :with => Entities::ProjectSnippet
  90 + present @snippet, with: Entities::ProjectSnippet
91 91 else
92 92 error!({'message' => '404 Not found'}, 404)
93 93 end
... ... @@ -107,14 +107,14 @@ module Gitlab
107 107 put ":id/snippets/:snippet_id" do
108 108 @snippet = user_project.snippets.find(params[:snippet_id])
109 109 parameters = {
110   - :title => (params[:title] || @snippet.title),
111   - :file_name => (params[:file_name] || @snippet.file_name),
112   - :expires_at => (params[:lifetime] || @snippet.expires_at),
113   - :content => (params[:code] || @snippet.content)
  110 + title: (params[:title] || @snippet.title),
  111 + file_name: (params[:file_name] || @snippet.file_name),
  112 + expires_at: (params[:lifetime] || @snippet.expires_at),
  113 + content: (params[:code] || @snippet.content)
114 114 }
115 115  
116 116 if @snippet.update_attributes(parameters)
117   - present @snippet, :with => Entities::ProjectSnippet
  117 + present @snippet, with: Entities::ProjectSnippet
118 118 else
119 119 error!({'message' => '404 Not found'}, 404)
120 120 end
... ...
lib/api/users.rb
... ... @@ -10,7 +10,7 @@ module Gitlab
10 10 # GET /users
11 11 get do
12 12 @users = User.all
13   - present @users, :with => Entities::User
  13 + present @users, with: Entities::User
14 14 end
15 15  
16 16 # Get a single user
... ... @@ -21,7 +21,7 @@ module Gitlab
21 21 # GET /users/:id
22 22 get ":id" do
23 23 @user = User.find(params[:id])
24   - present @user, :with => Entities::User
  24 + present @user, with: Entities::User
25 25 end
26 26 end
27 27  
... ... @@ -30,7 +30,7 @@ module Gitlab
30 30 # Example Request:
31 31 # GET /user
32 32 get "/user" do
33   - present @current_user, :with => Entities::User
  33 + present @current_user, with: Entities::User
34 34 end
35 35 end
36 36 end
... ...
lib/file_size_validator.rb
1 1 class FileSizeValidator < ActiveModel::EachValidator
2   - MESSAGES = { :is => :wrong_size, :minimum => :size_too_small, :maximum => :size_too_big }.freeze
3   - CHECKS = { :is => :==, :minimum => :>=, :maximum => :<= }.freeze
  2 + MESSAGES = { is: :wrong_size, minimum: :size_too_small, maximum: :size_too_big }.freeze
  3 + CHECKS = { is: :==, minimum: :>=, maximum: :<= }.freeze
4 4  
5 5 DEFAULT_TOKENIZER = lambda { |value| value.split(//) }
6 6 RESERVED_OPTIONS = [:minimum, :maximum, :within, :is, :tokenizer, :too_short, :too_long]
... ...
lib/gitlab/encode.rb
... ... @@ -19,7 +19,7 @@ module Gitlab
19 19 # if message is not utf-8 encoding, convert it
20 20 if detect[:encoding]
21 21 message.force_encoding(detect[:encoding])
22   - message.encode!("utf-8", detect[:encoding], :undef => :replace, :replace => "", :invalid => :replace)
  22 + message.encode!("utf-8", detect[:encoding], undef: :replace, replace: "", invalid: :replace)
23 23 end
24 24  
25 25 # ensure message encoding is utf8
... ...
lib/graph_commit.rb
... ... @@ -6,7 +6,7 @@ class GraphCommit
6 6  
7 7 def self.to_graph(project)
8 8 @repo = project.repo
9   - commits = Grit::Commit.find_all(@repo, nil, {:max_count => 650})
  9 + commits = Grit::Commit.find_all(@repo, nil, {max_count: 650})
10 10  
11 11 ref_cache = {}
12 12  
... ...
lib/redcarpet/render/gitlab_html.rb
... ... @@ -11,9 +11,9 @@ class Redcarpet::Render::GitlabHTML &lt; Redcarpet::Render::HTML
11 11  
12 12 def block_code(code, language)
13 13 if Pygments::Lexer.find(language)
14   - Pygments.highlight(code, :lexer => language, :options => {:encoding => 'utf-8'})
  14 + Pygments.highlight(code, lexer: language, options: {encoding: 'utf-8'})
15 15 else
16   - Pygments.highlight(code, :options => {:encoding => 'utf-8'})
  16 + Pygments.highlight(code, options: {encoding: 'utf-8'})
17 17 end
18 18 end
19 19  
... ...
spec/api/issues_spec.rb
... ... @@ -2,8 +2,8 @@ require &#39;spec_helper&#39;
2 2  
3 3 describe Gitlab::API do
4 4 let(:user) { Factory :user }
5   - let!(:project) { Factory :project, :owner => user }
6   - let!(:issue) { Factory :issue, :author => user, :assignee => user, :project => project }
  5 + let!(:project) { Factory :project, owner: user }
  6 + let!(:issue) { Factory :issue, author: user, assignee: user, project: project }
7 7 before { project.add_access(user, :read) }
8 8  
9 9 describe "GET /issues" do
... ... @@ -42,7 +42,7 @@ describe Gitlab::API do
42 42 describe "POST /projects/:id/issues" do
43 43 it "should create a new project issue" do
44 44 post "#{api_prefix}/projects/#{project.code}/issues?private_token=#{user.private_token}",
45   - :title => 'new issue', :labels => 'label, label2'
  45 + title: 'new issue', labels: 'label, label2'
46 46 response.status.should == 201
47 47 json_response['title'].should == 'new issue'
48 48 json_response['description'].should be_nil
... ... @@ -53,7 +53,7 @@ describe Gitlab::API do
53 53 describe "PUT /projects/:id/issues/:issue_id" do
54 54 it "should update a project issue" do
55 55 put "#{api_prefix}/projects/#{project.code}/issues/#{issue.id}?private_token=#{user.private_token}",
56   - :title => 'updated title', :labels => 'label2', :closed => 1
  56 + title: 'updated title', labels: 'label2', closed: 1
57 57 response.status.should == 200
58 58 json_response['title'].should == 'updated title'
59 59 json_response['labels'].should == ['label2']
... ...
spec/api/projects_spec.rb
... ... @@ -2,8 +2,8 @@ require &#39;spec_helper&#39;
2 2  
3 3 describe Gitlab::API do
4 4 let(:user) { Factory :user }
5   - let!(:project) { Factory :project, :owner => user }
6   - let!(:snippet) { Factory :snippet, :author => user, :project => project, :title => 'example' }
  5 + let!(:project) { Factory :project, owner: user }
  6 + let!(:snippet) { Factory :snippet, author: user, project: project, title: 'example' }
7 7 before { project.add_access(user, :read) }
8 8  
9 9 describe "GET /projects" do
... ... @@ -83,7 +83,7 @@ describe Gitlab::API do
83 83 describe "POST /projects/:id/snippets" do
84 84 it "should create a new project snippet" do
85 85 post "#{api_prefix}/projects/#{project.code}/snippets?private_token=#{user.private_token}",
86   - :title => 'api test', :file_name => 'sample.rb', :code => 'test'
  86 + title: 'api test', file_name: 'sample.rb', code: 'test'
87 87 response.status.should == 201
88 88 json_response['title'].should == 'api test'
89 89 end
... ... @@ -92,7 +92,7 @@ describe Gitlab::API do
92 92 describe "PUT /projects/:id/snippets" do
93 93 it "should update an existing project snippet" do
94 94 put "#{api_prefix}/projects/#{project.code}/snippets/#{snippet.id}?private_token=#{user.private_token}",
95   - :code => 'updated code'
  95 + code: 'updated code'
96 96 response.status.should == 200
97 97 json_response['title'].should == 'example'
98 98 snippet.reload.content.should == 'updated code'
... ...
spec/helpers/gitlab_flavored_markdown_spec.rb
... ... @@ -5,8 +5,8 @@ describe GitlabMarkdownHelper do
5 5 @project = Project.find_by_path("gitlabhq") || Factory(:project)
6 6 @commit = @project.repo.commits.first.parents.first
7 7 @commit = CommitDecorator.decorate(Commit.new(@commit))
8   - @other_project = Factory :project, :path => "OtherPath", :code => "OtherCode"
9   - @fake_user = Factory :user, :name => "fred"
  8 + @other_project = Factory :project, path: "OtherPath", code: "OtherCode"
  9 + @fake_user = Factory :user, name: "fred"
10 10 end
11 11  
12 12 describe "#gfm" do
... ... @@ -18,15 +18,15 @@ describe GitlabMarkdownHelper do
18 18  
19 19 describe "referencing a commit" do
20 20 it "should link using a full id" do
21   - gfm("Reverts changes from #{@commit.id}").should == "Reverts changes from #{link_to @commit.id, project_commit_path(@project, :id => @commit.id), :title => "Commit: #{@commit.author_name} - #{@commit.title}", :class => "gfm gfm-commit "}"
  21 + gfm("Reverts changes from #{@commit.id}").should == "Reverts changes from #{link_to @commit.id, project_commit_path(@project, id: @commit.id), title: "Commit: #{@commit.author_name} - #{@commit.title}", class: "gfm gfm-commit "}"
22 22 end
23 23  
24 24 it "should link using a short id" do
25   - gfm("Backported from #{@commit.id[0, 6]}").should == "Backported from #{link_to @commit.id[0, 6], project_commit_path(@project, :id => @commit.id), :title => "Commit: #{@commit.author_name} - #{@commit.title}", :class => "gfm gfm-commit "}"
  25 + gfm("Backported from #{@commit.id[0, 6]}").should == "Backported from #{link_to @commit.id[0, 6], project_commit_path(@project, id: @commit.id), title: "Commit: #{@commit.author_name} - #{@commit.title}", class: "gfm gfm-commit "}"
26 26 end
27 27  
28 28 it "should link with adjecent text" do
29   - gfm("Reverted (see #{@commit.id})").should == "Reverted (see #{link_to @commit.id, project_commit_path(@project, :id => @commit.id), :title => "Commit: #{@commit.author_name} - #{@commit.title}", :class => "gfm gfm-commit "})"
  29 + gfm("Reverted (see #{@commit.id})").should == "Reverted (see #{link_to @commit.id, project_commit_path(@project, id: @commit.id), title: "Commit: #{@commit.author_name} - #{@commit.title}", class: "gfm gfm-commit "})"
30 30 end
31 31  
32 32 it "should not link with an invalid id" do
... ... @@ -38,33 +38,33 @@ describe GitlabMarkdownHelper do
38 38 it "should link using a simple name" do
39 39 user = Factory :user, name: "barry"
40 40 @project.users << user
41   - member = @project.users_projects.where(:user_id => user).first
  41 + member = @project.users_projects.where(user_id: user).first
42 42  
43   - gfm("@#{user.name} you are right").should == "#{link_to "@#{user.name}", project_team_member_path(@project, member), :class => "gfm gfm-team_member "} you are right"
  43 + gfm("@#{user.name} you are right").should == "#{link_to "@#{user.name}", project_team_member_path(@project, member), class: "gfm gfm-team_member "} you are right"
44 44 end
45 45  
46 46 it "should link using a name with dots" do
47 47 user = Factory :user, name: "alphA.Beta"
48 48 @project.users << user
49   - member = @project.users_projects.where(:user_id => user).first
  49 + member = @project.users_projects.where(user_id: user).first
50 50  
51   - gfm("@#{user.name} you are right").should == "#{link_to "@#{user.name}", project_team_member_path(@project, member), :class => "gfm gfm-team_member "} you are right"
  51 + gfm("@#{user.name} you are right").should == "#{link_to "@#{user.name}", project_team_member_path(@project, member), class: "gfm gfm-team_member "} you are right"
52 52 end
53 53  
54 54 it "should link using name with underscores" do
55 55 user = Factory :user, name: "ping_pong_king"
56 56 @project.users << user
57   - member = @project.users_projects.where(:user_id => user).first
  57 + member = @project.users_projects.where(user_id: user).first
58 58  
59   - gfm("@#{user.name} you are right").should == "#{link_to "@#{user.name}", project_team_member_path(@project, member), :class => "gfm gfm-team_member "} you are right"
  59 + gfm("@#{user.name} you are right").should == "#{link_to "@#{user.name}", project_team_member_path(@project, member), class: "gfm gfm-team_member "} you are right"
60 60 end
61 61  
62 62 it "should link with adjecent text" do
63   - user = Factory.create(:user, :name => "ace")
  63 + user = Factory.create(:user, name: "ace")
64 64 @project.users << user
65   - member = @project.users_projects.where(:user_id => user).first
  65 + member = @project.users_projects.where(user_id: user).first
66 66  
67   - gfm("Mail the Admin (@#{user.name})").should == "Mail the Admin (#{link_to "@#{user.name}", project_team_member_path(@project, member), :class => "gfm gfm-team_member "})"
  67 + gfm("Mail the Admin (@#{user.name})").should == "Mail the Admin (#{link_to "@#{user.name}", project_team_member_path(@project, member), class: "gfm gfm-team_member "})"
68 68 end
69 69  
70 70 it "should add styles" do
... ... @@ -80,16 +80,16 @@ describe GitlabMarkdownHelper do
80 80  
81 81 describe "referencing an issue" do
82 82 before do
83   - @issue = Factory :issue, :assignee => @fake_user, :author => @fake_user, :project => @project
84   - @invalid_issue = Factory :issue, :assignee => @fake_user, :author => @fake_user, :project => @other_project
  83 + @issue = Factory :issue, assignee: @fake_user, author: @fake_user, project: @project
  84 + @invalid_issue = Factory :issue, assignee: @fake_user, author: @fake_user, project: @other_project
85 85 end
86 86  
87 87 it "should link using a correct id" do
88   - gfm("Fixes ##{@issue.id}").should == "Fixes #{link_to "##{@issue.id}", project_issue_path(@project, @issue), :title => "Issue: #{@issue.title}", :class => "gfm gfm-issue "}"
  88 + gfm("Fixes ##{@issue.id}").should == "Fixes #{link_to "##{@issue.id}", project_issue_path(@project, @issue), title: "Issue: #{@issue.title}", class: "gfm gfm-issue "}"
89 89 end
90 90  
91 91 it "should link with adjecent text" do
92   - gfm("This has already been discussed (see ##{@issue.id})").should == "This has already been discussed (see #{link_to "##{@issue.id}", project_issue_path(@project, @issue), :title => "Issue: #{@issue.title}", :class => "gfm gfm-issue "})"
  92 + gfm("This has already been discussed (see ##{@issue.id})").should == "This has already been discussed (see #{link_to "##{@issue.id}", project_issue_path(@project, @issue), title: "Issue: #{@issue.title}", class: "gfm gfm-issue "})"
93 93 end
94 94  
95 95 it "should add styles" do
... ... @@ -103,16 +103,16 @@ describe GitlabMarkdownHelper do
103 103  
104 104 describe "referencing a merge request" do
105 105 before do
106   - @merge_request = Factory :merge_request, :assignee => @fake_user, :author => @fake_user, :project => @project
107   - @invalid_merge_request = Factory :merge_request, :assignee => @fake_user, :author => @fake_user, :project => @other_project
  106 + @merge_request = Factory :merge_request, assignee: @fake_user, author: @fake_user, project: @project
  107 + @invalid_merge_request = Factory :merge_request, assignee: @fake_user, author: @fake_user, project: @other_project
108 108 end
109 109  
110 110 it "should link using a correct id" do
111   - gfm("Fixed in !#{@merge_request.id}").should == "Fixed in #{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), :title => "Merge Request: #{@merge_request.title}", :class => "gfm gfm-merge_request "}"
  111 + gfm("Fixed in !#{@merge_request.id}").should == "Fixed in #{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), title: "Merge Request: #{@merge_request.title}", class: "gfm gfm-merge_request "}"
112 112 end
113 113  
114 114 it "should link with adjecent text" do
115   - gfm("This has been fixed already (see !#{@merge_request.id})").should == "This has been fixed already (see #{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), :title => "Merge Request: #{@merge_request.title}", :class => "gfm gfm-merge_request "})"
  115 + gfm("This has been fixed already (see !#{@merge_request.id})").should == "This has been fixed already (see #{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), title: "Merge Request: #{@merge_request.title}", class: "gfm gfm-merge_request "})"
116 116 end
117 117  
118 118 it "should add styles" do
... ... @@ -127,17 +127,17 @@ describe GitlabMarkdownHelper do
127 127 describe "referencing a snippet" do
128 128 before do
129 129 @snippet = Factory.create(:snippet,
130   - :title => "Render asset to string",
131   - :author => @fake_user,
132   - :project => @project)
  130 + title: "Render asset to string",
  131 + author: @fake_user,
  132 + project: @project)
133 133 end
134 134  
135 135 it "should link using a correct id" do
136   - gfm("Check out $#{@snippet.id}").should == "Check out #{link_to "$#{@snippet.id}", project_snippet_path(@project, @snippet), :title => "Snippet: #{@snippet.title}", :class => "gfm gfm-snippet "}"
  136 + gfm("Check out $#{@snippet.id}").should == "Check out #{link_to "$#{@snippet.id}", project_snippet_path(@project, @snippet), title: "Snippet: #{@snippet.title}", class: "gfm gfm-snippet "}"
137 137 end
138 138  
139 139 it "should link with adjecent text" do
140   - gfm("I have created a snippet for that ($#{@snippet.id})").should == "I have created a snippet for that (#{link_to "$#{@snippet.id}", project_snippet_path(@project, @snippet), :title => "Snippet: #{@snippet.title}", :class => "gfm gfm-snippet "})"
  140 + gfm("I have created a snippet for that ($#{@snippet.id})").should == "I have created a snippet for that (#{link_to "$#{@snippet.id}", project_snippet_path(@project, @snippet), title: "Snippet: #{@snippet.title}", class: "gfm gfm-snippet "})"
141 141 end
142 142  
143 143 it "should add styles" do
... ... @@ -152,12 +152,12 @@ describe GitlabMarkdownHelper do
152 152 it "should link to multiple things" do
153 153 user = Factory :user, name: "barry"
154 154 @project.users << user
155   - member = @project.users_projects.where(:user_id => user).first
  155 + member = @project.users_projects.where(user_id: user).first
156 156  
157   - gfm("Let @#{user.name} fix the *mess* in #{@commit.id}").should == "Let #{link_to "@#{user.name}", project_team_member_path(@project, member), :class => "gfm gfm-team_member "} fix the *mess* in #{link_to @commit.id, project_commit_path(@project, :id => @commit.id), :title => "Commit: #{@commit.author_name} - #{@commit.title}", :class => "gfm gfm-commit "}"
  157 + gfm("Let @#{user.name} fix the *mess* in #{@commit.id}").should == "Let #{link_to "@#{user.name}", project_team_member_path(@project, member), class: "gfm gfm-team_member "} fix the *mess* in #{link_to @commit.id, project_commit_path(@project, id: @commit.id), title: "Commit: #{@commit.author_name} - #{@commit.title}", class: "gfm gfm-commit "}"
158 158 end
159 159  
160   - it "should not trip over other stuff", :focus => true do
  160 + it "should not trip over other stuff", focus: true do
161 161 gfm("_Please_ *stop* 'helping' and all the other b*$#%' you do.").should == "_Please_ *stop* 'helping' and all the other b*$#%' you do."
162 162 end
163 163  
... ... @@ -166,57 +166,57 @@ describe GitlabMarkdownHelper do
166 166 end
167 167  
168 168 it "should forward HTML options to links" do
169   - gfm("fixed in #{@commit.id}", :class => "foo").should have_selector("a.foo")
  169 + gfm("fixed in #{@commit.id}", class: "foo").should have_selector("a.foo")
170 170 end
171 171 end
172 172  
173 173 describe "#link_to_gfm" do
174   - let(:issue1) { Factory :issue, :assignee => @fake_user, :author => @fake_user, :project => @project }
175   - let(:issue2) { Factory :issue, :assignee => @fake_user, :author => @fake_user, :project => @project }
  174 + let(:issue1) { Factory :issue, assignee: @fake_user, author: @fake_user, project: @project }
  175 + let(:issue2) { Factory :issue, assignee: @fake_user, author: @fake_user, project: @project }
176 176  
177 177 it "should handle references nested in links with all the text" do
178   - link_to_gfm("This should finally fix ##{issue1.id} and ##{issue2.id} for real", project_commit_path(@project, :id => @commit.id)).should == "#{link_to "This should finally fix ", project_commit_path(@project, :id => @commit.id)}#{link_to "##{issue1.id}", project_issue_path(@project, issue1), :title => "Issue: #{issue1.title}", :class => "gfm gfm-issue "}#{link_to " and ", project_commit_path(@project, :id => @commit.id)}#{link_to "##{issue2.id}", project_issue_path(@project, issue2), :title => "Issue: #{issue2.title}", :class => "gfm gfm-issue "}#{link_to " for real", project_commit_path(@project, :id => @commit.id)}"
  178 + link_to_gfm("This should finally fix ##{issue1.id} and ##{issue2.id} for real", project_commit_path(@project, id: @commit.id)).should == "#{link_to "This should finally fix ", project_commit_path(@project, id: @commit.id)}#{link_to "##{issue1.id}", project_issue_path(@project, issue1), title: "Issue: #{issue1.title}", class: "gfm gfm-issue "}#{link_to " and ", project_commit_path(@project, id: @commit.id)}#{link_to "##{issue2.id}", project_issue_path(@project, issue2), title: "Issue: #{issue2.title}", class: "gfm gfm-issue "}#{link_to " for real", project_commit_path(@project, id: @commit.id)}"
179 179 end
180 180  
181 181 it "should forward HTML options" do
182   - link_to_gfm("This should finally fix ##{issue1.id} for real", project_commit_path(@project, :id => @commit.id), :class => "foo").should have_selector(".foo")
  182 + link_to_gfm("This should finally fix ##{issue1.id} for real", project_commit_path(@project, id: @commit.id), class: "foo").should have_selector(".foo")
183 183 end
184 184 end
185 185  
186 186 describe "#markdown" do
187 187 before do
188   - @issue = Factory :issue, :assignee => @fake_user, :author => @fake_user, :project => @project
189   - @merge_request = Factory :merge_request, :assignee => @fake_user, :author => @fake_user, :project => @project
  188 + @issue = Factory :issue, assignee: @fake_user, author: @fake_user, project: @project
  189 + @merge_request = Factory :merge_request, assignee: @fake_user, author: @fake_user, project: @project
190 190 @note = Factory.create(:note,
191   - :note => "Screenshot of the new feature",
192   - :project => @project,
193   - :noteable_id => @commit.id,
194   - :noteable_type => "Commit",
195   - :attachment => "screenshot123.jpg")
  191 + note: "Screenshot of the new feature",
  192 + project: @project,
  193 + noteable_id: @commit.id,
  194 + noteable_type: "Commit",
  195 + attachment: "screenshot123.jpg")
196 196 @snippet = Factory.create(:snippet,
197   - :title => "Render asset to string",
198   - :author => @fake_user,
199   - :project => @project)
  197 + title: "Render asset to string",
  198 + author: @fake_user,
  199 + project: @project)
200 200  
201 201 @other_user = Factory :user, name: "bill"
202 202 @project.users << @other_user
203   - @member = @project.users_projects.where(:user_id => @other_user).first
  203 + @member = @project.users_projects.where(user_id: @other_user).first
204 204 end
205 205  
206 206 it "should handle references in paragraphs" do
207   - markdown("\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. #{@commit.id} Nam pulvinar sapien eget odio adipiscing at faucibus orci vestibulum.\n").should == "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. #{link_to @commit.id, project_commit_path(@project, :id => @commit.id), :title => "Commit: #{@commit.author_name} - #{@commit.title}", :class => "gfm gfm-commit "} Nam pulvinar sapien eget odio adipiscing at faucibus orci vestibulum.</p>\n"
  207 + markdown("\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. #{@commit.id} Nam pulvinar sapien eget odio adipiscing at faucibus orci vestibulum.\n").should == "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. #{link_to @commit.id, project_commit_path(@project, id: @commit.id), title: "Commit: #{@commit.author_name} - #{@commit.title}", class: "gfm gfm-commit "} Nam pulvinar sapien eget odio adipiscing at faucibus orci vestibulum.</p>\n"
208 208 end
209 209  
210 210 it "should handle references in headers" do
211   - markdown("\n# Working around ##{@issue.id} for now\n## Apply !#{@merge_request.id}").should == "<h1 id=\"toc_0\">Working around #{link_to "##{@issue.id}", project_issue_path(@project, @issue), :title => "Issue: #{@issue.title}", :class => "gfm gfm-issue "} for now</h1>\n\n<h2 id=\"toc_1\">Apply #{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), :title => "Merge Request: #{@merge_request.title}", :class => "gfm gfm-merge_request "}</h2>\n"
  211 + markdown("\n# Working around ##{@issue.id} for now\n## Apply !#{@merge_request.id}").should == "<h1 id=\"toc_0\">Working around #{link_to "##{@issue.id}", project_issue_path(@project, @issue), title: "Issue: #{@issue.title}", class: "gfm gfm-issue "} for now</h1>\n\n<h2 id=\"toc_1\">Apply #{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), title: "Merge Request: #{@merge_request.title}", class: "gfm gfm-merge_request "}</h2>\n"
212 212 end
213 213  
214 214 it "should handle references in lists" do
215   - markdown("\n* dark: ##{@issue.id}\n* light by @#{@other_user.name}\n").should == "<ul>\n<li>dark: #{link_to "##{@issue.id}", project_issue_path(@project, @issue), :title => "Issue: #{@issue.title}", :class => "gfm gfm-issue "}</li>\n<li>light by #{link_to "@#{@other_user.name}", project_team_member_path(@project, @member), :class => "gfm gfm-team_member "}</li>\n</ul>\n"
  215 + markdown("\n* dark: ##{@issue.id}\n* light by @#{@other_user.name}\n").should == "<ul>\n<li>dark: #{link_to "##{@issue.id}", project_issue_path(@project, @issue), title: "Issue: #{@issue.title}", class: "gfm gfm-issue "}</li>\n<li>light by #{link_to "@#{@other_user.name}", project_team_member_path(@project, @member), class: "gfm gfm-team_member "}</li>\n</ul>\n"
216 216 end
217 217  
218 218 it "should handle references in <em>" do
219   - markdown("Apply _!#{@merge_request.id}_ ASAP").should == "<p>Apply <em>#{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), :title => "Merge Request: #{@merge_request.title}", :class => "gfm gfm-merge_request "}</em> ASAP</p>\n"
  219 + markdown("Apply _!#{@merge_request.id}_ ASAP").should == "<p>Apply <em>#{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), title: "Merge Request: #{@merge_request.title}", class: "gfm gfm-merge_request "}</em> ASAP</p>\n"
220 220 end
221 221  
222 222 it "should leave code blocks untouched" do
... ...
spec/mailers/notify_spec.rb
... ... @@ -4,7 +4,7 @@ describe Notify do
4 4 include EmailSpec::Helpers
5 5 include EmailSpec::Matchers
6 6  
7   - let(:recipient) { Factory.create(:user, :email => 'recipient@example.com') }
  7 + let(:recipient) { Factory.create(:user, email: 'recipient@example.com') }
8 8 let(:project) { Factory.create(:project) }
9 9  
10 10 shared_examples 'a multiple recipients email' do
... ... @@ -15,7 +15,7 @@ describe Notify do
15 15  
16 16 describe 'for new users, the email' do
17 17 let(:example_site_path) { root_path }
18   - let(:new_user) { Factory.create(:user, :email => 'newguy@example.com') }
  18 + let(:new_user) { Factory.create(:user, email: 'newguy@example.com') }
19 19  
20 20 subject { Notify.new_user_email(new_user.id, new_user.password) }
21 21  
... ... @@ -42,8 +42,8 @@ describe Notify do
42 42  
43 43 context 'for a project' do
44 44 describe 'items that are assignable, the email' do
45   - let(:assignee) { Factory.create(:user, :email => 'assignee@example.com') }
46   - let(:previous_assignee) { Factory.create(:user, :name => 'Previous Assignee') }
  45 + let(:assignee) { Factory.create(:user, email: 'assignee@example.com') }
  46 + let(:previous_assignee) { Factory.create(:user, name: 'Previous Assignee') }
47 47  
48 48 shared_examples 'an assignee email' do
49 49 it 'is sent to the assignee' do
... ... @@ -52,7 +52,7 @@ describe Notify do
52 52 end
53 53  
54 54 context 'for issues' do
55   - let(:issue) { Factory.create(:issue, :assignee => assignee, :project => project ) }
  55 + let(:issue) { Factory.create(:issue, assignee: assignee, project: project ) }
56 56  
57 57 describe 'that are new' do
58 58 subject { Notify.new_issue_email(issue.id) }
... ... @@ -94,7 +94,7 @@ describe Notify do
94 94 end
95 95  
96 96 context 'for merge requests' do
97   - let(:merge_request) { Factory.create(:merge_request, :assignee => assignee, :project => project) }
  97 + let(:merge_request) { Factory.create(:merge_request, assignee: assignee, project: project) }
98 98  
99 99 describe 'that are new' do
100 100 subject { Notify.new_merge_request_email(merge_request.id) }
... ... @@ -146,8 +146,8 @@ describe Notify do
146 146 end
147 147  
148 148 context 'items that are noteable, the email for a note' do
149   - let(:note_author) { Factory.create(:user, :name => 'author_name') }
150   - let(:note) { Factory.create(:note, :project => project, :author => note_author) }
  149 + let(:note_author) { Factory.create(:user, name: 'author_name') }
  150 + let(:note) { Factory.create(:note, project: project, author: note_author) }
151 151  
152 152 before :each do
153 153 Note.stub(:find).with(note.id).and_return(note)
... ... @@ -168,7 +168,7 @@ describe Notify do
168 168 end
169 169  
170 170 describe 'on a project wall' do
171   - let(:note_on_the_wall_path) { wall_project_path(project, :anchor => "note_#{note.id}") }
  171 + let(:note_on_the_wall_path) { wall_project_path(project, anchor: "note_#{note.id}") }
172 172  
173 173 subject { Notify.note_wall_email(recipient.id, note.id) }
174 174  
... ... @@ -208,8 +208,8 @@ describe Notify do
208 208 end
209 209  
210 210 describe 'on a merge request' do
211   - let(:merge_request) { Factory.create(:merge_request, :project => project) }
212   - let(:note_on_merge_request_path) { project_merge_request_path(project, merge_request, :anchor => "note_#{note.id}") }
  211 + let(:merge_request) { Factory.create(:merge_request, project: project) }
  212 + let(:note_on_merge_request_path) { project_merge_request_path(project, merge_request, anchor: "note_#{note.id}") }
213 213 before(:each) { note.stub(:noteable).and_return(merge_request) }
214 214  
215 215 subject { Notify.note_merge_request_email(recipient.id, note.id) }
... ... @@ -226,8 +226,8 @@ describe Notify do
226 226 end
227 227  
228 228 describe 'on an issue' do
229   - let(:issue) { Factory.create(:issue, :project => project) }
230   - let(:note_on_issue_path) { project_issue_path(project, issue, :anchor => "note_#{note.id}") }
  229 + let(:issue) { Factory.create(:issue, project: project) }
  230 + let(:note_on_issue_path) { project_issue_path(project, issue, anchor: "note_#{note.id}") }
231 231 before(:each) { note.stub(:noteable).and_return(issue) }
232 232  
233 233 subject { Notify.note_issue_email(recipient.id, note.id) }
... ...
spec/models/activity_observer_spec.rb
... ... @@ -11,7 +11,7 @@ describe ActivityObserver do
11 11 describe "Merge Request created" do
12 12 before do
13 13 MergeRequest.observers.enable :activity_observer do
14   - @merge_request = Factory :merge_request, :project => project
  14 + @merge_request = Factory :merge_request, project: project
15 15 @event = Event.last
16 16 end
17 17 end
... ... @@ -24,7 +24,7 @@ describe ActivityObserver do
24 24 describe "Issue created" do
25 25 before do
26 26 Issue.observers.enable :activity_observer do
27   - @issue = Factory :issue, :project => project
  27 + @issue = Factory :issue, project: project
28 28 @event = Event.last
29 29 end
30 30 end
... ... @@ -36,8 +36,8 @@ describe ActivityObserver do
36 36  
37 37 #describe "Issue commented" do
38 38 #before do
39   - #@issue = Factory :issue, :project => project
40   - #@note = Factory :note, :noteable => @issue, :project => project
  39 + #@issue = Factory :issue, project: project
  40 + #@note = Factory :note, noteable: @issue, project: project
41 41 #@event = Event.last
42 42 #end
43 43  
... ...
spec/models/event_spec.rb
... ... @@ -45,25 +45,25 @@ describe Event do
45 45 @user = project.owner
46 46  
47 47 data = {
48   - :before => "0000000000000000000000000000000000000000",
49   - :after => "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e",
50   - :ref => "refs/heads/master",
51   - :user_id => @user.id,
52   - :user_name => @user.name,
53   - :repository => {
54   - :name => project.name,
55   - :url => "localhost/rubinius",
56   - :description => "",
57   - :homepage => "localhost/rubinius",
58   - :private => true
  48 + before: "0000000000000000000000000000000000000000",
  49 + after: "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e",
  50 + ref: "refs/heads/master",
  51 + user_id: @user.id,
  52 + user_name: @user.name,
  53 + repository: {
  54 + name: project.name,
  55 + url: "localhost/rubinius",
  56 + description: "",
  57 + homepage: "localhost/rubinius",
  58 + private: true
59 59 }
60 60 }
61 61  
62 62 @event = Event.create(
63   - :project => project,
64   - :action => Event::Pushed,
65   - :data => data,
66   - :author_id => @user.id
  63 + project: project,
  64 + action: Event::Pushed,
  65 + data: data,
  66 + author_id: @user.id
67 67 )
68 68 end
69 69  
... ...
spec/models/issue_observer_spec.rb
1 1 require 'spec_helper'
2 2  
3 3 describe IssueObserver do
4   - let(:some_user) { double(:user, :id => 1) }
5   - let(:assignee) { double(:user, :id => 2) }
6   - let(:issue) { double(:issue, :id => 42, :assignee => assignee) }
  4 + let(:some_user) { double(:user, id: 1) }
  5 + let(:assignee) { double(:user, id: 2) }
  6 + let(:issue) { double(:issue, id: 42, assignee: assignee) }
7 7  
8 8 before(:each) { subject.stub(:current_user).and_return(some_user) }
9 9  
... ... @@ -15,13 +15,13 @@ describe IssueObserver do
15 15 subject.should_receive(:after_create)
16 16  
17 17 Issue.observers.enable :issue_observer do
18   - Factory.create(:issue, :project => Factory.create(:project))
  18 + Factory.create(:issue, project: Factory.create(:project))
19 19 end
20 20 end
21 21  
22 22 it 'sends an email to the assignee' do
23 23 Notify.should_receive(:new_issue_email).with(issue.id).
24   - and_return(double(:deliver => true))
  24 + and_return(double(deliver: true))
25 25  
26 26 subject.after_create(issue)
27 27 end
... ... @@ -42,7 +42,7 @@ describe IssueObserver do
42 42 end
43 43  
44 44 it 'is called when an issue is changed' do
45   - changed = Factory.create(:issue, :project => Factory.create(:project))
  45 + changed = Factory.create(:issue, project: Factory.create(:project))
46 46 subject.should_receive(:after_update)
47 47  
48 48 Issue.observers.enable :issue_observer do
... ... @@ -101,7 +101,7 @@ describe IssueObserver do
101 101 end
102 102  
103 103 describe '#send_reassigned_email' do
104   - let(:previous_assignee) { double(:user, :id => 3) }
  104 + let(:previous_assignee) { double(:user, id: 3) }
105 105  
106 106 before(:each) do
107 107 issue.stub(:assignee_id).and_return(assignee.id)
... ... @@ -110,7 +110,7 @@ describe IssueObserver do
110 110  
111 111 def it_sends_a_reassigned_email_to(recipient)
112 112 Notify.should_receive(:reassigned_issue_email).with(recipient, issue.id, previous_assignee.id).
113   - and_return(double(:deliver => true))
  113 + and_return(double(deliver: true))
114 114 end
115 115  
116 116 def it_does_not_send_a_reassigned_email_to(recipient)
... ...
spec/models/issue_spec.rb
... ... @@ -20,9 +20,9 @@ describe Issue do
20 20 end
21 21  
22 22 subject { Factory.create(:issue,
23   - :author => Factory(:user),
24   - :assignee => Factory(:user),
25   - :project => Factory.create(:project)) }
  23 + author: Factory(:user),
  24 + assignee: Factory(:user),
  25 + project: Factory.create(:project)) }
26 26 it { should be_valid }
27 27  
28 28 describe '#is_being_reassigned?' do
... ... @@ -42,10 +42,10 @@ describe Issue do
42 42 end
43 43 it 'returns false if the closed attribute has changed and is now false' do
44 44 issue = Factory.create(:issue,
45   - :closed => true,
46   - :author => Factory(:user),
47   - :assignee => Factory(:user),
48   - :project => Factory.create(:project))
  45 + closed: true,
  46 + author: Factory(:user),
  47 + assignee: Factory(:user),
  48 + project: Factory.create(:project))
49 49 issue.closed = false
50 50 issue.is_being_closed?.should be_false
51 51 end
... ... @@ -58,10 +58,10 @@ describe Issue do
58 58 describe '#is_being_reopened?' do
59 59 it 'returns true if the closed attribute has changed and is now false' do
60 60 issue = Factory.create(:issue,
61   - :closed => true,
62   - :author => Factory(:user),
63   - :assignee => Factory(:user),
64   - :project => Factory.create(:project))
  61 + closed: true,
  62 + author: Factory(:user),
  63 + assignee: Factory(:user),
  64 + project: Factory.create(:project))
65 65 issue.closed = false
66 66 issue.is_being_reopened?.should be_true
67 67 end
... ... @@ -78,9 +78,9 @@ describe Issue do
78 78 let(:project) { Factory(:project) }
79 79 subject {
80 80 Factory.create(:issue,
81   - :author => Factory(:user),
82   - :assignee => Factory(:user),
83   - :project => project)
  81 + author: Factory(:user),
  82 + assignee: Factory(:user),
  83 + project: project)
84 84 }
85 85  
86 86 it "with no notes has a 0/0 score" do
... ... @@ -107,8 +107,8 @@ describe Issue do
107 107 end
108 108  
109 109 describe ".search" do
110   - let!(:issue) { Factory.create(:issue, :title => "Searchable issue",
111   - :project => Factory.create(:project)) }
  110 + let!(:issue) { Factory.create(:issue, title: "Searchable issue",
  111 + project: Factory.create(:project)) }
112 112  
113 113 it "matches by title" do
114 114 Issue.search('able').all.should == [issue]
... ...
spec/models/merge_request_spec.rb
... ... @@ -21,17 +21,17 @@ describe MergeRequest do
21 21 end
22 22  
23 23 it { Factory.create(:merge_request,
24   - :author => Factory(:user),
25   - :assignee => Factory(:user),
26   - :project => Factory.create(:project)).should be_valid }
  24 + author: Factory(:user),
  25 + assignee: Factory(:user),
  26 + project: Factory.create(:project)).should be_valid }
27 27  
28 28 describe "plus 1" do
29 29 let(:project) { Factory(:project) }
30 30 subject {
31 31 Factory.create(:merge_request,
32   - :author => Factory(:user),
33   - :assignee => Factory(:user),
34   - :project => project)
  32 + author: Factory(:user),
  33 + assignee: Factory(:user),
  34 + project: project)
35 35 }
36 36  
37 37 it "with no notes has a 0/0 score" do
... ... @@ -58,8 +58,8 @@ describe MergeRequest do
58 58 end
59 59  
60 60 describe ".search" do
61   - let!(:issue) { Factory.create(:issue, :title => "Searchable issue",
62   - :project => Factory.create(:project)) }
  61 + let!(:issue) { Factory.create(:issue, title: "Searchable issue",
  62 + project: Factory.create(:project)) }
63 63  
64 64 it "matches by title" do
65 65 Issue.search('able').all.should == [issue]
... ...
spec/models/milestone_spec.rb
... ... @@ -26,8 +26,8 @@ describe Milestone do
26 26 end
27 27  
28 28 let(:project) { Factory :project }
29   - let(:milestone) { Factory :milestone, :project => project }
30   - let(:issue) { Factory :issue, :project => project }
  29 + let(:milestone) { Factory :milestone, project: project }
  30 + let(:issue) { Factory :issue, project: project }
31 31  
32 32 it { milestone.should be_valid }
33 33  
... ... @@ -39,14 +39,14 @@ describe Milestone do
39 39 it { milestone.percent_complete.should == 0 }
40 40  
41 41 it do
42   - issue.update_attributes :closed => true
  42 + issue.update_attributes closed: true
43 43 milestone.percent_complete.should == 100
44 44 end
45 45 end
46 46  
47 47 describe :expires_at do
48 48 before do
49   - milestone.update_attributes :due_date => Date.today + 1.day
  49 + milestone.update_attributes due_date: Date.today + 1.day
50 50 end
51 51  
52 52 it { milestone.expires_at.should_not be_nil }
... ...
spec/models/note_spec.rb
... ... @@ -14,7 +14,7 @@ describe Note do
14 14 end
15 15  
16 16 it { Factory.create(:note,
17   - :project => project).should be_valid }
  17 + project: project).should be_valid }
18 18 describe "Scopes" do
19 19 it "should have a today named scope that returns ..." do
20 20 Note.today.where_values.should == ["created_at >= '#{Date.today}'"]
... ... @@ -44,9 +44,9 @@ describe Note do
44 44  
45 45 before do
46 46 @note = Factory :note,
47   - :project => project,
48   - :noteable_id => commit.id,
49   - :noteable_type => "Commit"
  47 + project: project,
  48 + noteable_id: commit.id,
  49 + noteable_type: "Commit"
50 50 end
51 51  
52 52 it "should save a valid note" do
... ... @@ -58,10 +58,10 @@ describe Note do
58 58 describe "Pre-line commit notes" do
59 59 before do
60 60 @note = Factory :note,
61   - :project => project,
62   - :noteable_id => commit.id,
63   - :noteable_type => "Commit",
64   - :line_code => "0_16_1"
  61 + project: project,
  62 + noteable_id: commit.id,
  63 + noteable_type: "Commit",
  64 + line_code: "0_16_1"
65 65 end
66 66  
67 67 it "should save a valid note" do
... ... @@ -72,7 +72,7 @@ describe Note do
72 72  
73 73 describe '#create_status_change_note' do
74 74 let(:project) { Factory.create(:project) }
75   - let(:thing) { Factory.create(:issue, :project => project) }
  75 + let(:thing) { Factory.create(:issue, project: project) }
76 76 let(:author) { Factory(:user) }
77 77 let(:status) { 'new_status' }
78 78  
... ... @@ -92,7 +92,7 @@ describe Note do
92 92 describe :authorization do
93 93 before do
94 94 @p1 = project
95   - @p2 = Factory :project, :code => "alien", :path => "gitlabhq_1"
  95 + @p2 = Factory :project, code: "alien", path: "gitlabhq_1"
96 96 @u1 = Factory :user
97 97 @u2 = Factory :user
98 98 @u3 = Factory :user
... ... @@ -102,8 +102,8 @@ describe Note do
102 102  
103 103 describe :read do
104 104 before do
105   - @p1.users_projects.create(:user => @u2, :project_access => UsersProject::GUEST)
106   - @p2.users_projects.create(:user => @u3, :project_access => UsersProject::GUEST)
  105 + @p1.users_projects.create(user: @u2, project_access: UsersProject::GUEST)
  106 + @p2.users_projects.create(user: @u3, project_access: UsersProject::GUEST)
107 107 end
108 108  
109 109 it { @abilities.allowed?(@u1, :read_note, @p1).should be_false }
... ... @@ -113,8 +113,8 @@ describe Note do
113 113  
114 114 describe :write do
115 115 before do
116   - @p1.users_projects.create(:user => @u2, :project_access => UsersProject::DEVELOPER)
117   - @p2.users_projects.create(:user => @u3, :project_access => UsersProject::DEVELOPER)
  116 + @p1.users_projects.create(user: @u2, project_access: UsersProject::DEVELOPER)
  117 + @p2.users_projects.create(user: @u3, project_access: UsersProject::DEVELOPER)
118 118 end
119 119  
120 120 it { @abilities.allowed?(@u1, :write_note, @p1).should be_false }
... ... @@ -124,9 +124,9 @@ describe Note do
124 124  
125 125 describe :admin do
126 126 before do
127   - @p1.users_projects.create(:user => @u1, :project_access => UsersProject::REPORTER)
128   - @p1.users_projects.create(:user => @u2, :project_access => UsersProject::MASTER)
129   - @p2.users_projects.create(:user => @u3, :project_access => UsersProject::MASTER)
  127 + @p1.users_projects.create(user: @u1, project_access: UsersProject::REPORTER)
  128 + @p1.users_projects.create(user: @u2, project_access: UsersProject::MASTER)
  129 + @p2.users_projects.create(user: @u3, project_access: UsersProject::MASTER)
130 130 end
131 131  
132 132 it { @abilities.allowed?(@u1, :admin_note, @p1).should be_false }
... ...
spec/models/project_hooks_spec.rb
... ... @@ -3,7 +3,7 @@ require &#39;spec_helper&#39;
3 3 describe Project, "Hooks" do
4 4 let(:project) { Factory :project }
5 5 before do
6   - @key = Factory :key, :user => project.owner
  6 + @key = Factory :key, user: project.owner
7 7 @user = @key.user
8 8 @key_id = @key.identifier
9 9 end
... ...
spec/models/project_security_spec.rb
... ... @@ -12,7 +12,7 @@ describe Project do
12 12  
13 13 describe "read access" do
14 14 before do
15   - @p1.users_projects.create(:project => @p1, :user => @u2, :project_access => UsersProject::REPORTER)
  15 + @p1.users_projects.create(project: @p1, user: @u2, project_access: UsersProject::REPORTER)
16 16 end
17 17  
18 18 it { @abilities.allowed?(@u1, :read_project, @p1).should be_false }
... ... @@ -21,7 +21,7 @@ describe Project do
21 21  
22 22 describe "write access" do
23 23 before do
24   - @p1.users_projects.create(:project => @p1, :user => @u2, :project_access => UsersProject::DEVELOPER)
  24 + @p1.users_projects.create(project: @p1, user: @u2, project_access: UsersProject::DEVELOPER)
25 25 end
26 26  
27 27 it { @abilities.allowed?(@u1, :write_project, @p1).should be_false }
... ... @@ -30,8 +30,8 @@ describe Project do
30 30  
31 31 describe "admin access" do
32 32 before do
33   - @p1.users_projects.create(:project => @p1, :user => @u1, :project_access => UsersProject::DEVELOPER)
34   - @p1.users_projects.create(:project => @p1, :user => @u2, :project_access => UsersProject::MASTER)
  33 + @p1.users_projects.create(project: @p1, user: @u1, project_access: UsersProject::DEVELOPER)
  34 + @p1.users_projects.create(project: @p1, user: @u2, project_access: UsersProject::MASTER)
35 35 end
36 36  
37 37 it { @abilities.allowed?(@u1, :admin_project, @p1).should be_false }
... ...
spec/models/project_spec.rb
... ... @@ -80,17 +80,17 @@ describe Project do
80 80 end
81 81  
82 82 it "should return valid url to repo" do
83   - project = Project.new(:path => "somewhere")
  83 + project = Project.new(path: "somewhere")
84 84 project.url_to_repo.should == Gitlab.config.ssh_path + "somewhere.git"
85 85 end
86 86  
87 87 it "should return path to repo" do
88   - project = Project.new(:path => "somewhere")
  88 + project = Project.new(path: "somewhere")
89 89 project.path_to_repo.should == File.join(Rails.root, "tmp", "tests", "somewhere")
90 90 end
91 91  
92 92 it "returns the full web URL for this repo" do
93   - project = Project.new(:code => "somewhere")
  93 + project = Project.new(code: "somewhere")
94 94 project.web_url.should == "#{Gitlab.config.url}/somewhere"
95 95 end
96 96  
... ... @@ -101,7 +101,7 @@ describe Project do
101 101 end
102 102  
103 103 it "should be invalid repo" do
104   - project = Project.new(:name => "ok_name", :path => "/INVALID_PATH/", :code => "NEOK")
  104 + project = Project.new(name: "ok_name", path: "/INVALID_PATH/", code: "NEOK")
105 105 project.valid_repo?.should be_false
106 106 end
107 107 end
... ... @@ -121,7 +121,7 @@ describe Project do
121 121 let(:project) { Factory :project }
122 122  
123 123 it 'returns the creation date of the project\'s last event if present' do
124   - last_event = double(:created_at => 'now')
  124 + last_event = double(created_at: 'now')
125 125 project.stub(:events).and_return( [double, double, last_event] )
126 126 project.last_activity_date.should == last_event.created_at
127 127 end
... ... @@ -161,7 +161,7 @@ describe Project do
161 161 end
162 162  
163 163 it "should return nil" do
164   - lambda { Project.new(:path => "invalid").repo }.should raise_error(Grit::NoSuchPathError)
  164 + lambda { Project.new(path: "invalid").repo }.should raise_error(Grit::NoSuchPathError)
165 165 end
166 166  
167 167 it "should return nil" do
... ... @@ -214,10 +214,10 @@ describe Project do
214 214  
215 215 before do
216 216 @merge_request = Factory :merge_request,
217   - :project => project,
218   - :merged => false,
219   - :closed => false
220   - @key = Factory :key, :user_id => project.owner.id
  217 + project: project,
  218 + merged: false,
  219 + closed: false
  220 + @key = Factory :key, user_id: project.owner.id
221 221 end
222 222  
223 223 it "should close merge request if last commit from source branch was pushed to target branch" do
... ...
spec/models/protected_branch_spec.rb
... ... @@ -24,7 +24,7 @@ describe ProtectedBranch do
24 24 end
25 25  
26 26 describe 'Callbacks' do
27   - subject { ProtectedBranch.new(:project => project, :name => 'branch_name') }
  27 + subject { ProtectedBranch.new(project: project, name: 'branch_name') }
28 28  
29 29 it 'call update_repository after save' do
30 30 subject.should_receive(:update_repository)
... ... @@ -38,7 +38,7 @@ describe ProtectedBranch do
38 38 end
39 39  
40 40 describe '#commit' do
41   - subject { ProtectedBranch.new(:project => project, :name => 'cant_touch_this') }
  41 + subject { ProtectedBranch.new(project: project, name: 'cant_touch_this') }
42 42  
43 43 it 'commits itself to its project' do
44 44 project.should_receive(:commit).with('cant_touch_this')
... ...
spec/models/system_hook_spec.rb
... ... @@ -12,7 +12,7 @@ describe SystemHook do
12 12 it "project_create hook" do
13 13 user = Factory :user
14 14 with_resque do
15   - project = Factory :project_without_owner, :owner => user
  15 + project = Factory :project_without_owner, owner: user
16 16 end
17 17 WebMock.should have_requested(:post, @system_hook.url).with(body: /project_create/).once
18 18 end
... ...
spec/models/user_spec.rb
... ... @@ -18,29 +18,29 @@ describe User do
18 18 end
19 19  
20 20 it "should return valid identifier" do
21   - user = User.new(:email => "test@mail.com")
  21 + user = User.new(email: "test@mail.com")
22 22 user.identifier.should == "test_mail_com"
23 23 end
24 24  
25 25 it "should return identifier without + sign" do
26   - user = User.new(:email => "test+foo@mail.com")
  26 + user = User.new(email: "test+foo@mail.com")
27 27 user.identifier.should == "test_foo_mail_com"
28 28 end
29 29  
30 30 it "should execute callback when force_random_password specified" do
31   - user = User.new(:email => "test@mail.com", :force_random_password => true)
  31 + user = User.new(email: "test@mail.com", force_random_password: true)
32 32 user.should_receive(:generate_password)
33 33 user.save
34 34 end
35 35  
36 36 it "should not generate password by default" do
37   - user = Factory(:user, :password => 'abcdefg', :password_confirmation => 'abcdefg')
  37 + user = Factory(:user, password: 'abcdefg', password_confirmation: 'abcdefg')
38 38 user.password.should == 'abcdefg'
39 39 end
40 40  
41 41 it "should generate password when forcing random password" do
42 42 Devise.stub(:friendly_token).and_return('123456789')
43   - user = User.create(:email => "test1@mail.com", :force_random_password => true)
  43 + user = User.create(email: "test1@mail.com", force_random_password: true)
44 44 user.password.should == user.password_confirmation
45 45 user.password.should == '12345678'
46 46 end
... ... @@ -54,8 +54,8 @@ describe User do
54 54 before do
55 55 @user = Factory :user
56 56 @note = Factory :note,
57   - :author => @user,
58   - :project => Factory(:project)
  57 + author: @user,
  58 + project: Factory(:project)
59 59 end
60 60  
61 61 it "should destroy all notes with user" do
... ...
spec/requests/admin/admin_hooks_spec.rb
... ... @@ -3,8 +3,8 @@ require &#39;spec_helper&#39;
3 3 describe "Admin::Hooks" do
4 4 before do
5 5 @project = Factory :project,
6   - :name => "LeGiT",
7   - :code => "LGT"
  6 + name: "LeGiT",
  7 + code: "LGT"
8 8 login_as :admin
9 9  
10 10 @system_hook = Factory :system_hook
... ... @@ -30,7 +30,7 @@ describe &quot;Admin::Hooks&quot; do
30 30 before do
31 31 @url = Faker::Internet.uri("http")
32 32 visit admin_hooks_path
33   - fill_in "hook_url", :with => @url
  33 + fill_in "hook_url", with: @url
34 34 expect { click_button "Add System Hook" }.to change(SystemHook, :count).by(1)
35 35 end
36 36  
... ...
spec/requests/admin/admin_projects_spec.rb
... ... @@ -3,8 +3,8 @@ require &#39;spec_helper&#39;
3 3 describe "Admin::Projects" do
4 4 before do
5 5 @project = Factory :project,
6   - :name => "LeGiT",
7   - :code => "LGT"
  6 + name: "LeGiT",
  7 + code: "LGT"
8 8 login_as :admin
9 9 end
10 10  
... ... @@ -47,8 +47,8 @@ describe &quot;Admin::Projects&quot; do
47 47  
48 48 describe "Update project" do
49 49 before do
50   - fill_in "project_name", :with => "Big Bang"
51   - fill_in "project_code", :with => "BB1"
  50 + fill_in "project_name", with: "Big Bang"
  51 + fill_in "project_code", with: "BB1"
52 52 click_button "Save Project"
53 53 @project.reload
54 54 end
... ... @@ -85,9 +85,9 @@ describe &quot;Admin::Projects&quot; do
85 85 describe "POST /admin/projects" do
86 86 before do
87 87 visit new_admin_project_path
88   - fill_in 'project_name', :with => 'NewProject'
89   - fill_in 'project_code', :with => 'NPR'
90   - fill_in 'project_path', :with => 'gitlabhq_1'
  88 + fill_in 'project_name', with: 'NewProject'
  89 + fill_in 'project_code', with: 'NPR'
  90 + fill_in 'project_path', with: 'gitlabhq_1'
91 91 expect { click_button "Create project" }.to change { Project.count }.by(1)
92 92 @project = Project.last
93 93 end
... ... @@ -109,7 +109,7 @@ describe &quot;Admin::Projects&quot; do
109 109 end
110 110  
111 111 it "should create new user" do
112   - select @new_user.name, :from => "user_ids"
  112 + select @new_user.name, from: "user_ids"
113 113 expect { click_button "Add" }.to change { UsersProject.count }.by(1)
114 114 page.should have_content @new_user.name
115 115 current_path.should == admin_project_path(@project)
... ...
spec/requests/admin/admin_users_spec.rb
... ... @@ -22,10 +22,10 @@ describe &quot;Admin::Users&quot; do
22 22 before do
23 23 @password = "123ABC"
24 24 visit new_admin_user_path
25   - fill_in "user_name", :with => "Big Bang"
26   - fill_in "user_email", :with => "bigbang@mail.com"
27   - fill_in "user_password", :with => @password
28   - fill_in "user_password_confirmation", :with => @password
  25 + fill_in "user_name", with: "Big Bang"
  26 + fill_in "user_email", with: "bigbang@mail.com"
  27 + fill_in "user_password", with: @password
  28 + fill_in "user_password_confirmation", with: @password
29 29 end
30 30  
31 31 it "should create new user" do
... ... @@ -40,7 +40,7 @@ describe &quot;Admin::Users&quot; do
40 40 end
41 41  
42 42 it "should call send mail" do
43   - Notify.should_receive(:new_user_email).and_return(stub(:deliver => true))
  43 + Notify.should_receive(:new_user_email).and_return(stub(deliver: true))
44 44  
45 45 User.observers.enable :user_observer do
46 46 click_button "Save"
... ... @@ -88,8 +88,8 @@ describe &quot;Admin::Users&quot; do
88 88  
89 89 describe "Update user" do
90 90 before do
91   - fill_in "user_name", :with => "Big Bang"
92   - fill_in "user_email", :with => "bigbang@mail.com"
  91 + fill_in "user_name", with: "Big Bang"
  92 + fill_in "user_email", with: "bigbang@mail.com"
93 93 check "user_admin"
94 94 click_button "Save"
95 95 end
... ... @@ -114,7 +114,7 @@ describe &quot;Admin::Users&quot; do
114 114 end
115 115  
116 116 it "should create new user" do
117   - select @new_project.name, :from => "project_ids"
  117 + select @new_project.name, from: "project_ids"
118 118 expect { click_button "Add" }.to change { UsersProject.count }.by(1)
119 119 page.should have_content @new_project.name
120 120 current_path.should == admin_user_path(@user)
... ...
spec/requests/atom/dashboard_issues_spec.rb
... ... @@ -7,40 +7,40 @@ describe &quot;User Issues Dashboard&quot; do
7 7 login_as :user
8 8  
9 9 @project1 = Factory :project,
10   - :path => "project1",
11   - :code => "TEST1"
  10 + path: "project1",
  11 + code: "TEST1"
12 12  
13 13 @project2 = Factory :project,
14   - :path => "project2",
15   - :code => "TEST2"
  14 + path: "project2",
  15 + code: "TEST2"
16 16  
17 17 @project1.add_access(@user, :read, :write)
18 18 @project2.add_access(@user, :read, :write)
19 19  
20 20 @issue1 = Factory :issue,
21   - :author => @user,
22   - :assignee => @user,
23   - :project => @project1
  21 + author: @user,
  22 + assignee: @user,
  23 + project: @project1
24 24  
25 25 @issue2 = Factory :issue,
26   - :author => @user,
27   - :assignee => @user,
28   - :project => @project2
  26 + author: @user,
  27 + assignee: @user,
  28 + project: @project2
29 29  
30 30 visit dashboard_issues_path
31 31 end
32 32  
33   - describe "atom feed", :js => false do
  33 + describe "atom feed", js: false do
34 34 it "should render atom feed via private token" do
35 35 logout
36   - visit dashboard_issues_path(:atom, :private_token => @user.private_token)
  36 + visit dashboard_issues_path(:atom, private_token: @user.private_token)
37 37  
38 38 page.response_headers['Content-Type'].should have_content("application/atom+xml")
39   - page.body.should have_selector("title", :text => "#{@user.name} issues")
40   - page.body.should have_selector("author email", :text => @issue1.author_email)
41   - page.body.should have_selector("entry summary", :text => @issue1.title)
42   - page.body.should have_selector("author email", :text => @issue2.author_email)
43   - page.body.should have_selector("entry summary", :text => @issue2.title)
  39 + page.body.should have_selector("title", text: "#{@user.name} issues")
  40 + page.body.should have_selector("author email", text: @issue1.author_email)
  41 + page.body.should have_selector("entry summary", text: @issue1.title)
  42 + page.body.should have_selector("author email", text: @issue2.author_email)
  43 + page.body.should have_selector("entry summary", text: @issue2.title)
44 44 end
45 45 end
46 46 end
... ...
spec/requests/atom/dashboard_spec.rb
... ... @@ -5,7 +5,7 @@ describe &quot;User Dashboard&quot; do
5 5  
6 6 describe "GET /" do
7 7 before do
8   - @project = Factory :project, :owner => @user
  8 + @project = Factory :project, owner: @user
9 9 @project.add_access(@user, :read)
10 10 visit dashboard_path
11 11 end
... ... @@ -13,14 +13,14 @@ describe &quot;User Dashboard&quot; do
13 13 it "should render projects atom feed via private token" do
14 14 logout
15 15  
16   - visit dashboard_path(:atom, :private_token => @user.private_token)
  16 + visit dashboard_path(:atom, private_token: @user.private_token)
17 17 page.body.should have_selector("feed title")
18 18 end
19 19  
20 20 it "should not render projects page via private token" do
21 21 logout
22 22  
23   - visit dashboard_path(:private_token => @user.private_token)
  23 + visit dashboard_path(private_token: @user.private_token)
24 24 current_path.should == new_user_session_path
25 25 end
26 26 end
... ...
spec/requests/atom/issues_spec.rb
... ... @@ -11,9 +11,9 @@ describe &quot;Issues&quot; do
11 11 describe "GET /issues" do
12 12 before do
13 13 @issue = Factory :issue,
14   - :author => @user,
15   - :assignee => @user,
16   - :project => project
  14 + author: @user,
  15 + assignee: @user,
  16 + project: project
17 17  
18 18 visit project_issues_path(project)
19 19 end
... ... @@ -22,19 +22,19 @@ describe &quot;Issues&quot; do
22 22 visit project_issues_path(project, :atom)
23 23  
24 24 page.response_headers['Content-Type'].should have_content("application/atom+xml")
25   - page.body.should have_selector("title", :text => "#{project.name} issues")
26   - page.body.should have_selector("author email", :text => @issue.author_email)
27   - page.body.should have_selector("entry summary", :text => @issue.title)
  25 + page.body.should have_selector("title", text: "#{project.name} issues")
  26 + page.body.should have_selector("author email", text: @issue.author_email)
  27 + page.body.should have_selector("entry summary", text: @issue.title)
28 28 end
29 29  
30 30 it "should render atom feed via private token" do
31 31 logout
32   - visit project_issues_path(project, :atom, :private_token => @user.private_token)
  32 + visit project_issues_path(project, :atom, private_token: @user.private_token)
33 33  
34 34 page.response_headers['Content-Type'].should have_content("application/atom+xml")
35   - page.body.should have_selector("title", :text => "#{project.name} issues")
36   - page.body.should have_selector("author email", :text => @issue.author_email)
37   - page.body.should have_selector("entry summary", :text => @issue.title)
  35 + page.body.should have_selector("title", text: "#{project.name} issues")
  36 + page.body.should have_selector("author email", text: @issue.author_email)
  37 + page.body.should have_selector("entry summary", text: @issue.title)
38 38 end
39 39 end
40 40 end
... ...
spec/requests/gitlab_flavored_markdown_spec.rb
... ... @@ -2,10 +2,10 @@ require &#39;spec_helper&#39;
2 2  
3 3 describe "Gitlab Flavored Markdown" do
4 4 let(:project) { Factory :project }
5   - let(:issue) { Factory :issue, :project => project }
6   - let(:merge_request) { Factory :merge_request, :project => project }
  5 + let(:issue) { Factory :issue, project: project }
  6 + let(:merge_request) { Factory :merge_request, project: project }
7 7 let(:fred) do
8   - u = Factory :user, :name => "fred"
  8 + u = Factory :user, name: "fred"
9 9 project.users << u
10 10 u
11 11 end
... ... @@ -19,7 +19,7 @@ describe &quot;Gitlab Flavored Markdown&quot; do
19 19 @test_file = "gfm_test_file"
20 20 i.add(@test_file, "foo\nbar\n")
21 21 # add commit with gfm
22   - i.commit("fix ##{issue.id}\n\nask @#{fred.name} for details", :head => @branch_name)
  22 + i.commit("fix ##{issue.id}\n\nask @#{fred.name} for details", head: @branch_name)
23 23  
24 24 # add test tag
25 25 @tag_name = "gfm-test-tag"
... ... @@ -27,8 +27,8 @@ describe &quot;Gitlab Flavored Markdown&quot; do
27 27 end
28 28 after do
29 29 # delete test branch and tag
30   - project.repo.git.native(:branch, {:D => true}, @branch_name)
31   - project.repo.git.native(:tag, {:d => true}, @tag_name)
  30 + project.repo.git.native(:branch, {D: true}, @branch_name)
  31 + project.repo.git.native(:tag, {d: true}, @tag_name)
32 32 project.repo.gc_auto
33 33 end
34 34  
... ... @@ -42,25 +42,25 @@ describe &quot;Gitlab Flavored Markdown&quot; do
42 42  
43 43 describe "for commits" do
44 44 it "should render title in commits#index" do
45   - visit project_commits_path(project, :ref => @branch_name)
  45 + visit project_commits_path(project, ref: @branch_name)
46 46  
47 47 page.should have_link("##{issue.id}")
48 48 end
49 49  
50 50 it "should render title in commits#show" do
51   - visit project_commit_path(project, :id => commit.id)
  51 + visit project_commit_path(project, id: commit.id)
52 52  
53 53 page.should have_link("##{issue.id}")
54 54 end
55 55  
56 56 it "should render description in commits#show" do
57   - visit project_commit_path(project, :id => commit.id)
  57 + visit project_commit_path(project, id: commit.id)
58 58  
59 59 page.should have_link("@#{fred.name}")
60 60 end
61 61  
62   - it "should render title in refs#tree", :js => true do
63   - visit tree_project_ref_path(project, :id => @branch_name)
  62 + it "should render title in refs#tree", js: true do
  63 + visit tree_project_ref_path(project, id: @branch_name)
64 64  
65 65 within(".tree_commit") do
66 66 page.should have_link("##{issue.id}")
... ... @@ -68,7 +68,7 @@ describe &quot;Gitlab Flavored Markdown&quot; do
68 68 end
69 69  
70 70 it "should render title in refs#blame" do
71   - visit blame_file_project_ref_path(project, :id => @branch_name, :path => @test_file)
  71 + visit blame_file_project_ref_path(project, id: @branch_name, path: @test_file)
72 72  
73 73 within(".blame_commit") do
74 74 page.should have_link("##{issue.id}")
... ... @@ -92,15 +92,15 @@ describe &quot;Gitlab Flavored Markdown&quot; do
92 92 describe "for issues" do
93 93 before do
94 94 @other_issue = Factory :issue,
95   - :author => @user,
96   - :assignee => @user,
97   - :project => project
  95 + author: @user,
  96 + assignee: @user,
  97 + project: project
98 98 @issue = Factory :issue,
99   - :author => @user,
100   - :assignee => @user,
101   - :project => project,
102   - :title => "fix ##{@other_issue.id}",
103   - :description => "ask @#{fred.name} for details"
  99 + author: @user,
  100 + assignee: @user,
  101 + project: project,
  102 + title: "fix ##{@other_issue.id}",
  103 + description: "ask @#{fred.name} for details"
104 104 end
105 105  
106 106 it "should render subject in issues#index" do
... ... @@ -126,8 +126,8 @@ describe &quot;Gitlab Flavored Markdown&quot; do
126 126 describe "for merge requests" do
127 127 before do
128 128 @merge_request = Factory :merge_request,
129   - :project => project,
130   - :title => "fix ##{issue.id}"
  129 + project: project,
  130 + title: "fix ##{issue.id}"
131 131 end
132 132  
133 133 it "should render title in merge_requests#index" do
... ... @@ -147,9 +147,9 @@ describe &quot;Gitlab Flavored Markdown&quot; do
147 147 describe "for milestones" do
148 148 before do
149 149 @milestone = Factory :milestone,
150   - :project => project,
151   - :title => "fix ##{issue.id}",
152   - :description => "ask @#{fred.name} for details"
  150 + project: project,
  151 + title: "fix ##{issue.id}",
  152 + description: "ask @#{fred.name} for details"
153 153 end
154 154  
155 155 it "should render title in milestones#index" do
... ... @@ -173,45 +173,45 @@ describe &quot;Gitlab Flavored Markdown&quot; do
173 173  
174 174  
175 175 describe "for notes" do
176   - it "should render in commits#show", :js => true do
177   - visit project_commit_path(project, :id => commit.id)
178   - fill_in "note_note", :with => "see ##{issue.id}"
  176 + it "should render in commits#show", js: true do
  177 + visit project_commit_path(project, id: commit.id)
  178 + fill_in "note_note", with: "see ##{issue.id}"
179 179 click_button "Add Comment"
180 180  
181 181 page.should have_link("##{issue.id}")
182 182 end
183 183  
184   - it "should render in issue#show", :js => true do
  184 + it "should render in issue#show", js: true do
185 185 visit project_issue_path(project, issue)
186   - fill_in "note_note", :with => "see ##{issue.id}"
  186 + fill_in "note_note", with: "see ##{issue.id}"
187 187 click_button "Add Comment"
188 188  
189 189 page.should have_link("##{issue.id}")
190 190 end
191 191  
192   - it "should render in merge_request#show", :js => true do
  192 + it "should render in merge_request#show", js: true do
193 193 visit project_merge_request_path(project, merge_request)
194   - fill_in "note_note", :with => "see ##{issue.id}"
  194 + fill_in "note_note", with: "see ##{issue.id}"
195 195 click_button "Add Comment"
196 196  
197 197 page.should have_link("##{issue.id}")
198 198 end
199 199  
200   - it "should render in projects#wall", :js => true do
  200 + it "should render in projects#wall", js: true do
201 201 visit wall_project_path(project)
202   - fill_in "note_note", :with => "see ##{issue.id}"
  202 + fill_in "note_note", with: "see ##{issue.id}"
203 203 click_button "Add Comment"
204 204  
205 205 page.should have_link("##{issue.id}")
206 206 end
207 207  
208   - it "should render in wikis#index", :js => true do
  208 + it "should render in wikis#index", js: true do
209 209 visit project_wiki_path(project, :index)
210   - fill_in "Title", :with => 'Test title'
211   - fill_in "Content", :with => '[link test](test)'
  210 + fill_in "Title", with: 'Test title'
  211 + fill_in "Content", with: '[link test](test)'
212 212 click_on "Save"
213 213  
214   - fill_in "note_note", :with => "see ##{issue.id}"
  214 + fill_in "note_note", with: "see ##{issue.id}"
215 215 click_button "Add Comment"
216 216  
217 217 page.should have_link("##{issue.id}")
... ... @@ -222,8 +222,8 @@ describe &quot;Gitlab Flavored Markdown&quot; do
222 222 describe "for wikis" do
223 223 before do
224 224 visit project_wiki_path(project, :index)
225   - fill_in "Title", :with => "Circumvent ##{issue.id}"
226   - fill_in "Content", :with => "# Other pages\n\n* [Foo](foo)\n* [Bar](bar)\n\nAlso look at ##{issue.id} :-)"
  225 + fill_in "Title", with: "Circumvent ##{issue.id}"
  226 + fill_in "Content", with: "# Other pages\n\n* [Foo](foo)\n* [Bar](bar)\n\nAlso look at ##{issue.id} :-)"
227 227 click_on "Save"
228 228 end
229 229  
... ...
spec/requests/hooks_spec.rb
... ... @@ -9,7 +9,7 @@ describe &quot;Hooks&quot; do
9 9  
10 10 describe "GET index" do
11 11 it "should be available" do
12   - @hook = Factory :project_hook, :project => @project
  12 + @hook = Factory :project_hook, project: @project
13 13 visit project_hooks_path(@project)
14 14 page.should have_content "Hooks"
15 15 page.should have_content @hook.url
... ... @@ -20,7 +20,7 @@ describe &quot;Hooks&quot; do
20 20 before do
21 21 @url = Faker::Internet.uri("http")
22 22 visit project_hooks_path(@project)
23   - fill_in "hook_url", :with => @url
  23 + fill_in "hook_url", with: @url
24 24 expect { click_button "Add Web Hook" }.to change(ProjectHook, :count).by(1)
25 25 end
26 26  
... ... @@ -32,7 +32,7 @@ describe &quot;Hooks&quot; do
32 32  
33 33 describe "Test" do
34 34 before do
35   - @hook = Factory :project_hook, :project => @project
  35 + @hook = Factory :project_hook, project: @project
36 36 stub_request(:post, @hook.url)
37 37 visit project_hooks_path(@project)
38 38 click_link "Test Hook"
... ...
spec/requests/issues_spec.rb
... ... @@ -11,12 +11,12 @@ describe &quot;Issues&quot; do
11 11 project.add_access(@user2, :read, :write)
12 12 end
13 13  
14   - describe "Edit issue", :js => true do
  14 + describe "Edit issue", js: true do
15 15 before do
16 16 @issue = Factory :issue,
17   - :author => @user,
18   - :assignee => @user,
19   - :project => project
  17 + author: @user,
  18 + assignee: @user,
  19 + project: project
20 20 visit project_issues_path(project)
21 21 click_link "Edit"
22 22 end
... ... @@ -27,8 +27,8 @@ describe &quot;Issues&quot; do
27 27  
28 28 describe "fill in" do
29 29 before do
30   - fill_in "issue_title", :with => "bug 345"
31   - fill_in "issue_description", :with => "bug description"
  30 + fill_in "issue_title", with: "bug 345"
  31 + fill_in "issue_description", with: "bug description"
32 32 end
33 33  
34 34 it { expect { click_button "Save changes" }.to_not change {Issue.count} }
... ... @@ -43,14 +43,14 @@ describe &quot;Issues&quot; do
43 43 end
44 44 end
45 45  
46   - describe "Search issue", :js => true do
  46 + describe "Search issue", js: true do
47 47 before do
48 48 ['foobar', 'foobar2', 'gitlab'].each do |title|
49 49 @issue = Factory :issue,
50   - :author => @user,
51   - :assignee => @user,
52   - :project => project,
53   - :title => title
  50 + author: @user,
  51 + assignee: @user,
  52 + project: project,
  53 + title: title
54 54 @issue.save
55 55 end
56 56 end
... ... @@ -62,7 +62,7 @@ describe &quot;Issues&quot; do
62 62  
63 63 visit project_issues_path(project)
64 64 click_link 'Closed'
65   - fill_in 'issue_search', :with => 'foobar'
  65 + fill_in 'issue_search', with: 'foobar'
66 66  
67 67 page.should have_content 'foobar'
68 68 page.should_not have_content 'foobar2'
... ... @@ -71,7 +71,7 @@ describe &quot;Issues&quot; do
71 71  
72 72 it "should search for term and return the correct results" do
73 73 visit project_issues_path(project)
74   - fill_in 'issue_search', :with => 'foobar'
  74 + fill_in 'issue_search', with: 'foobar'
75 75  
76 76 page.should have_content 'foobar'
77 77 page.should have_content 'foobar2'
... ... @@ -80,8 +80,8 @@ describe &quot;Issues&quot; do
80 80  
81 81 it "should return all results if term has been cleared" do
82 82 visit project_issues_path(project)
83   - fill_in "issue_search", :with => "foobar"
84   - # Because fill_in, :with => "" triggers nothing we need to trigger a keyup event
  83 + fill_in "issue_search", with: "foobar"
  84 + # Because fill_in, with: "" triggers nothing we need to trigger a keyup event
85 85 page.execute_script("$('.issue_search').val('').keyup();");
86 86  
87 87 page.should have_content 'foobar'
... ...
spec/requests/projects_deploy_keys_spec.rb
... ... @@ -10,7 +10,7 @@ describe &quot;Projects&quot;, &quot;DeployKeys&quot; do
10 10  
11 11 describe "GET /keys" do
12 12 before do
13   - @key = Factory :key, :project => project
  13 + @key = Factory :key, project: project
14 14 visit project_deploy_keys_path(project)
15 15 end
16 16  
... ... @@ -41,8 +41,8 @@ describe &quot;Projects&quot;, &quot;DeployKeys&quot; do
41 41  
42 42 describe "fill in" do
43 43 before do
44   - fill_in "key_title", :with => "laptop"
45   - fill_in "key_key", :with => "publickey234="
  44 + fill_in "key_title", with: "laptop"
  45 + fill_in "key_key", with: "publickey234="
46 46 end
47 47  
48 48 it { expect { click_button "Save" }.to change {Key.count}.by(1) }
... ... @@ -57,7 +57,7 @@ describe &quot;Projects&quot;, &quot;DeployKeys&quot; do
57 57  
58 58 describe "Show page" do
59 59 before do
60   - @key = Factory :key, :project => project
  60 + @key = Factory :key, project: project
61 61 visit project_deploy_key_path(project, @key)
62 62 end
63 63  
... ...
spec/requests/projects_spec.rb
... ... @@ -5,7 +5,7 @@ describe &quot;Projects&quot; do
5 5  
6 6 describe "GET /projects/show" do
7 7 before do
8   - @project = Factory :project, :owner => @user
  8 + @project = Factory :project, owner: @user
9 9 @project.add_access(@user, :read)
10 10  
11 11 visit project_path(@project)
... ... @@ -37,13 +37,13 @@ describe &quot;Projects&quot; do
37 37  
38 38 describe "PUT /projects/:id" do
39 39 before do
40   - @project = Factory :project, :owner => @user
  40 + @project = Factory :project, owner: @user
41 41 @project.add_access(@user, :admin, :read)
42 42  
43 43 visit edit_project_path(@project)
44 44  
45   - fill_in 'project_name', :with => 'Awesome'
46   - fill_in 'project_code', :with => 'gitlabhq'
  45 + fill_in 'project_name', with: 'Awesome'
  46 + fill_in 'project_code', with: 'gitlabhq'
47 47 click_button "Save"
48 48 @project = @project.reload
49 49 end
... ...
spec/requests/search_spec.rb
... ... @@ -6,7 +6,7 @@ describe &quot;Search&quot; do
6 6 @project = Factory :project
7 7 @project.add_access(@user, :read)
8 8 visit search_path
9   - fill_in "search", :with => @project.name[0..3]
  9 + fill_in "search", with: @project.name[0..3]
10 10 click_button "Search"
11 11 end
12 12  
... ...
spec/requests/security/project_access_spec.rb
... ... @@ -20,9 +20,9 @@ describe &quot;Application access&quot; do
20 20 @u2 = Factory :user
21 21 @u3 = Factory :user
22 22 # full access
23   - @project.users_projects.create(:user => @u1, :project_access => UsersProject::MASTER)
  23 + @project.users_projects.create(user: @u1, project_access: UsersProject::MASTER)
24 24 # readonly
25   - @project.users_projects.create(:user => @u3, :project_access => UsersProject::REPORTER)
  25 + @project.users_projects.create(user: @u3, project_access: UsersProject::REPORTER)
26 26 end
27 27  
28 28 describe "GET /project_code" do
... ... @@ -83,7 +83,7 @@ describe &quot;Application access&quot; do
83 83 before do
84 84 @commit = @project.commit
85 85 @path = @commit.tree.contents.select { |i| i.is_a?(Grit::Blob)}.first.name
86   - @blob_path = blob_project_ref_path(@project, @commit.id, :path => @path)
  86 + @blob_path = blob_project_ref_path(@project, @commit.id, path: @path)
87 87 end
88 88  
89 89 it { @blob_path.should be_allowed_for @u1 }
... ...
spec/requests/snippets_spec.rb
... ... @@ -11,8 +11,8 @@ describe &quot;Snippets&quot; do
11 11 describe "GET /snippets" do
12 12 before do
13 13 @snippet = Factory :snippet,
14   - :author => @user,
15   - :project => project
  14 + author: @user,
  15 + project: project
16 16  
17 17 visit project_snippets_path(project)
18 18 end
... ... @@ -50,9 +50,9 @@ describe &quot;Snippets&quot; do
50 50  
51 51 describe "fill in" do
52 52 before do
53   - fill_in "snippet_title", :with => "login function"
54   - fill_in "snippet_file_name", :with => "test.rb"
55   - fill_in "snippet_content", :with => "def login; end"
  53 + fill_in "snippet_title", with: "login function"
  54 + fill_in "snippet_file_name", with: "test.rb"
  55 + fill_in "snippet_content", with: "def login; end"
56 56 end
57 57  
58 58 it { expect { click_button "Save" }.to change {Snippet.count}.by(1) }
... ... @@ -69,8 +69,8 @@ describe &quot;Snippets&quot; do
69 69 describe "Edit snippet" do
70 70 before do
71 71 @snippet = Factory :snippet,
72   - :author => @user,
73   - :project => project
  72 + author: @user,
  73 + project: project
74 74 visit project_snippet_path(project, @snippet)
75 75 click_link "Edit"
76 76 end
... ... @@ -81,9 +81,9 @@ describe &quot;Snippets&quot; do
81 81  
82 82 describe "fill in" do
83 83 before do
84   - fill_in "snippet_title", :with => "login function"
85   - fill_in "snippet_file_name", :with => "test.rb"
86   - fill_in "snippet_content", :with => "def login; end"
  84 + fill_in "snippet_title", with: "login function"
  85 + fill_in "snippet_file_name", with: "test.rb"
  86 + fill_in "snippet_content", with: "def login; end"
87 87 end
88 88  
89 89 it { expect { click_button "Save" }.to_not change {Snippet.count} }
... ...
spec/spec_helper.rb
... ... @@ -37,7 +37,7 @@ RSpec.configure do |config|
37 37 # instead of true.
38 38 config.use_transactional_fixtures = false
39 39  
40   - config.before :each, :type => :integration do
  40 + config.before :each, type: :integration do
41 41 DeviseSessionMock.disable
42 42 end
43 43  
... ... @@ -59,7 +59,7 @@ RSpec.configure do |config|
59 59 DatabaseCleaner.clean
60 60 end
61 61  
62   - config.include RSpec::Rails::RequestExampleGroup, :type => :request, :example_group => {
63   - :file_path => /spec\/api/
  62 + config.include RSpec::Rails::RequestExampleGroup, type: :request, example_group: {
  63 + file_path: /spec\/api/
64 64 }
65 65 end
... ...
spec/support/login.rb
1 1 module LoginMacros
2 2 def login_as role
3   - @user = User.create(:email => "user#{User.count}@mail.com",
4   - :name => "John Smith",
5   - :password => "123456",
6   - :password_confirmation => "123456",
7   - :skype => 'user_skype')
  3 + @user = User.create(email: "user#{User.count}@mail.com",
  4 + name: "John Smith",
  5 + password: "123456",
  6 + password_confirmation: "123456",
  7 + skype: 'user_skype')
8 8  
9 9 if role == :admin
10 10 @user.admin = true
... ... @@ -12,15 +12,15 @@ module LoginMacros
12 12 end
13 13  
14 14 visit new_user_session_path
15   - fill_in "user_email", :with => @user.email
16   - fill_in "user_password", :with => "123456"
  15 + fill_in "user_email", with: @user.email
  16 + fill_in "user_password", with: "123456"
17 17 click_button "Sign in"
18 18 end
19 19  
20 20 def login_with(user)
21 21 visit new_user_session_path
22   - fill_in "user_email", :with => user.email
23   - fill_in "user_password", :with => "123456"
  22 + fill_in "user_email", with: user.email
  23 + fill_in "user_password", with: "123456"
24 24 click_button "Sign in"
25 25 end
26 26  
... ...
spec/workers/post_receive_spec.rb
... ... @@ -10,7 +10,7 @@ describe PostReceive do
10 10  
11 11 context "web hook" do
12 12 let(:project) { Factory.create(:project) }
13   - let(:key) { Factory.create(:key, :user => project.owner) }
  13 + let(:key) { Factory.create(:key, user: project.owner) }
14 14 let(:key_id) { key.identifier }
15 15  
16 16 it "fetches the correct project" do
... ...