Add frozen_string_literal to subscriber files"

pull/631/merge
Thibaut Courouble 8 years ago
parent 7db9ec6bdc
commit ee21c0bf29

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'active_support/subscriber' require 'active_support/subscriber'
module Docs module Docs
@ -26,6 +28,7 @@ module Docs
def justify(str) def justify(str)
return str unless terminal_width return str unless terminal_width
str = str.dup
max_length = if tag = str.slice!(/ \[.+\]\z/) max_length = if tag = str.slice!(/ \[.+\]\z/)
terminal_width - tag.length terminal_width - tag.length

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Docs module Docs
class DocSubscriber < Subscriber class DocSubscriber < Subscriber
self.namespace = 'doc' self.namespace = 'doc'

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Docs module Docs
class FilterSubscriber < Subscriber class FilterSubscriber < Subscriber
self.namespace = 'html_pipeline' self.namespace = 'html_pipeline'

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'progress_bar' require 'progress_bar'
module Docs module Docs

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Docs module Docs
class RequestSubscriber < Subscriber class RequestSubscriber < Subscriber
self.namespace = 'request' self.namespace = 'request'

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Docs module Docs
class ScraperSubscriber < Subscriber class ScraperSubscriber < Subscriber
self.namespace = 'scraper' self.namespace = 'scraper'
@ -12,7 +14,7 @@ module Docs
def ignore_response(event) def ignore_response(event)
msg = "Ignore: #{format_url event.payload[:response].url}" msg = "Ignore: #{format_url event.payload[:response].url}"
msg << " [#{event.payload[:response].code}]" if event.payload[:response].respond_to?(:code) msg += " [#{event.payload[:response].code}]" if event.payload[:response].respond_to?(:code)
log(msg) log(msg)
end end

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Docs module Docs
class StoreSubscriber < Subscriber class StoreSubscriber < Subscriber
self.namespace = 'store' self.namespace = 'store'

Loading…
Cancel
Save