Commit 739bb175212446ebd732f98e8e100a4125442baa
1 parent
0c59c718
Exists in
master
and in
1 other branch
Rubocop: auto-fixing linter warnings
Run with "bundle exec rubocop --lint --auto-correct"
Showing
16 changed files
with
24 additions
and
24 deletions
Show diff stats
app/helpers/application_helper.rb
... | ... | @@ -7,7 +7,7 @@ module ApplicationHelper |
7 | 7 | RiCal.Calendar do |cal| |
8 | 8 | notices.each_with_index do |notice,idx| |
9 | 9 | cal.event do |event| |
10 | - event.summary = "#{idx+1} #{notice.message.to_s}" | |
10 | + event.summary = "#{idx+1} #{notice.message}" | |
11 | 11 | event.description = notice.url if notice.url |
12 | 12 | event.dtstart = notice.created_at.utc |
13 | 13 | event.dtend = notice.created_at.utc + 60.minutes |
... | ... | @@ -23,7 +23,7 @@ module ApplicationHelper |
23 | 23 | RiCal.Calendar { |cal| |
24 | 24 | deploys.each_with_index do |deploy,idx| |
25 | 25 | cal.event do |event| |
26 | - event.summary = "#{idx+1} #{deploy.repository.to_s}" | |
26 | + event.summary = "#{idx+1} #{deploy.repository}" | |
27 | 27 | event.description = deploy.revision.to_s |
28 | 28 | event.dtstart = deploy.created_at.utc |
29 | 29 | event.dtend = deploy.created_at.utc + 60.minutes | ... | ... |
app/helpers/problems_helper.rb
... | ... | @@ -23,7 +23,7 @@ module ProblemsHelper |
23 | 23 | :d => Errbit::Config.gravatar_default, |
24 | 24 | } |
25 | 25 | options.reverse_merge! default_options |
26 | - params = options.extract!(:s, :d).delete_if { |k, v| v.blank? } | |
26 | + params = options.extract!(:s, :d).delete_if { |_k, v| v.blank? } | |
27 | 27 | email_hash = Digest::MD5.hexdigest(email) |
28 | 28 | url = request.ssl? ? "https://secure.gravatar.com" : "http://www.gravatar.com" |
29 | 29 | "#{url}/avatar/#{email_hash}?#{params.to_query}" | ... | ... |
app/models/notification_services/campfire_service.rb
... | ... | @@ -30,7 +30,7 @@ if defined? Campy |
30 | 30 | # build the campfire client |
31 | 31 | campy = Campy::Room.new(:account => subdomain, :token => api_token, :room_id => room_id) |
32 | 32 | # post the issue to the campfire room |
33 | - campy.speak "[errbit] #{problem.app.name} #{notification_description problem} - #{Errbit::Config.protocol}://#{Errbit::Config.host}/apps/#{problem.app.id.to_s}/problems/#{problem.id.to_s}" | |
33 | + campy.speak "[errbit] #{problem.app.name} #{notification_description problem} - #{Errbit::Config.protocol}://#{Errbit::Config.host}/apps/#{problem.app.id}/problems/#{problem.id}" | |
34 | 34 | end |
35 | 35 | end |
36 | 36 | end | ... | ... |
app/models/notification_services/flowdock_service.rb
... | ... | @@ -35,7 +35,7 @@ if defined? Flowdock |
35 | 35 | end |
36 | 36 | |
37 | 37 | def content(problem, url) |
38 | - full_description = "[#{ problem.environment }][#{ problem.where }] #{problem.message.to_s}" | |
38 | + full_description = "[#{ problem.environment }][#{ problem.where }] #{problem.message}" | |
39 | 39 | <<-MSG.strip_heredoc |
40 | 40 | #{ERB::Util.html_escape full_description}<br> |
41 | 41 | <a href="#{url}">#{url}</a> | ... | ... |
app/models/notification_services/gtalk_service.rb
... | ... | @@ -46,8 +46,8 @@ class NotificationServices::GtalkService < NotificationService |
46 | 46 | client.auth(api_token) |
47 | 47 | |
48 | 48 | #has to look like this to be formatted properly in the client |
49 | - message = """#{problem.app.name.to_s} | |
50 | -#{Errbit::Config.protocol}://#{Errbit::Config.host}/apps/#{problem.app.id.to_s} | |
49 | + message = """#{problem.app.name} | |
50 | +#{Errbit::Config.protocol}://#{Errbit::Config.host}/apps/#{problem.app.id} | |
51 | 51 | #{notification_description problem}""" |
52 | 52 | |
53 | 53 | # post the issue to the xmpp room(s) | ... | ... |
app/models/notification_services/hoiio_service.rb
... | ... | @@ -35,7 +35,7 @@ class NotificationServices::HoiioService < NotificationService |
35 | 35 | |
36 | 36 | # send sms |
37 | 37 | room_id.split(',').each do |number| |
38 | - sms.send :dest => number, :msg => "#{Errbit::Config.protocol}://#{Errbit::Config.host}/apps/#{problem.app.id.to_s} #{notification_description problem}" | |
38 | + sms.send :dest => number, :msg => "#{Errbit::Config.protocol}://#{Errbit::Config.host}/apps/#{problem.app.id} #{notification_description problem}" | |
39 | 39 | end |
40 | 40 | |
41 | 41 | end | ... | ... |
app/models/notification_services/pushover_service.rb
... | ... | @@ -26,7 +26,7 @@ class NotificationServices::PushoverService < NotificationService |
26 | 26 | notification = Rushover::Client.new(subdomain) |
27 | 27 | |
28 | 28 | # send push notification to pushover |
29 | - notification.notify(api_token, "#{notification_description problem}", :priority => 1, :title => "Errbit Notification", :url => "#{Errbit::Config.protocol}://#{Errbit::Config.host}/apps/#{problem.app.id.to_s}", :url_title => "Link to error") | |
29 | + notification.notify(api_token, "#{notification_description problem}", :priority => 1, :title => "Errbit Notification", :url => "#{Errbit::Config.protocol}://#{Errbit::Config.host}/apps/#{problem.app.id}", :url_title => "Link to error") | |
30 | 30 | |
31 | 31 | end |
32 | 32 | end | ... | ... |
config/initializers/action_mailer.rb
config/initializers/overrides.rb
config/unicorn.default.rb
... | ... | @@ -8,7 +8,7 @@ pid ENV['UNICORN_PID'] if ENV['UNICORN_PID'] |
8 | 8 | |
9 | 9 | # Taken from github: https://github.com/blog/517-unicorn |
10 | 10 | # Though everyone uses pretty miuch the same code |
11 | -before_fork do |server, worker| | |
11 | +before_fork do |server, _worker| | |
12 | 12 | ## |
13 | 13 | # When sent a USR2, Unicorn will suffix its pidfile with .oldbin and |
14 | 14 | # immediately start loading up a new version of itself (loaded with a new |
... | ... | @@ -21,7 +21,7 @@ before_fork do |server, worker| |
21 | 21 | # Using this method we get 0 downtime deploys. |
22 | 22 | |
23 | 23 | old_pid = "#{server.config[:pid]}.oldbin" |
24 | - if File.exists?(old_pid) && server.pid != old_pid | |
24 | + if File.exist?(old_pid) && server.pid != old_pid | |
25 | 25 | begin |
26 | 26 | Process.kill("QUIT", File.read(old_pid).to_i) |
27 | 27 | rescue Errno::ENOENT, Errno::ESRCH | ... | ... |
spec/fabricators/app_fabricator.rb
spec/fabricators/notification_service_fabricator.rb
... | ... | @@ -3,7 +3,7 @@ Fabricator :notification_service do |
3 | 3 | room_id { sequence :word } |
4 | 4 | api_token { sequence :word } |
5 | 5 | subdomain { sequence :word } |
6 | - notify_at_notices { sequence { |a| [0]} } | |
6 | + notify_at_notices { sequence { |_a| [0]} } | |
7 | 7 | end |
8 | 8 | |
9 | 9 | Fabricator :gtalk_notification_service, :from => :notification_service, :class_name => "NotificationServices::GtalkService" do | ... | ... |
spec/lib/configurator_spec.rb
... | ... | @@ -22,7 +22,7 @@ describe Configurator do |
22 | 22 | |
23 | 23 | it 'overrides existing variables' do |
24 | 24 | result = Configurator.run({ |
25 | - one: ['VARONE', ->(values) { 'oveRIIIDE' } ] | |
25 | + one: ['VARONE', ->(_values) { 'oveRIIIDE' } ] | |
26 | 26 | }) |
27 | 27 | expect(result.one).to eq('oveRIIIDE') |
28 | 28 | end | ... | ... |
spec/mailers/mailer_spec.rb
... | ... | @@ -85,7 +85,7 @@ describe Mailer do |
85 | 85 | end |
86 | 86 | |
87 | 87 | context 'with a very long message' do |
88 | - let(:notice) { Fabricate(:notice, :message => 6.times.collect{|a| "0123456789" }.join('')) } | |
88 | + let(:notice) { Fabricate(:notice, :message => 6.times.collect{|_a| "0123456789" }.join('')) } | |
89 | 89 | it "should truncate the long message" do |
90 | 90 | expect(email.subject).to match( / \d{47}\.{3}$/ ) |
91 | 91 | end | ... | ... |
spec/models/notification_service/gtalk_service_spec.rb
... | ... | @@ -14,8 +14,8 @@ describe NotificationServices::GtalkService, type: 'model' do |
14 | 14 | expect(Jabber::Client).to receive(:new).with(jid).and_return(gtalk) |
15 | 15 | expect(gtalk).to receive(:connect).with(notification_service.service) |
16 | 16 | expect(gtalk).to receive(:auth).with(notification_service.api_token) |
17 | - message_value = """#{problem.app.name.to_s} | |
18 | -#{Errbit::Config.protocol}://#{Errbit::Config.host}/apps/#{problem.app.id.to_s} | |
17 | + message_value = """#{problem.app.name} | |
18 | +#{Errbit::Config.protocol}://#{Errbit::Config.host}/apps/#{problem.app.id} | |
19 | 19 | #{notification_service.notification_description problem}""" |
20 | 20 | |
21 | 21 | expect(Jabber::Message).to receive(:new).with(notification_service.user_id, message_value).and_return(message) |
... | ... | @@ -37,8 +37,8 @@ describe NotificationServices::GtalkService, type: 'model' do |
37 | 37 | @notice = Fabricate :notice |
38 | 38 | @notification_service = Fabricate :gtalk_notification_service, :app => @notice.app |
39 | 39 | @problem = @notice.problem |
40 | - @error_msg = """#{@problem.app.name.to_s} | |
41 | -#{Errbit::Config.protocol}://#{Errbit::Config.host}/apps/#{@problem.app.id.to_s} | |
40 | + @error_msg = """#{@problem.app.name} | |
41 | +#{Errbit::Config.protocol}://#{Errbit::Config.host}/apps/#{@problem.app.id} | |
42 | 42 | #{@notification_service.notification_description @problem}""" |
43 | 43 | |
44 | 44 | # gtalk stubbing |
... | ... | @@ -106,8 +106,8 @@ describe NotificationServices::GtalkService, type: 'model' do |
106 | 106 | expect(Jabber::Client).to receive(:new).with(jid).and_return(gtalk) |
107 | 107 | expect(gtalk).to receive(:connect) |
108 | 108 | expect(gtalk).to receive(:auth).with(notification_service.api_token) |
109 | - message_value = """#{problem.app.name.to_s} | |
110 | -#{Errbit::Config.protocol}://#{Errbit::Config.host}/apps/#{problem.app.id.to_s} | |
109 | + message_value = """#{problem.app.name} | |
110 | +#{Errbit::Config.protocol}://#{Errbit::Config.host}/apps/#{problem.app.id} | |
111 | 111 | #{notification_service.notification_description problem}""" |
112 | 112 | |
113 | 113 | expect(Jabber::Message).to receive(:new).with(notification_service.room_id, message_value).and_return(message) | ... | ... |
spec/views/problems/show.html.haml_spec.rb
... | ... | @@ -34,7 +34,7 @@ describe "problems/show.html.haml", type: 'view' do |
34 | 34 | allow(controller).to receive(:current_user).and_return(Fabricate(:user)) |
35 | 35 | end |
36 | 36 | |
37 | - def with_issue_tracker(tracker, problem) | |
37 | + def with_issue_tracker(tracker, _problem) | |
38 | 38 | allow(ErrbitPlugin::Registry).to receive(:issue_trackers).and_return(trackers) |
39 | 39 | app.issue_tracker = IssueTrackerDecorator.new( |
40 | 40 | IssueTracker.new :type_tracker => tracker, :options => { | ... | ... |