Skip to content

Commit

Permalink
Rename SpecialistPublisher to ManualsPublisher
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Laing committed Sep 23, 2016
1 parent 23eb39f commit 3120a87
Show file tree
Hide file tree
Showing 74 changed files with 132 additions and 132 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

require File.expand_path("../config/application", __FILE__)

SpecialistPublisher::Application.load_tasks
ManualsPublisher::Application.load_tasks

task :rubocop do
system("bin/rubocop")
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/abstract_documents_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "specialist_publisher"
require "manuals_publisher"

class AbstractDocumentsController < ApplicationController
before_filter :authorize_user_for_editing
Expand Down Expand Up @@ -181,11 +181,11 @@ def document_params
end

def view_adapter(document)
SpecialistPublisher.view_adapter(document)
ManualsPublisher.view_adapter(document)
end

def services
SpecialistPublisher.document_services(document_type)
ManualsPublisher.document_services(document_type)
end

def index_path
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "specialist_publisher_wiring"
require "manuals_publisher_wiring"
require "forwardable"
require "permission_checker"
require "url_maker"
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/attachments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ def update

private
def view_adapter(document)
SpecialistPublisher.view_adapter(document)
ManualsPublisher.view_adapter(document)
end

def services
SpecialistPublisher.attachment_services(document_type)
ManualsPublisher.attachment_services(document_type)
end

def edit_path(document)
Expand Down
2 changes: 1 addition & 1 deletion app/importers/cma_import.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def cma_case_factory
end

def cma_cases_repository
SpecialistPublisherWiring.get(:repository_registry).for_type("cma_case")
ManualsPublisherWiring.get(:repository_registry).for_type("cma_case")
end

