From 56d78056172cee2ceb6188b92c1706d25302ac06 Mon Sep 17 00:00:00 2001 From: Todd Sedano Date: Sat, 4 Apr 2015 19:38:16 -0700 Subject: [PATCH] Replaeced double quote to single quote --- .../omniauth_callbacks_controller.rb | 4 +-- app/controllers/sessions_controller.rb | 2 +- app/controllers/status_controller.rb | 4 +-- app/controllers/users_controller.rb | 2 +- app/decorators/aggregate_project_decorator.rb | 1 - app/decorators/circle_ci_project_decorator.rb | 1 - app/decorators/codeship_project_decorator.rb | 1 - app/decorators/concourse_project_decorator.rb | 1 - app/decorators/jenkins_project_decorator.rb | 1 - app/decorators/project_decorator.rb | 4 +-- app/decorators/tddium_project_decorator.rb | 1 - app/decorators/team_city_project_decorator.rb | 1 - .../team_city_rest_project_decorator.rb | 1 - .../travis_pro_project_decorator.rb | 4 +-- app/decorators/travis_project_decorator.rb | 3 +- app/helpers/project_monitor_helper.rb | 10 +++--- app/helpers/projects_helper.rb | 15 ++++----- app/models/aggregate_project.rb | 6 ++-- app/models/circle_ci_project.rb | 4 +-- app/models/external_dependency.rb | 8 ++--- app/models/payload_log_entry.rb | 4 +-- app/models/project.rb | 12 +++---- app/models/project/state.rb | 18 +++++------ app/models/travis_pro_project.rb | 4 +-- app/models/travis_project.rb | 2 +- app/models/user.rb | 10 +++--- app/views/aggregate_projects/_form.html.haml | 14 ++++---- app/views/aggregate_projects/edit.html.haml | 6 ++-- app/views/aggregate_projects/new.html.haml | 2 +- app/views/configuration/edit.html.haml | 32 +++++++++---------- app/views/devise/sessions/new.html.haml | 14 ++++---- app/views/home/builds.rss.builder | 6 ++-- app/views/home/index.html.haml | 6 ++-- app/views/home/styleguide.html.haml | 4 +-- app/views/layouts/application.html.haml | 12 +++---- app/views/layouts/home.html.haml | 12 +++---- app/views/payload_log_entries/index.html.haml | 6 ++-- app/views/projects/_build_setup.html.haml | 20 ++++++------ app/views/projects/_form.html.haml | 20 ++++++------ app/views/projects/_project_type.html.haml | 6 ++-- app/views/projects/_tracker_setup.html.haml | 10 +++--- app/views/projects/edit.html.haml | 2 +- app/views/projects/new.html.haml | 2 +- app/views/users/new.html.haml | 18 +++++------ 44 files changed, 153 insertions(+), 163 deletions(-) diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index bc7f85972..8e9bc8800 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -1,12 +1,12 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController def google_oauth2 - @user = User.find_for_google_oauth2(request.env["omniauth.auth"], current_user) + @user = User.find_for_google_oauth2(request.env['omniauth.auth'], current_user) if @user.persisted? flash[:notice] = I18n.t "devise.omniauth_callbacks.success", kind: "Google" sign_in_and_redirect @user, event: :authentication else - session["devise.google_data"] = request.env["omniauth.auth"] + session['devise.google_data'] = request.env['omniauth.auth'] redirect_to edit_configuration_url end end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index c0c1348d2..47f23c5ee 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -5,7 +5,7 @@ class SessionsController < Devise::SessionsController def create super rescue BCrypt::Errors::InvalidHash - flash[:error] = "The system has been upgraded, your password needs to be reset before logging in." + flash[:error] = 'The system has been upgraded, your password needs to be reset before logging in.' redirect_to new_user_password_path end diff --git a/app/controllers/status_controller.rb b/app/controllers/status_controller.rb index 60d02e11f..61a764461 100644 --- a/app/controllers/status_controller.rb +++ b/app/controllers/status_controller.rb @@ -4,7 +4,7 @@ class StatusController < ApplicationController def create if project = Project.find_by_guid(params.delete(:project_id)) payload = project.webhook_payload - payload.remote_addr = request.env["REMOTE_ADDR"] + payload.remote_addr = request.env['REMOTE_ADDR'] params.merge!(parse_legacy_jenkins_notification) if is_legacy_jenkins_notification?(payload) @@ -17,7 +17,7 @@ def create end log = PayloadProcessor.new(project_status_updater: StatusUpdater.new).process_payload(project: project, payload: payload) - log.update_method = "Webhooks" + log.update_method = 'Webhooks' log.save! project.save! diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 4188fb5ca..c697ed268 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -9,7 +9,7 @@ def create @user = User.new(user_params) if @user.save redirect_to(root_path) - flash[:notice] = "User created." + flash[:notice] = 'User created.' else render :new end diff --git a/app/decorators/aggregate_project_decorator.rb b/app/decorators/aggregate_project_decorator.rb index e9e40c80e..82173ec8b 100644 --- a/app/decorators/aggregate_project_decorator.rb +++ b/app/decorators/aggregate_project_decorator.rb @@ -12,5 +12,4 @@ def status_in_words def css_class "project #{status_in_words} aggregate" end - end diff --git a/app/decorators/circle_ci_project_decorator.rb b/app/decorators/circle_ci_project_decorator.rb index ce13c7419..7dd7cac01 100644 --- a/app/decorators/circle_ci_project_decorator.rb +++ b/app/decorators/circle_ci_project_decorator.rb @@ -3,5 +3,4 @@ class CircleCiProjectDecorator < ProjectDecorator def current_build_url "https://circleci.com/api/v1/project/#{object.circleci_username}/#{object.ci_build_identifier}?circle-token=#{object.ci_auth_token}" end - end diff --git a/app/decorators/codeship_project_decorator.rb b/app/decorators/codeship_project_decorator.rb index c10f81e30..7f2aff03c 100644 --- a/app/decorators/codeship_project_decorator.rb +++ b/app/decorators/codeship_project_decorator.rb @@ -3,5 +3,4 @@ class CodeshipProjectDecorator < ProjectDecorator def current_build_url "https://www.codeship.io/projects/#{object.ci_build_identifier}" end - end diff --git a/app/decorators/concourse_project_decorator.rb b/app/decorators/concourse_project_decorator.rb index 2d0247c2f..52fb92cca 100644 --- a/app/decorators/concourse_project_decorator.rb +++ b/app/decorators/concourse_project_decorator.rb @@ -3,5 +3,4 @@ class ConcourseProjectDecorator < ProjectDecorator def current_build_url "#{object.ci_base_url}/jobs/#{object.ci_build_identifier}" end - end diff --git a/app/decorators/jenkins_project_decorator.rb b/app/decorators/jenkins_project_decorator.rb index ac15f595d..7f8926420 100644 --- a/app/decorators/jenkins_project_decorator.rb +++ b/app/decorators/jenkins_project_decorator.rb @@ -3,5 +3,4 @@ class JenkinsProjectDecorator < ProjectDecorator def current_build_url object.webhooks_enabled? ? object.parsed_url : object.ci_base_url end - end diff --git a/app/decorators/project_decorator.rb b/app/decorators/project_decorator.rb index fc89568fa..bbf4b880a 100644 --- a/app/decorators/project_decorator.rb +++ b/app/decorators/project_decorator.rb @@ -21,6 +21,6 @@ def current_build_url # To know more about this method, see: # http://api.rubyonrails.org/classes/ActiveModel/Conversion.html#method-i-to_partial_path def to_partial_path - "projects/project" + 'projects/project' end -end \ No newline at end of file +end diff --git a/app/decorators/tddium_project_decorator.rb b/app/decorators/tddium_project_decorator.rb index e96f9bffb..4d08cfab9 100644 --- a/app/decorators/tddium_project_decorator.rb +++ b/app/decorators/tddium_project_decorator.rb @@ -3,5 +3,4 @@ class TddiumProjectDecorator < ProjectDecorator def current_build_url "#{object.ci_base_url}/dashboard?auth_token=#{object.ci_auth_token}" end - end diff --git a/app/decorators/team_city_project_decorator.rb b/app/decorators/team_city_project_decorator.rb index 2f6ae1dc9..af72b1fa9 100644 --- a/app/decorators/team_city_project_decorator.rb +++ b/app/decorators/team_city_project_decorator.rb @@ -7,5 +7,4 @@ def current_build_url "#{object.ci_base_url}/viewType.html?buildTypeId=#{object.ci_build_identifier}" end end - end diff --git a/app/decorators/team_city_rest_project_decorator.rb b/app/decorators/team_city_rest_project_decorator.rb index 21cd292bf..1e662fc74 100644 --- a/app/decorators/team_city_rest_project_decorator.rb +++ b/app/decorators/team_city_rest_project_decorator.rb @@ -9,5 +9,4 @@ def current_build_url object.url_with_scheme(url) end - end diff --git a/app/decorators/travis_pro_project_decorator.rb b/app/decorators/travis_pro_project_decorator.rb index 1074e88dc..3a4884fe6 100644 --- a/app/decorators/travis_pro_project_decorator.rb +++ b/app/decorators/travis_pro_project_decorator.rb @@ -1,3 +1,3 @@ class TravisProProjectDecorator < TravisProjectDecorator - BASE_WEB_URL = "https://magnum.travis-ci.com" -end \ No newline at end of file + BASE_WEB_URL = 'https://magnum.travis-ci.com' +end diff --git a/app/decorators/travis_project_decorator.rb b/app/decorators/travis_project_decorator.rb index fd5662572..85fea1197 100644 --- a/app/decorators/travis_project_decorator.rb +++ b/app/decorators/travis_project_decorator.rb @@ -1,8 +1,7 @@ class TravisProjectDecorator < ProjectDecorator - BASE_WEB_URL = "https://travis-ci.org" + BASE_WEB_URL = 'https://travis-ci.org' def current_build_url "#{self.class.const_get(:BASE_WEB_URL)}/#{object.slug}" end - end diff --git a/app/helpers/project_monitor_helper.rb b/app/helpers/project_monitor_helper.rb index 252d837f3..8eb4a44b6 100644 --- a/app/helpers/project_monitor_helper.rb +++ b/app/helpers/project_monitor_helper.rb @@ -2,12 +2,12 @@ module ProjectMonitorHelper def static_status_messages_for(project) messages = [] if project.online? - messages << (project.status.published_at.present? ? "Last built #{project.status.published_at}": "Last build date unknown") + messages << (project.status.published_at.present? ? "Last built #{project.status.published_at}": 'Last build date unknown') if project.failure? - messages << (project.status.published_at.present? ? "Red since #{project.red_since} #{build_count_text_for(project)}" : "Red for some time") + messages << (project.status.published_at.present? ? "Red since #{project.red_since} #{build_count_text_for(project)}" : 'Red for some time') end else - messages << "Could not retrieve status" + messages << 'Could not retrieve status' end messages end @@ -15,8 +15,8 @@ def static_status_messages_for(project) private def build_count_text_for(project) - return "" unless project.failure? + return '' unless project.failure? count = project.red_build_count - "(#{count} #{count == 1 ? "build" : "builds"})" + "(#{count} #{count == 1 ? 'build' : 'builds'})" end end diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index ea9484dc3..13ab1c188 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -12,13 +12,13 @@ def project_types def project_webhooks_url(project) if project.guid.present? - "Your webhooks URL is " + project_status_url(project.guid).to_s + 'Your webhooks URL is ' + project_status_url(project.guid).to_s else unless project.new_record? project.generate_guid project.save! end - "" + '' end end @@ -35,12 +35,12 @@ def project_latest_error(project) def project_last_status_text(project) if latest = project.payload_log_entries.latest if project.enabled - latest.status || "Unknown Status" + latest.status || 'Unknown Status' else - "disabled" + 'disabled' end else - "none" + 'none' end.titleize end @@ -56,11 +56,11 @@ def project_last_status(project) end else content_tag(:span, class: "last_status #{latest.status}") do - content_tag(:p, "Disabled") + content_tag(:p, 'Disabled') end end else - "None" + 'None' end end @@ -90,5 +90,4 @@ def remove_header_for_markdown(markdown) header_regex = (/(#+.*\n+)/) markdown.sub(header_regex, '') end - end diff --git a/app/models/aggregate_project.rb b/app/models/aggregate_project.rb index d8abc22b0..947d7ee71 100644 --- a/app/models/aggregate_project.rb +++ b/app/models/aggregate_project.rb @@ -6,7 +6,7 @@ class AggregateProject < ActiveRecord::Base scope :enabled, -> { where(enabled: true) } scope :with_statuses, -> { joins(projects: :statuses).uniq } scope :displayable, lambda { |tags = nil| - scope = enabled.joins(:projects).select("DISTINCT aggregate_projects.*").order('code ASC') + scope = enabled.joins(:projects).select('DISTINCT aggregate_projects.*').order('code ASC') return scope.tagged_with(tags, any: true) if tags scope } @@ -39,7 +39,7 @@ def tracker_project? end def code - super.presence || name.downcase.gsub(" ", '')[0..3] + super.presence || name.downcase.gsub(' ', '')[0..3] end def status @@ -86,6 +86,6 @@ def breaking_build def red_build_count return 0 if breaking_build.nil? || !online? red_project = projects.detect(&:failure?) - red_project.statuses.where("id >= ?", red_project.breaking_build.id).count + red_project.statuses.where('id >= ?', red_project.breaking_build.id).count end end diff --git a/app/models/circle_ci_project.rb b/app/models/circle_ci_project.rb index 887252ab9..12f85dae5 100644 --- a/app/models/circle_ci_project.rb +++ b/app/models/circle_ci_project.rb @@ -9,7 +9,7 @@ def self.project_specific_attributes end def feed_url - "https://circleci.com/api/v1/project/#{circleci_username}/#{ci_build_identifier}/tree/#{build_branch.presence || "master"}?circle-token=#{ci_auth_token}" + "https://circleci.com/api/v1/project/#{circleci_username}/#{ci_build_identifier}/tree/#{build_branch.presence || 'master'}?circle-token=#{ci_auth_token}" end def fetch_payload @@ -17,7 +17,7 @@ def fetch_payload end def accept_mime_types - "application/json" + 'application/json' end def requires_branch_name? diff --git a/app/models/external_dependency.rb b/app/models/external_dependency.rb index 78c6799a1..716758270 100644 --- a/app/models/external_dependency.rb +++ b/app/models/external_dependency.rb @@ -28,10 +28,10 @@ def rubygems_status doc = Nokogiri::HTML(UrlRetriever.new('http://status.rubygems.org/').retrieve_content) page_status = doc.at_css("span[class^='status__subheading']") - if page_status["class"].include? "up" - output[:status] = "good" - elsif page_status["class"].include? "down" - output[:status] = "bad" + if page_status['class'].include? 'up' + output[:status] = 'good' + elsif page_status['class'].include? 'down' + output[:status] = 'bad' else output[:status] = 'page broken' end diff --git a/app/models/payload_log_entry.rb b/app/models/payload_log_entry.rb index 1070ec464..ff733319a 100644 --- a/app/models/payload_log_entry.rb +++ b/app/models/payload_log_entry.rb @@ -1,8 +1,8 @@ class PayloadLogEntry < ActiveRecord::Base belongs_to :project - default_scope { order("created_at DESC") } - scope :reverse_chronological, -> () { order("created_at DESC") } + default_scope { order('created_at DESC') } + scope :reverse_chronological, -> () { order('created_at DESC') } def self.latest reverse_chronological.limit(1).first diff --git a/app/models/project.rb b/app/models/project.rb index 2a20a5985..a668cdee4 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -11,7 +11,7 @@ class Project < ActiveRecord::Base has_many :payload_log_entries belongs_to :aggregate_project - belongs_to :creator, class_name: "User" + belongs_to :creator, class_name: 'User' serialize :last_ten_velocities, Array serialize :iteration_story_state_counts, JSON @@ -89,15 +89,15 @@ def red_since def red_build_count return 0 if breaking_build.nil? || !online? - statuses.red.where("id >= ?", breaking_build.id).count + statuses.red.where('id >= ?', breaking_build.id).count end def feed_url - raise NotImplementedError, "Must implement feed_url in subclasses" + raise NotImplementedError, 'Must implement feed_url in subclasses' end def build_status_url - raise NotImplementedError, "Must implement build_status_url in subclasses" + raise NotImplementedError, 'Must implement build_status_url in subclasses' end def tracker_project_url @@ -124,7 +124,7 @@ def breaking_build @breaking_build ||= if last_green.nil? recent_statuses.red.last else - recent_statuses.red.where("build_id > ?", last_green.build_id).first + recent_statuses.red.where('build_id > ?', last_green.build_id).first end end @@ -138,7 +138,7 @@ def tracker_project? alias tracker_configured? tracker_project? def payload - raise NotImplementedError, "Must implement payload in subclasses" + raise NotImplementedError, 'Must implement payload in subclasses' end def has_status?(status) diff --git a/app/models/project/state.rb b/app/models/project/state.rb index f9d725773..1a2ad6765 100644 --- a/app/models/project/state.rb +++ b/app/models/project/state.rb @@ -1,13 +1,13 @@ class Project::State def initialize(online: false, success: nil) state_text = if !online - "offline" + 'offline' elsif success == false - "failure" + 'failure' elsif success - "success" + 'success' else - "indeterminate" + 'indeterminate' end @state = ActiveSupport::StringInquirer.new(state_text) end @@ -36,10 +36,10 @@ def online? def color { - "offline" => "white", - "success" => "green", - "failure" => "red", - "indeterminate" => "yellow" + 'offline' => 'white', + 'success' => 'green', + 'failure' => 'red', + 'indeterminate' => 'yellow' }[state.to_s] end @@ -55,4 +55,4 @@ def hash attr_reader :state -end \ No newline at end of file +end diff --git a/app/models/travis_pro_project.rb b/app/models/travis_pro_project.rb index c80f72d68..7c3c4674e 100644 --- a/app/models/travis_pro_project.rb +++ b/app/models/travis_pro_project.rb @@ -1,5 +1,5 @@ class TravisProProject < TravisProject - BASE_API_URL = "https://api.travis-ci.com" + BASE_API_URL = 'https://api.travis-ci.com' validates_presence_of :ci_auth_token, unless: ->(project) { project.webhooks_enabled } @@ -20,4 +20,4 @@ def fetch_payload end alias_method :webhook_payload, :fetch_payload -end \ No newline at end of file +end diff --git a/app/models/travis_project.rb b/app/models/travis_project.rb index 4cd81c501..403425f13 100644 --- a/app/models/travis_project.rb +++ b/app/models/travis_project.rb @@ -2,7 +2,7 @@ class TravisProject < Project validates_presence_of :travis_github_account, :travis_repository, unless: ->(project) { project.webhooks_enabled } - BASE_API_URL = "https://api.travis-ci.org" + BASE_API_URL = 'https://api.travis-ci.org' alias_attribute :build_status_url, :feed_url alias_attribute :project_name, :travis_github_account diff --git a/app/models/user.rb b/app/models/user.rb index 7e5d70642..41f7d1af0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -14,7 +14,7 @@ class User < ActiveRecord::Base def self.find_first_by_auth_conditions(warden_conditions) conditions = warden_conditions.dup if login = conditions.delete(:login) - where(conditions).where(["lower(login) = :value OR lower(email) = :value", { value: login.downcase }]).first + where(conditions).where(['lower(login) = :value OR lower(email) = :value', { value: login.downcase }]).first else where(conditions).first end @@ -22,10 +22,10 @@ def self.find_first_by_auth_conditions(warden_conditions) def self.find_for_google_oauth2(access_token, signed_in_resource=nil) data = access_token.info - user = User.where(email: data["email"]).first - user || User.create!(name: data["name"], - email: data["email"], - login: data["email"].split('@').first, + user = User.where(email: data['email']).first + user || User.create!(name: data['name'], + email: data['email'], + login: data['email'].split('@').first, password: Devise.friendly_token[0,20]) end diff --git a/app/views/aggregate_projects/_form.html.haml b/app/views/aggregate_projects/_form.html.haml index c1c536f9e..12a00a6c1 100644 --- a/app/views/aggregate_projects/_form.html.haml +++ b/app/views/aggregate_projects/_form.html.haml @@ -1,11 +1,11 @@ .form-group - = f.label :code, class: "col-sm-2 control-label" + = f.label :code, class: 'col-sm-2 control-label' .col-sm-1 - = f.text_field :code, maxlength: 4, class: "form-control" + = f.text_field :code, maxlength: 4, class: 'form-control' .form-group - = f.label :name, class: "col-sm-2 control-label" + = f.label :name, class: 'col-sm-2 control-label' .col-sm-4 - = f.text_field :name, class: "form-control" + = f.text_field :name, class: 'form-control' .form-group .col-sm-offset-2.col-sm-4 .checkbox @@ -13,10 +13,10 @@ = f.check_box :enabled Enabled? .form-group - = f.label :tag_list, "Tags", class: "col-sm-2 control-label" + = f.label :tag_list, 'Tags', class: 'col-sm-2 control-label' .col-sm-4 - = f.text_field :tag_list, size: 40, class: "form-control" + = f.text_field :tag_list, size: 40, class: 'form-control' %p.help-block (separate with commas) .row .col-sm-offset-2.col-sm-1 - = submit_tag @aggregate_project.new_record? ? "Create" : "Update", class: 'btn btn-primary' + = submit_tag @aggregate_project.new_record? ? 'Create' : 'Update', class: 'btn btn-primary' diff --git a/app/views/aggregate_projects/edit.html.haml b/app/views/aggregate_projects/edit.html.haml index 493933f42..34798552e 100644 --- a/app/views/aggregate_projects/edit.html.haml +++ b/app/views/aggregate_projects/edit.html.haml @@ -1,7 +1,7 @@ = link_to '← Back to Projects'.html_safe, edit_configuration_path %h1 Edit Aggregate Project = error_messages_for @aggregate_project -= form_for(@aggregate_project, html: { class: "form-horizontal" }) do |f| += form_for(@aggregate_project, html: { class: 'form-horizontal' }) do |f| = render 'form', f: f -%div{style: "margin-left: 30px;"} - = link_to 'Remove Aggregate Project -', aggregate_project_path, data: { confirm: 'Are you sure?' }, method: :delete, class: "button" +%div{style: 'margin-left: 30px;'} + = link_to 'Remove Aggregate Project -', aggregate_project_path, data: { confirm: 'Are you sure?' }, method: :delete, class: 'button' diff --git a/app/views/aggregate_projects/new.html.haml b/app/views/aggregate_projects/new.html.haml index 8257a71de..f65717807 100644 --- a/app/views/aggregate_projects/new.html.haml +++ b/app/views/aggregate_projects/new.html.haml @@ -2,5 +2,5 @@ %h1 Add Aggregate Project %hr = error_messages_for @aggregate_project -= form_for(@aggregate_project, html: { class: "form-horizontal" }) do |f| += form_for(@aggregate_project, html: { class: 'form-horizontal' }) do |f| = render 'form', f: f diff --git a/app/views/configuration/edit.html.haml b/app/views/configuration/edit.html.haml index 30a3a5c0c..0bdbbc22c 100644 --- a/app/views/configuration/edit.html.haml +++ b/app/views/configuration/edit.html.haml @@ -2,12 +2,12 @@ .panel-heading .h3 Configuration .panel-body - = label_tag :tag, "Filter by Tag:" + = label_tag :tag, 'Filter by Tag:' = select_tag(:tag, options_for_select(@tags.unshift(''))) = hidden_field_tag(:current_tag, params[:tags]) - = label_tag :polling_status, "Filter by Polling Status:" - = select_tag(:polling_status, options_for_select(["", "Successful", "Failed", "None", "Disabled"])) + = label_tag :polling_status, 'Filter by Polling Status:' + = select_tag(:polling_status, options_for_select(['', 'Successful', 'Failed', 'None', 'Disabled'])) %hr %h4 @@ -29,13 +29,13 @@ %th Actions %tbody - @projects.each do |project| - %tr{id: "project-#{project.id}", data: { tags: project.tag_list.to_json, "polling-status" => project_last_status_text(project)}} + %tr{id: "project-#{project.id}", data: { tags: project.tag_list.to_json, 'polling-status' => project_last_status_text(project)}} %td= h project.code %td= h project.name %td = content_tag 'span', title: "#{project.feed_url}#{project.has_auth? ? ' (under auth)' : ''}" do = t("project_types.#{project.class.name.underscore}") - = image_tag("icons/lock.png") if project.has_auth? + = image_tag('icons/lock.png') if project.has_auth? %td.text-center - if project.enabled? ✓ @@ -43,20 +43,20 @@ %span{style: "color: #AA1224;"} ✕ %td = project_last_status(project) - %td.text-center= project.aggregate_project.present? ? project.aggregate_project.name : "" + %td.text-center= project.aggregate_project.present? ? project.aggregate_project.name : '' %td.tag_list - project.tag_list.each do |tag| = link_to tag, root_path({tags: tag}) - %td.age= project.updated_at.present? ? time_ago_in_words(project.updated_at) : "N/A" - %td.webhooks.text-center= project.webhooks_enabled ? "✓" : "✕" + %td.age= project.updated_at.present? ? time_ago_in_words(project.updated_at) : 'N/A' + %td.webhooks.text-center= project.webhooks_enabled ? '✓' : '✕' %td.actions - = link_to 'Edit', edit_project_path(project), class: "btn btn-xs btn-default" - = link_to 'Delete', project_path(project), method: :delete, data: { confirm: 'Are you sure?' }, class: "btn btn-xs btn-default" + = link_to 'Edit', edit_project_path(project), class: 'btn btn-xs btn-default' + = link_to 'Delete', project_path(project), method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-xs btn-default' %hr %h4 Aggregate Projects - = link_to 'Add Aggregate Project +', new_aggregate_project_path, class: "btn btn-primary btn-xs" + = link_to 'Add Aggregate Project +', new_aggregate_project_path, class: 'btn btn-primary btn-xs' - unless @aggregate_projects.empty? %table.projects.table.table-striped.table-hover %thead @@ -69,16 +69,16 @@ %th Actions %tbody - for aggregate_project in @aggregate_projects - %tr{id: "aggregate-project-#{aggregate_project.id}", data: { tags: aggregate_project.tag_list.to_json, "polling-status" => "" }} + %tr{id: "aggregate-project-#{aggregate_project.id}", data: { tags: aggregate_project.tag_list.to_json, 'polling-status' => '' }} %td= h aggregate_project.name %td.text-center - if aggregate_project.enabled? ✓ - else - %span{style: "color: #AA1224;"} ✕ + %span{style: 'color: #AA1224;'} ✕ %td.tag_list= aggregate_project.tag_list %td.count= aggregate_project.projects.count - %td.age= aggregate_project.updated_at.present? ? time_ago_in_words(aggregate_project.updated_at) : "N/A" + %td.age= aggregate_project.updated_at.present? ? time_ago_in_words(aggregate_project.updated_at) : 'N/A' %td.actions - = link_to 'Edit', edit_aggregate_project_path(aggregate_project), class: "btn btn-xs btn-default" - = link_to 'Delete', aggregate_project_path(aggregate_project), method: :delete, class:"btn btn-xs btn-default" + = link_to 'Edit', edit_aggregate_project_path(aggregate_project), class: 'btn btn-xs btn-default' + = link_to 'Delete', aggregate_project_path(aggregate_project), method: :delete, class:'btn btn-xs btn-default' diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 5de509ffe..68a95d1c4 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -1,14 +1,14 @@ %h1 Sign in %hr -= form_for(resource, as: resource_name, url: session_path(resource_name), html: { class: "form-horizontal" }) do |f| += form_for(resource, as: resource_name, url: session_path(resource_name), html: { class: 'form-horizontal' }) do |f| .form-group - = f.label :login, 'Login or Email', class: "col-sm-2 control-label" + = f.label :login, 'Login or Email', class: 'col-sm-2 control-label' .col-sm-2 - = f.text_field :login, class: "form-control" + = f.text_field :login, class: 'form-control' .form-group - = f.label :password, class: "col-sm-2 control-label" + = f.label :password, class: 'col-sm-2 control-label' .col-sm-2 - = f.password_field :password, class: "form-control" + = f.password_field :password, class: 'form-control' - if devise_mapping.rememberable? .form-group .col-sm-offset-2.col-sm-2 @@ -18,9 +18,9 @@ Remember Me .row .col-sm-offset-2.col-sm-2 - = f.submit "Sign in", class: "btn btn-primary" + = f.submit 'Sign in', class: 'btn btn-primary' %hr .row .col-sm-offset-2.col-sm-4 - = render "devise/shared/links" + = render 'devise/shared/links' diff --git a/app/views/home/builds.rss.builder b/app/views/home/builds.rss.builder index 05a50217c..2a96b8cea 100644 --- a/app/views/home/builds.rss.builder +++ b/app/views/home/builds.rss.builder @@ -1,16 +1,16 @@ xml.instruct! xml.rss version: '2.0' do xml.channel do - xml.title "Project Monitor" + xml.title 'Project Monitor' xml.link root_url - xml.description "Most recent builds and their status" + xml.description 'Most recent builds and their status' @projects.each do |project| xml.item do xml.title "#{project.name} #{project.status.in_words}" xml.link project.status.url xml.guid project.code - xml.description static_status_messages_for(project).join(". ") + "." + xml.description static_status_messages_for(project).join('. ') + '.' xml.pubDate project.status.published_at end end diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index 2f0004d87..3a6ef2b9b 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -1,10 +1,10 @@ .warnings .github - = link_to "GITHUB IS DOWN", 'http://status.github.com' + = link_to 'GITHUB IS DOWN', 'http://status.github.com' .heroku - = link_to "HEROKU IS DOWN", 'http://status.heroku.com' + = link_to 'HEROKU IS DOWN', 'http://status.heroku.com' .rubygems - = link_to "RUBYGEMS IS DOWN", 'http://status.rubygems.org' + = link_to 'RUBYGEMS IS DOWN', 'http://status.rubygems.org' .tiles :javascript var projects = #{@projects.to_json}; diff --git a/app/views/home/styleguide.html.haml b/app/views/home/styleguide.html.haml index 4f621e9ff..cab3ca9bf 100644 --- a/app/views/home/styleguide.html.haml +++ b/app/views/home/styleguide.html.haml @@ -1,8 +1,8 @@ .warnings .github - = link_to "GITHUB IS DOWN", 'http://status.github.com' + = link_to 'GITHUB IS DOWN', 'http://status.github.com' .heroku - = link_to "HEROKU IS DOWN", 'http://status.heroku.com' + = link_to 'HEROKU IS DOWN', 'http://status.heroku.com' %section %ol.projects :coffeescript diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index cf3b63438..1c1af8ed5 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -2,9 +2,9 @@ %html %head %title Project Monitor - = stylesheet_link_tag "manage" - = javascript_include_tag "application" - = javascript_include_tag "bootstrap" + = stylesheet_link_tag 'manage' + = javascript_include_tag 'application' + = javascript_include_tag 'bootstrap' = csrf_meta_tag = yield :head %body @@ -25,13 +25,13 @@ %b.caret %ul.dropdown-menu %li - = link_to "Projects", edit_configuration_path + = link_to 'Projects', edit_configuration_path - if ConfigHelper.get(:password_auth_enabled) %li - = link_to "Add User", new_user_path + = link_to 'Add User', new_user_path %li.divider %li - = link_to "Log Out", destroy_user_session_path, method: :delete + = link_to 'Log Out', destroy_user_session_path, method: :delete .container %div{class: "page #{params[:controller]} #{params[:action]}"} - if flash[:error] diff --git a/app/views/layouts/home.html.haml b/app/views/layouts/home.html.haml index 822f4228a..da1dcfa5a 100644 --- a/app/views/layouts/home.html.haml +++ b/app/views/layouts/home.html.haml @@ -2,17 +2,17 @@ %html %head %title Project Monitor - = stylesheet_link_tag "application" - = javascript_include_tag "application" + = stylesheet_link_tag 'application' + = javascript_include_tag 'application' = csrf_meta_tag - %script{src: "//fast.fonts.com/jsapi/14aea2b8-37b7-4a31-afb9-e44414bef419.js", type: "text/javascript"} - %body{class: "dashboard tiles_#{@tiles_count}", "data-tiles-count" => @tiles_count} + %script{src: '//fast.fonts.com/jsapi/14aea2b8-37b7-4a31-afb9-e44414bef419.js', type: 'text/javascript'} + %body{class: "dashboard tiles_#{@tiles_count}", 'data-tiles-count' => @tiles_count} = yield #footer .left .right - if current_user - = link_to "log out", destroy_user_session_path, class: "projects_path", method: :delete + = link_to 'log out', destroy_user_session_path, class: 'projects_path', method: :delete | - = link_to "manage projects", edit_configuration_path, class: "projects_path" + = link_to 'manage projects', edit_configuration_path, class: 'projects_path' .clearfix diff --git a/app/views/payload_log_entries/index.html.haml b/app/views/payload_log_entries/index.html.haml index 8ed0ae92c..c8b23d13f 100644 --- a/app/views/payload_log_entries/index.html.haml +++ b/app/views/payload_log_entries/index.html.haml @@ -6,7 +6,7 @@ %th Message %th Backtrace - @payload_log_entries.each_with_index do |entry, index| - %tr{class: cycle("odd", "even")} + %tr{class: cycle('odd', 'even')} %td= entry.created_at %td= entry.status %td= entry.update_method @@ -15,8 +15,8 @@ = (entry.error_type.to_s + ': ' + entry.error_text).truncate(50) %td{id: "td#{index}"} - if entry.backtrace.present? - = link_to "show backtrace", '#', class: "showTrace" + = link_to 'show backtrace', '#', class: 'showTrace' .backtrace.hide{id: "bt#{index}"} %pre = entry.backtrace - = link_to "hide backtrace", '#', class: "hideTrace" + = link_to 'hide backtrace', '#', class: 'hideTrace' diff --git a/app/views/projects/_build_setup.html.haml b/app/views/projects/_build_setup.html.haml index e2111a39c..2be047ce7 100644 --- a/app/views/projects/_build_setup.html.haml +++ b/app/views/projects/_build_setup.html.haml @@ -2,7 +2,7 @@ %fieldset#build_setup %h3 Build Setup .form-group - = f.label :webhooks_enabled, "Payload Strategy", class: "col-sm-2 control-label" + = f.label :webhooks_enabled, 'Payload Strategy', class: 'col-sm-2 control-label' .col-sm-10 .radio.row = f.label :webhooks_enabled_true do @@ -16,9 +16,9 @@ = f.radio_button :webhooks_enabled, false Polling .form-group#branch_name{ class: f.object.requires_branch_name? ? nil : 'hide' } - = f.label :build_branch, "Branch Name", class: "col-sm-2 control-label" + = f.label :build_branch, 'Branch Name', class: 'col-sm-2 control-label' .col-sm-4 - = f.text_field :build_branch, class: "form-control" + = f.text_field :build_branch, class: 'form-control' %p.help-block Default is 'master'. Codeship projects can utilize regex matching. #field_container - ProjectsHelper::PROJECT_TYPE_NAMES.each do |project_type| @@ -26,9 +26,9 @@ .project-attributes{ id: project_type, class: "#{'hide' unless enabled}" } - project_specific_attributes_for(project_type).each do |field, field_attributes| .form-group - = f.label field, field_attributes.label, class: "col-sm-2 control-label" + = f.label field, field_attributes.label, class: 'col-sm-2 control-label' .col-sm-4 - = f.text_field field, disabled: !enabled, class: "form-control" + = f.text_field field, disabled: !enabled, class: 'form-control' - if field_attributes.tooltip %p.help-block= field_attributes.tooltip %fieldset#polling @@ -39,22 +39,22 @@ = f.check_box :verify_ssl Verify SSL Certificate? .form-group.auth_field - = f.label :auth_username, "Feed Username", class: "col-sm-2 control-label" + = f.label :auth_username, 'Feed Username', class: 'col-sm-2 control-label' .col-sm-4 = f.text_field :auth_username, size: 40, class: 'optional form-control', autocomplete: 'off' %p.help-block Basic or digest authentication .form-group.auth_field - = f.label :auth_password, "Feed Password", class: "col-sm-2 control-label" + = f.label :auth_password, 'Feed Password', class: 'col-sm-2 control-label' .col-sm-4 %input{ id: 'password_changed', name: 'password_changed', type: 'hidden', value: 'false' } - = f.password_field :auth_password, class: "form-control" + = f.password_field :auth_password, class: 'form-control' %p.help-block - if f.object.auth_password.present? %span#change_password.label.label-success Saved - else %span#change_password.label.label-default Not Set .form-group - = f.label :online, "CI status", class: "col-sm-2 control-label" + = f.label :online, 'CI status', class: 'col-sm-2 control-label' = f.hidden_field :online .col-sm-4 %p.help-block#build_status @@ -65,7 +65,7 @@ %span.label.label-warning.empty_fields.hide Some Fields Empty   %input{ class: 'refresh btn btn-default btn-xs', type: 'button', value: 'Refresh' } - %span{:class => "error-message hide"} + %span{:class => 'error-message hide'} .row .col-sm-offset-2.col-sm-10 %p.text-muted= project_refreshed_at(f.object) diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml index 78dc3ae7d..b14814aea 100644 --- a/app/views/projects/_form.html.haml +++ b/app/views/projects/_form.html.haml @@ -1,14 +1,14 @@ .form-group - = f.label :code, class: "col-sm-2 control-label" + = f.label :code, class: 'col-sm-2 control-label' .col-sm-1 - = f.text_field :code, maxlength: 4, class: "form-control" + = f.text_field :code, maxlength: 4, class: 'form-control' .form-group - = f.label :name, class: "col-sm-2 control-label" + = f.label :name, class: 'col-sm-2 control-label' .col-sm-4 - = f.text_field :name, class: "form-control" + = f.text_field :name, class: 'form-control' - if f.object.creator.present? .form-group - = f.label :creator, class: "col-sm-2 control-label" + = f.label :creator, class: 'col-sm-2 control-label' .col-sm-4 %p.help-block = "#{f.object.creator.name} (#{f.object.creator.email})" @@ -19,15 +19,15 @@ = f.check_box :enabled Enabled? .form-group - = f.label :aggregate_project_id, "Aggregate Project", class: "col-sm-2 control-label" + = f.label :aggregate_project_id, 'Aggregate Project', class: 'col-sm-2 control-label' .col-sm-3 - = collection_select(:project, :aggregate_project_id, AggregateProject.all, :id, :name, {prompt: false, disabled: lambda { |ap| !ap.enabled? }, include_blank: true}, class: "form-control") + = collection_select(:project, :aggregate_project_id, AggregateProject.all, :id, :name, {prompt: false, disabled: lambda { |ap| !ap.enabled? }, include_blank: true}, class: 'form-control') .form-group :javascript autocomplete("#project_tag_list", #{ ActsAsTaggableOn::Tag.all.map(&:name) }); - = f.label :tag_list, "Tags", class: "col-sm-2 control-label" + = f.label :tag_list, 'Tags', class: 'col-sm-2 control-label' .col-sm-4 - = f.text_field :tag_list, class: "form-control col-sm-4" + = f.text_field :tag_list, class: 'form-control col-sm-4' %p.help-block Separate with commas = render 'project_type', f: f @@ -38,7 +38,7 @@ %hr .row .col-sm-offset-2.col-sm-1 - = submit_tag @project.new_record? ? "Create" : "Update", class: 'btn btn-primary' + = submit_tag @project.new_record? ? 'Create' : 'Update', class: 'btn btn-primary' .pull-right - if !@project.new_record? = link_to 'Remove Project', project_path(@project), data: { confirm: 'Are you sure?' }, method: :delete, class: 'btn btn-danger' diff --git a/app/views/projects/_project_type.html.haml b/app/views/projects/_project_type.html.haml index c1ab17213..a57e97816 100644 --- a/app/views/projects/_project_type.html.haml +++ b/app/views/projects/_project_type.html.haml @@ -2,11 +2,11 @@ %fieldset#project_type_section %h3 Project Type .form-group - = f.label :type, "Provider", class: "col-sm-2 control-label" + = f.label :type, 'Provider', class: 'col-sm-2 control-label' .col-sm-3 - = f.select :type, project_types, {}, class: "form-control" + = f.select :type, project_types, {}, class: 'form-control' - ProjectsHelper::PROJECT_TYPE_NAMES.each do |project_type| - enabled = f.object.type == project_type.name .provider-specific{ class: "#{'hide' unless enabled} #{project_type}" } .col-md-2 - .col-md-10.build_setup_instructions= build_setup_instructions_for(project_type).html_safe \ No newline at end of file + .col-md-10.build_setup_instructions= build_setup_instructions_for(project_type).html_safe diff --git a/app/views/projects/_tracker_setup.html.haml b/app/views/projects/_tracker_setup.html.haml index ccdcb9701..80024a2a1 100644 --- a/app/views/projects/_tracker_setup.html.haml +++ b/app/views/projects/_tracker_setup.html.haml @@ -2,23 +2,23 @@ %fieldset#tracker_setup %h3 Tracker Setup .form-group - = f.label :tracker_project_id, "Tracker project id", class: "col-sm-2 control-label" + = f.label :tracker_project_id, 'Tracker project id', class: 'col-sm-2 control-label' .col-sm-4 - = f.text_field :tracker_project_id, class: "form-control" + = f.text_field :tracker_project_id, class: 'form-control' %p.help-block %span#project_tracker_project_id_status %span.label.label-success.success.hide ✔ %span.label.label-danger.failure.hide ✘ .form-group - = f.label :tracker_auth_token, "Tracker auth token", class: "col-sm-2 control-label" + = f.label :tracker_auth_token, 'Tracker auth token', class: 'col-sm-2 control-label' .col-sm-4 - = f.text_field :tracker_auth_token, class: "form-control" + = f.text_field :tracker_auth_token, class: 'form-control' %p.help-block %span#project_tracker_auth_token_status %span.label.label-success.success.hide ✔ %span.label.label-danger.failure.hide ✘ .form-group - = f.label :tracker_online, "Tracker status", class: "col-sm-2 control-label" + = f.label :tracker_online, 'Tracker status', class: 'col-sm-2 control-label' = f.hidden_field :tracker_online .col-sm-2#tracker_status %p.help-block diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index f2d946d10..5917b8f12 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -5,5 +5,5 @@ %h1 Edit Project %hr = error_messages_for @project -= form_for(@project, as: :project, url: project_path(@project), html: { class: "form-horizontal" }) do |f| += form_for(@project, as: :project, url: project_path(@project), html: { class: 'form-horizontal' }) do |f| = render 'form', f: f diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index ce62a9cfe..5531518a2 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -5,5 +5,5 @@ %h1 Add Project %hr = error_messages_for @project -= form_for(@project, as: :project, url: projects_path, html: { class: "form-horizontal" }) do |f| += form_for(@project, as: :project, url: projects_path, html: { class: 'form-horizontal' }) do |f| = render 'form', f: f diff --git a/app/views/users/new.html.haml b/app/views/users/new.html.haml index 3367abb4c..8900da110 100644 --- a/app/views/users/new.html.haml +++ b/app/views/users/new.html.haml @@ -2,23 +2,23 @@ %h1 Add User %hr = error_messages_for @user -= form_for(@user, html: { class: "form-horizontal" }) do |f| += form_for(@user, html: { class: 'form-horizontal' }) do |f| .form-group - = f.label :login, class: "col-sm-2 control-label" + = f.label :login, class: 'col-sm-2 control-label' .col-sm-2 - = f.text_field :login, class: "form-control" + = f.text_field :login, class: 'form-control' .form-group - = f.label :email, class: "col-sm-2 control-label" + = f.label :email, class: 'col-sm-2 control-label' .col-sm-2 - = f.text_field :email, class: "form-control" + = f.text_field :email, class: 'form-control' .form-group - = f.label :password, class: "col-sm-2 control-label" + = f.label :password, class: 'col-sm-2 control-label' .col-sm-2 - = f.password_field :password, class: "form-control" + = f.password_field :password, class: 'form-control' .form-group - = f.label :password_confirmation, "Confirm Password", class: "col-sm-2 control-label" + = f.label :password_confirmation, 'Confirm Password', class: 'col-sm-2 control-label' .col-sm-2 - = f.password_field :password_confirmation, class: "form-control" + = f.password_field :password_confirmation, class: 'form-control' .row .col-sm-offset-2.col-sm-2 = submit_tag 'Create', class: 'btn btn-primary'