Class: RailsWayback::Configuration
- Inherits:
-
Object
- Object
- RailsWayback::Configuration
- Defined in:
- lib/rails_wayback/configuration.rb
Constant Summary collapse
- DEFAULT_VIEW_PATHS =
Includes the common places where Rails apps put render targets.
app/componentsis picked up by the ViewComponent gem;app/viewsis stock Rails. ["app/views", "app/components"].freeze
- DEFAULT_ASSET_PATHS =
["app/assets", "public"].freeze
- DEFAULT_MAX_COMMITS =
50
Instance Attribute Summary collapse
-
#app_root ⇒ Object
Returns the value of attribute app_root.
-
#asset_paths ⇒ Object
Returns the value of attribute asset_paths.
-
#cache_root ⇒ Object
Returns the value of attribute cache_root.
-
#max_commits ⇒ Object
Returns the value of attribute max_commits.
-
#toggle_file ⇒ Object
Returns the value of attribute toggle_file.
-
#view_paths ⇒ Object
Returns the value of attribute view_paths.
Instance Method Summary collapse
- #app_root_path ⇒ Object
- #cache_root_path ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #refs_cache_path ⇒ Object
- #toggle_file_path ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
17 18 19 20 21 22 23 24 |
# File 'lib/rails_wayback/configuration.rb', line 17 def initialize @view_paths = DEFAULT_VIEW_PATHS.dup @asset_paths = DEFAULT_ASSET_PATHS.dup @max_commits = DEFAULT_MAX_COMMITS @app_root = nil @cache_root = nil @toggle_file = nil end |
Instance Attribute Details
#app_root ⇒ Object
Returns the value of attribute app_root.
14 15 16 |
# File 'lib/rails_wayback/configuration.rb', line 14 def app_root @app_root end |
#asset_paths ⇒ Object
Returns the value of attribute asset_paths.
14 15 16 |
# File 'lib/rails_wayback/configuration.rb', line 14 def asset_paths @asset_paths end |
#cache_root ⇒ Object
Returns the value of attribute cache_root.
14 15 16 |
# File 'lib/rails_wayback/configuration.rb', line 14 def cache_root @cache_root end |
#max_commits ⇒ Object
Returns the value of attribute max_commits.
14 15 16 |
# File 'lib/rails_wayback/configuration.rb', line 14 def max_commits @max_commits end |
#toggle_file ⇒ Object
Returns the value of attribute toggle_file.
14 15 16 |
# File 'lib/rails_wayback/configuration.rb', line 14 def toggle_file @toggle_file end |
#view_paths ⇒ Object
Returns the value of attribute view_paths.
14 15 16 |
# File 'lib/rails_wayback/configuration.rb', line 14 def view_paths @view_paths end |
Instance Method Details
#app_root_path ⇒ Object
26 27 28 |
# File 'lib/rails_wayback/configuration.rb', line 26 def app_root_path Pathname.new(@app_root || RailsWayback.root) end |
#cache_root_path ⇒ Object
30 31 32 |
# File 'lib/rails_wayback/configuration.rb', line 30 def cache_root_path Pathname.new(@cache_root || app_root_path.join("tmp", "rails_wayback")) end |
#refs_cache_path ⇒ Object
38 39 40 |
# File 'lib/rails_wayback/configuration.rb', line 38 def refs_cache_path cache_root_path.join("refs") end |
#toggle_file_path ⇒ Object
34 35 36 |
# File 'lib/rails_wayback/configuration.rb', line 34 def toggle_file_path Pathname.new(@toggle_file || cache_root_path.join("enabled")) end |