* Fastly refactor - Create FastlyConfig - Create FastlyConfig::Base - Create FastlyConfig::Snippets - Move safe_params to its own VCL file - Rescue unauthorized errors in development - Add FastlyConfig errors * Move active version to method * Update naming option --> config * Refactor InvalidConfigsFormat msg to Error class * Refactor active version logic * Fix log_to_datadog call * Move get_active_version logic back into method * Add some specs ¯\_(ツ)_/¯ * Update Fastly rake task * Remove old Fastly way * Update docs for Fastly * Move snippets to config/ & remove old config * Change update_config to upsert_config * Change error type to SubclassResponsibility * Refactor get_updated_files with filter_map * Refactor update * Cleanup update_config --> upsert_config * Fix updater specs
19 lines
455 B
Ruby
19 lines
455 B
Ruby
module FastlyConfig
|
|
module Errors
|
|
class Error < StandardError
|
|
end
|
|
|
|
class InvalidConfigsFormat < Error
|
|
def initialize(msg = "configs: must be an Array of Strings")
|
|
super(msg)
|
|
end
|
|
end
|
|
|
|
class InvalidConfig < Error
|
|
def initialize(invalid_config, valid_configs)
|
|
msg = "Invalid Fastly config - #{invalid_config}. Only #{valid_configs.join(', ')} are valid."
|
|
super(msg)
|
|
end
|
|
end
|
|
end
|
|
end
|