diff --git a/.rubocop.yml b/.rubocop.yml index 6d5256a8..03324d13 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -273,7 +273,7 @@ Security/YAMLLoad: Style/AccessModifierDeclarations: Enabled: false Style/AccessorGrouping: - Enabled: false + Enabled: true Style/Alias: EnforcedStyle: prefer_alias_method Style/AndOr: diff --git a/lib/jekyll/cache.rb b/lib/jekyll/cache.rb index be9a1893..8bffd0d4 100644 --- a/lib/jekyll/cache.rb +++ b/lib/jekyll/cache.rb @@ -11,14 +11,10 @@ module Jekyll @disk_cache_enabled = true class << self - # class-wide cache location - attr_accessor :cache_dir + attr_accessor :cache_dir # class-wide cache location - # class-wide directive to write cache to disk - attr_reader :disk_cache_enabled - - # class-wide base cache reader - attr_reader :base_cache + attr_reader :base_cache, # class-wide base cache reader + :disk_cache_enabled # class-wide directive to write cache to disk # Disable Marshaling cached items to disk def disable_disk_cache! diff --git a/lib/jekyll/commands/serve/live_reload_reactor.rb b/lib/jekyll/commands/serve/live_reload_reactor.rb index 960b5582..6ca34665 100644 --- a/lib/jekyll/commands/serve/live_reload_reactor.rb +++ b/lib/jekyll/commands/serve/live_reload_reactor.rb @@ -8,9 +8,7 @@ module Jekyll module Commands class Serve class LiveReloadReactor - attr_reader :started_event - attr_reader :stopped_event - attr_reader :thread + attr_reader :started_event, :stopped_event, :thread def initialize @websockets = [] diff --git a/lib/jekyll/drops/unified_payload_drop.rb b/lib/jekyll/drops/unified_payload_drop.rb index 24aefde2..24e62e58 100644 --- a/lib/jekyll/drops/unified_payload_drop.rb +++ b/lib/jekyll/drops/unified_payload_drop.rb @@ -5,8 +5,8 @@ module Jekyll class UnifiedPayloadDrop < Drop mutable true - attr_accessor :page, :layout, :content, :paginator - attr_accessor :highlighter_prefix, :highlighter_suffix + attr_accessor :content, :page, :layout, :paginator, + :highlighter_prefix, :highlighter_suffix def jekyll JekyllDrop.global diff --git a/lib/jekyll/excerpt.rb b/lib/jekyll/excerpt.rb index 20e8147d..a406951e 100644 --- a/lib/jekyll/excerpt.rb +++ b/lib/jekyll/excerpt.rb @@ -4,8 +4,7 @@ module Jekyll class Excerpt extend Forwardable - attr_accessor :doc - attr_accessor :content, :ext + attr_accessor :content, :doc, :ext attr_writer :output def_delegators :@doc, diff --git a/lib/jekyll/layout.rb b/lib/jekyll/layout.rb index 348b6aed..af3ea71a 100644 --- a/lib/jekyll/layout.rb +++ b/lib/jekyll/layout.rb @@ -4,26 +4,14 @@ module Jekyll class Layout include Convertible - # Gets the Site object. - attr_reader :site + attr_accessor :content, # content of layout + :data, # the Hash that holds the metadata for this layout + :ext # extension of layout - # Gets the name of this layout. - attr_reader :name - - # Gets the path to this layout. - attr_reader :path - - # Gets the path to this layout relative to its base - attr_reader :relative_path - - # Gets/Sets the extension of this layout. - attr_accessor :ext - - # Gets/Sets the Hash that holds the metadata for this layout. - attr_accessor :data - - # Gets/Sets the content of this layout. - attr_accessor :content + attr_reader :name, # name of layout + :path, # path to layout + :site, # the Site object + :relative_path # path to layout relative to its base # Initialize a new Layout. # diff --git a/lib/jekyll/page.rb b/lib/jekyll/page.rb index 3797f880..64821a82 100644 --- a/lib/jekyll/page.rb +++ b/lib/jekyll/page.rb @@ -5,9 +5,7 @@ module Jekyll include Convertible attr_writer :dir - attr_accessor :site, :pager - attr_accessor :name, :ext, :basename - attr_accessor :data, :content, :output + attr_accessor :basename, :content, :data, :ext, :name, :output, :pager, :site alias_method :extname, :ext diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index bf35d087..b452753a 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -2,15 +2,15 @@ module Jekyll class Site - attr_reader :source, :dest, :cache_dir, :config - attr_accessor :layouts, :pages, :static_files, :drafts, :inclusions, - :exclude, :include, :lsi, :highlighter, :permalink_style, - :time, :future, :unpublished, :safe, :plugins, :limit_posts, - :show_drafts, :keep_files, :baseurl, :data, :file_read_opts, - :gems, :plugin_manager, :theme + attr_accessor :baseurl, :converters, :data, :drafts, :exclude, + :file_read_opts, :future, :gems, :generators, :highlighter, + :include, :inclusions, :keep_files, :layouts, :limit_posts, + :lsi, :pages, :permalink_style, :plugin_manager, :plugins, + :reader, :safe, :show_drafts, :static_files, :theme, :time, + :unpublished - attr_accessor :converters, :generators, :reader - attr_reader :regenerator, :liquid_renderer, :includes_load_paths, :filter_cache, :profiler + attr_reader :cache_dir, :config, :dest, :filter_cache, :includes_load_paths, + :liquid_renderer, :profiler, :regenerator, :source # Public: Initialize a new Site. #