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'
module Docs
@ -26,6 +28,7 @@ module Docs
def justify(str)
return str unless terminal_width
str = str.dup
max_length = if tag = str.slice!(/ \[.+\]\z/)
terminal_width - tag.length

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

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

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

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

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Docs
class ScraperSubscriber < Subscriber
self.namespace = 'scraper'
@ -12,7 +14,7 @@ module Docs
def ignore_response(event)
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)
end

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

Loading…
Cancel
Save