Sha256: c336235d624f13fce2a4d78fcd9c438811b56b7b5dd3ec632b4a935dd7b584b9

Contents?: true

Size: 635 Bytes

Versions: 40

Compression:

Stored size: 635 Bytes

Contents

module Lookbook
  class ActionViewAnnotationsHandler < Service
    attr_reader :disable_annotations

    def initialize(disable_annotations: true)
      @disable_annotations = disable_annotations
    end

    def call
      if ActionView::Base.respond_to?(:annotate_rendered_view_with_filenames) && disable_annotations
        original_value = ActionView::Base.annotate_rendered_view_with_filenames
        ActionView::Base.annotate_rendered_view_with_filenames = false
        res = yield
        ActionView::Base.annotate_rendered_view_with_filenames = original_value
        res
      else
        yield
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
lookbook-2.2.2 lib/lookbook/services/templates/action_view_annotations_handler.rb
lookbook-2.2.1 lib/lookbook/services/templates/action_view_annotations_handler.rb
lookbook-2.2.0 lib/lookbook/services/templates/action_view_annotations_handler.rb
lookbook-2.1.1 lib/lookbook/services/templates/action_view_annotations_handler.rb
lookbook-2.1.0 lib/lookbook/services/templates/action_view_annotations_handler.rb
lookbook-2.0.5 lib/lookbook/services/templates/action_view_annotations_handler.rb
lookbook-2.0.4 lib/lookbook/services/templates/action_view_annotations_handler.rb
lookbook-2.0.3 lib/lookbook/services/templates/action_view_annotations_handler.rb
lookbook-2.0.2 lib/lookbook/services/templates/action_view_annotations_handler.rb
lookbook-2.0.1 lib/lookbook/services/templates/action_view_annotations_handler.rb
lookbook-2.0.0 lib/lookbook/services/templates/action_view_annotations_handler.rb
lookbook-2.0.0.rc.3 lib/lookbook/services/templates/action_view_annotations_handler.rb
lookbook-1.5.5 lib/lookbook/services/templates/action_view_annotations_handler.rb
lookbook-1.5.4 lib/lookbook/services/templates/action_view_annotations_handler.rb
lookbook-2.0.0.rc.2 lib/lookbook/services/templates/action_view_annotations_handler.rb
lookbook-2.0.0.rc.1 lib/lookbook/services/templates/action_view_annotations_handler.rb
lookbook-2.0.0.beta.9 lib/lookbook/services/templates/action_view_annotations_handler.rb
lookbook-2.0.0.beta.8 lib/lookbook/services/templates/action_view_annotations_handler.rb
lookbook-2.0.0.beta.7 lib/lookbook/services/templates/action_view_annotations_handler.rb
lookbook-2.0.0.beta.6 lib/lookbook/services/templates/action_view_annotations_handler.rb