def logger
Expand Down
4 changes: 2 additions & 2 deletions app/importers/medical_safety_alert_import.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def report_builder
SpecialistDocumentBuilder.new("medical_safety_alert",
->(*args) {
null_validator(
SpecialistPublisherWiring
ManualsPublisherWiring
.get(:validatable_document_factories)
.medical_safety_alert_factory
.call(*args)
Expand All @@ -79,7 +79,7 @@ def report_builder
end

def repo
SpecialistPublisherWiring.get(:repository_registry).for_type("medical_safety_alert")
ManualsPublisherWiring.get(:repository_registry).for_type("medical_safety_alert")
end

def null_validator(thing)
Expand Down
4 changes: 2 additions & 2 deletions app/lib/finder_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
class FinderSchema

def self.humanized_facet_name(key, entity, type)
schema = SpecialistPublisherWiring.get("#{type}_finder_schema".to_sym)
schema = ManualsPublisherWiring.get("#{type}_finder_schema".to_sym)
value = entity.send(key)
schema.humanized_facet_value(key, value)
end

def self.options_for(facet_name, type)
schema = SpecialistPublisherWiring.get("#{type}_finder_schema".to_sym)
schema = ManualsPublisherWiring.get("#{type}_finder_schema".to_sym)
schema.options_for(facet_name)
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module SpecialistPublisher
module ManualsPublisher
extend self

def attachment_services(document_type)
Expand All @@ -10,7 +10,7 @@ def attachment_services(document_type)
def document_services(document_type)
AbstractDocumentServiceRegistry.new(
repository: document_repositories.for_type(document_type),
builder: SpecialistPublisherWiring.get("#{document_type}_builder".to_sym),
builder: ManualsPublisherWiring.get("#{document_type}_builder".to_sym),
observers: observer_registry(document_type),
)
end
Expand Down Expand Up @@ -91,11 +91,11 @@ def document_types
}

def view_adapters
SpecialistPublisherWiring.get(:view_adapter_registry)
ManualsPublisherWiring.get(:view_adapter_registry)
end

def document_repositories
SpecialistPublisherWiring.get(:repository_registry)
ManualsPublisherWiring.get(:repository_registry)
end

def observer_registry(document_type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
$LOAD_PATH.unshift(File.expand_path("../..", "app/services"))

# rubocop:disable ConstantName
SpecialistPublisherWiring ||= DependencyContainer.new do
ManualsPublisherWiring ||= DependencyContainer.new do
define_factory(:manual_builder) {
ManualBuilder.new(
slug_generator: SlugGenerator.new(prefix: "guidance"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def publishing_api_exporter(force_draft = false)
->(document, update_type = nil) {
rendered_document = SpecialistDocumentPublishingAPIFormatter.new(
document,
specialist_document_renderer: SpecialistPublisherWiring.get(:specialist_document_renderer),
specialist_document_renderer: ManualsPublisherWiring.get(:specialist_document_renderer),
publication_logs: PublicationLog,
links: format_links_for_publishing_api(document),
update_type: update_type
Expand Down Expand Up @@ -119,7 +119,7 @@ def format_links_for_publishing_api(document)
end

def email_alert_api
SpecialistPublisherWiring.get(:email_alert_api)
ManualsPublisherWiring.get(:email_alert_api)
end

def publication_alert_exporter
Expand Down Expand Up @@ -155,10 +155,10 @@ def url_maker
end

def publishing_api
SpecialistPublisherWiring.get(:publishing_api)
ManualsPublisherWiring.get(:publishing_api)
end

def publishing_api_v2
SpecialistPublisherWiring.get(:publishing_api_v2)
ManualsPublisherWiring.get(:publishing_api_v2)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class AsylumSupportDecisionObserversRegistry < AbstractSpecialistDocumentObserve

private
def finder_schema
SpecialistPublisherWiring.get(:asylum_support_decision_finder_schema)
ManualsPublisherWiring.get(:asylum_support_decision_finder_schema)
end

def format_document_for_indexing(document)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class EmploymentAppealTribunalDecisionObserversRegistry < AbstractSpecialistDocu

private
def finder_schema
SpecialistPublisherWiring.get(:employment_appeal_tribunal_decision_finder_schema)
ManualsPublisherWiring.get(:employment_appeal_tribunal_decision_finder_schema)
end

def format_document_for_indexing(document)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class EmploymentTribunalDecisionObserversRegistry < AbstractSpecialistDocumentOb

private
def finder_schema
SpecialistPublisherWiring.get(:employment_tribunal_decision_finder_schema)
ManualsPublisherWiring.get(:employment_tribunal_decision_finder_schema)
end

def format_document_for_indexing(document)
Expand Down
10 changes: 5 additions & 5 deletions app/observers/manual_observers_registry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def rummager_withdrawer

def publishing_api_exporter
->(manual, action = nil) {
manual_renderer = SpecialistPublisherWiring.get(:manual_renderer)
manual_renderer = ManualsPublisherWiring.get(:manual_renderer)
ManualPublishingAPIExporter.new(
publishing_api.method(:put_content_item),
organisation(manual.attributes.fetch(:organisation_slug)),
Expand All @@ -107,7 +107,7 @@ def publishing_api_exporter
manual
).call

document_renderer = SpecialistPublisherWiring.get(:manual_document_renderer)
document_renderer = ManualsPublisherWiring.get(:manual_document_renderer)
manual.documents.each do |document|
next if !document.needs_exporting? && action != :republish

Expand All @@ -126,7 +126,7 @@ def publishing_api_exporter

def publishing_api_draft_exporter
->(manual, _ = nil) {
manual_renderer = SpecialistPublisherWiring.get(:manual_renderer)
manual_renderer = ManualsPublisherWiring.get(:manual_renderer)
ManualPublishingAPIExporter.new(
publishing_api.method(:put_draft_content_item),
organisation(manual.attributes.fetch(:organisation_slug)),
Expand Down Expand Up @@ -154,10 +154,10 @@ def publishing_api_withdrawer
end

def publishing_api
SpecialistPublisherWiring.get(:publishing_api)
ManualsPublisherWiring.get(:publishing_api)
end

def organisation(slug)
SpecialistPublisherWiring.get(:organisation_fetcher).call(slug)
ManualsPublisherWiring.get(:organisation_fetcher).call(slug)
end
end
2 changes: 1 addition & 1 deletion app/observers/tax_tribunal_decision_observers_registry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class TaxTribunalDecisionObserversRegistry < AbstractSpecialistDocumentObservers

private
def finder_schema
SpecialistPublisherWiring.get(:tax_tribunal_decision_finder_schema)
ManualsPublisherWiring.get(:tax_tribunal_decision_finder_schema)
end

def format_document_for_indexing(document)
Expand Down
2 changes: 1 addition & 1 deletion app/observers/utaac_decision_observers_registry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class UtaacDecisionObserversRegistry < AbstractSpecialistDocumentObserversRegist

private
def finder_schema
SpecialistPublisherWiring.get(:utaac_decision_finder_schema)
ManualsPublisherWiring.get(:utaac_decision_finder_schema)
end

def format_document_for_indexing(document)
Expand Down
4 changes: 2 additions & 2 deletions app/services/abstract_document_service_registry.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "specialist_publisher_wiring"
require "manuals_publisher_wiring"
require "list_documents_service"
require "show_document_service"
require "new_document_service"
Expand Down Expand Up @@ -113,7 +113,7 @@ def withdraw(document_id)

private
def document_renderer
SpecialistPublisherWiring.get(:specialist_document_renderer)
ManualsPublisherWiring.get(:specialist_document_renderer)
end

def document_repository
Expand Down
16 changes: 8 additions & 8 deletions app/services/abstract_manual_document_service_registry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
require "list_manual_documents_service"
require "reorder_manual_documents_service"
require "remove_manual_document_service"
require "specialist_publisher_wiring"
require "manuals_publisher_wiring"

class AbstractManualDocumentServiceRegistry
def preview(context)
Expand Down Expand Up @@ -78,27 +78,27 @@ def remove(context)

private
def document_renderer
SpecialistPublisherWiring.get(:specialist_document_renderer)
ManualsPublisherWiring.get(:specialist_document_renderer)
end

def manual_document_builder
SpecialistPublisherWiring.get(:manual_document_builder)
ManualsPublisherWiring.get(:manual_document_builder)
end

def manual_repository
raise NotImplementedError
end

def organisation(slug)
SpecialistPublisherWiring.get(:organisation_fetcher).call(slug)
ManualsPublisherWiring.get(:organisation_fetcher).call(slug)
end

def publishing_api_draft_manual_exporter
->(_, manual) {
ManualPublishingAPIExporter.new(
publishing_api.method(:put_draft_content_item),
organisation(manual.attributes.fetch(:organisation_slug)),
SpecialistPublisherWiring.get(:manual_renderer),
ManualsPublisherWiring.get(:manual_renderer),
PublicationLog,
manual
).call
Expand All @@ -110,19 +110,19 @@ def publishing_api_draft_manual_document_exporter
ManualSectionPublishingAPIExporter.new(
publishing_api.method(:put_draft_content_item),
organisation(manual.attributes.fetch(:organisation_slug)),
SpecialistPublisherWiring.get(:manual_document_renderer),
ManualsPublisherWiring.get(:manual_document_renderer),
manual,
manual_document
).call
}
end

def manual_document_renderer
SpecialistPublisherWiring.get(:manual_document_renderer)
ManualsPublisherWiring.get(:manual_document_renderer)
end

def publishing_api
SpecialistPublisherWiring.get(:publishing_api)
ManualsPublisherWiring.get(:publishing_api)
end

def organisations_api
Expand Down
6 changes: 3 additions & 3 deletions app/services/abstract_manual_service_registry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
require "republish_manual_service"
require "withdraw_manual_service"
require "publish_manual_worker"
require "specialist_publisher_wiring"
require "manuals_publisher_wiring"
require "manual_observers_registry"

class AbstractManualServiceRegistry
Expand Down Expand Up @@ -93,11 +93,11 @@ def withdraw(manual_id)

private
def manual_renderer
SpecialistPublisherWiring.get(:manual_renderer)
ManualsPublisherWiring.get(:manual_renderer)
end

def manual_builder
SpecialistPublisherWiring.get(:manual_builder)
ManualsPublisherWiring.get(:manual_builder)
end

def repository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ class ManualDocumentAttachmentServiceRegistry < AbstractManualDocumentAttachment

private
def repository
SpecialistPublisherWiring.get(:repository_registry).manual_repository
ManualsPublisherWiring.get(:repository_registry).manual_repository
end
end
2 changes: 1 addition & 1 deletion app/services/manual_document_service_registry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ class ManualDocumentServiceRegistry < AbstractManualDocumentServiceRegistry

private
def manual_repository
SpecialistPublisherWiring.get(:repository_registry).manual_repository
ManualsPublisherWiring.get(:repository_registry).manual_repository
end
end
4 changes: 2 additions & 2 deletions app/services/manual_service_registry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ class ManualServiceRegistry < AbstractManualServiceRegistry

private
def associationless_repository
SpecialistPublisherWiring.get(:repository_registry)
ManualsPublisherWiring.get(:repository_registry)
.associationless_manual_repository
end

def repository
SpecialistPublisherWiring.get(:repository_registry).manual_repository
ManualsPublisherWiring.get(:repository_registry).manual_repository
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def initialize(dependencies)
attr_reader :organisation_slug

def manual_repository_factory
SpecialistPublisherWiring.get(:repository_registry)
ManualsPublisherWiring.get(:repository_registry)
.organisation_scoped_manual_repository_factory
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def initialize(dependencies)
attr_reader :organisation_slug

def manual_repository_factory
SpecialistPublisherWiring.get(:repository_registry).
ManualsPublisherWiring.get(:repository_registry).
organisation_scoped_manual_repository_factory
end

Expand Down
Loading

0 comments on commit 3120a87

Please sign in to comment.