File tree Expand file tree Collapse file tree 6 files changed +11
-11
lines changed
Expand file tree Collapse file tree 6 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ namespace :docs do
8282
8383 instance_methods_to_document = meths . select { |method | method . scope != :class }
8484 class_methods_to_document = meths . select { |method | method . scope == :class }
85- configuration_methods_to_document = registry . get ( "ViewComponent::Config " ) . meths . select ( &:reader? )
85+ configuration_methods_to_document = registry . get ( "ViewComponent::ApplicationConfig " ) . meths . select ( &:reader? )
8686 test_helper_methods_to_document = registry
8787 . get ( "ViewComponent::TestHelpers" )
8888 . meths
Original file line number Diff line number Diff line change 66module ViewComponent
77 extend ActiveSupport ::Autoload
88
9+ autoload :ApplicationConfig
910 autoload :Base
1011 autoload :CaptureCompatibility
1112 autoload :Compiler
1213 autoload :CompileCache
1314 autoload :ComponentError
14- autoload :Config
1515 autoload :Deprecation
1616 autoload :InlineTemplate
1717 autoload :Instrumentation
Original file line number Diff line number Diff line change 33require "view_component/deprecation"
44
55module ViewComponent
6- class Config
6+ class ApplicationConfig
77 class << self
88 # `new` without any arguments initializes the default configuration, but
99 # it's important to differentiate in case that's no longer the case in
@@ -29,7 +29,7 @@ def defaults
2929 controller : "ViewComponentsController" ,
3030 route : "/rails/view_components" ,
3131 show_source : ( Rails . env . development? || Rails . env . test? ) ,
32- paths : ViewComponent :: Config . default_preview_paths ,
32+ paths : default_preview_paths ,
3333 default_layout : nil
3434 ] ,
3535 instrumentation_enabled : false ,
Original file line number Diff line number Diff line change 22
33require "action_view"
44require "active_support/configurable"
5+ require "view_component/application_config"
56require "view_component/collection"
67require "view_component/compile_cache"
78require "view_component/compiler"
8- require "view_component/config"
99require "view_component/errors"
1010require "view_component/inline_template"
1111require "view_component/preview"
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33require "rails"
4- require "view_component/config "
4+ require "view_component/application_config "
55require "view_component/deprecation"
66
77module ViewComponent
88 class Engine < Rails ::Engine # :nodoc:
9- config . view_component = ViewComponent ::Config . default
9+ config . view_component = ViewComponent ::ApplicationConfig . default
1010
1111 if Rails . version . to_f < 8.0
1212 rake_tasks do
Original file line number Diff line number Diff line change 55module ViewComponent
66 class ConfigTest < TestCase
77 def setup
8- @config = ViewComponent ::Config . new
8+ @config = ViewComponent ::ApplicationConfig . new
99 end
1010
1111 def test_defaults_are_correct
@@ -39,9 +39,9 @@ def test_all_methods_are_documented
3939 Rake ::Task [ "yard" ] . execute
4040 configuration_methods_to_document = YARD ::RegistryStore . new . tap do |store |
4141 store . load! ( ".yardoc" )
42- end . get ( "ViewComponent::Config " ) . meths . select ( &:reader? ) . reject { |meth | meth . name == :config }
43- default_options = ViewComponent ::Config . defaults . keys
44- accessors = ViewComponent ::Config . instance_methods ( false ) . reject do |method_name |
42+ end . get ( "ViewComponent::ApplicationConfig " ) . meths . select ( &:reader? ) . reject { |meth | meth . name == :config }
43+ default_options = ViewComponent ::ApplicationConfig . defaults . keys
44+ accessors = ViewComponent ::ApplicationConfig . instance_methods ( false ) . reject do |method_name |
4545 method_name . to_s . end_with? ( "=" ) || method_name == :method_missing
4646 end
4747 options_defined_on_instance = Set [ *default_options , *accessors ]
You can’t perform that action at this time.
0 commit comments