Class: LookbookVisualTester::Configuration
- Inherits:
-
Object
- Object
- LookbookVisualTester::Configuration
- Defined in:
- lib/lookbook_visual_tester/configuration.rb
Constant Summary collapse
- DEFAULT_THREADS =
4
Instance Attribute Summary collapse
-
#base_path ⇒ Object
Returns the value of attribute base_path.
-
#baseline_dir ⇒ Object
Returns the value of attribute baseline_dir.
-
#components_folder ⇒ Object
Returns the value of attribute components_folder.
-
#copy_to_clipboard ⇒ Object
Returns the value of attribute copy_to_clipboard.
-
#current_dir ⇒ Object
Returns the value of attribute current_dir.
-
#diff_dir ⇒ Object
Returns the value of attribute diff_dir.
-
#history_dir ⇒ Object
Returns the value of attribute history_dir.
-
#history_keep_last_n ⇒ Object
Returns the value of attribute history_keep_last_n.
-
#lookbook_host ⇒ Object
Returns the value of attribute lookbook_host.
-
#threads ⇒ Object
Returns the value of attribute threads.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/lookbook_visual_tester/configuration.rb', line 10 def initialize @base_path = if defined?(Rails) && Rails.respond_to?(:env) && Rails.env.test? Pathname.new(Dir.pwd).join('spec/visual_screenshots') elsif defined?(Rails) && Rails.respond_to?(:root) && Rails.root Rails.root.join('spec/visual_screenshots') else # Fallback for non-Rails environments Pathname.new(Dir.pwd).join('spec/visual_screenshots') end @baseline_dir = @base_path.join('baseline') @current_dir = @base_path.join('current_run') @diff_dir = @base_path.join('diff') @history_dir = @base_path.join('history') @threads = DEFAULT_THREADS @history_keep_last_n = 5 @copy_to_clipboard = true @components_folder = 'app/components' @lookbook_host = ENV.fetch('LOOKBOOK_HOST', 'https://localhost:5000') end |
Instance Attribute Details
#base_path ⇒ Object
Returns the value of attribute base_path.
3 4 5 |
# File 'lib/lookbook_visual_tester/configuration.rb', line 3 def base_path @base_path end |
#baseline_dir ⇒ Object
Returns the value of attribute baseline_dir.
3 4 5 |
# File 'lib/lookbook_visual_tester/configuration.rb', line 3 def baseline_dir @baseline_dir end |
#components_folder ⇒ Object
Returns the value of attribute components_folder.
3 4 5 |
# File 'lib/lookbook_visual_tester/configuration.rb', line 3 def components_folder @components_folder end |
#copy_to_clipboard ⇒ Object
Returns the value of attribute copy_to_clipboard.
3 4 5 |
# File 'lib/lookbook_visual_tester/configuration.rb', line 3 def copy_to_clipboard @copy_to_clipboard end |
#current_dir ⇒ Object
Returns the value of attribute current_dir.
3 4 5 |
# File 'lib/lookbook_visual_tester/configuration.rb', line 3 def current_dir @current_dir end |
#diff_dir ⇒ Object
Returns the value of attribute diff_dir.
3 4 5 |
# File 'lib/lookbook_visual_tester/configuration.rb', line 3 def diff_dir @diff_dir end |
#history_dir ⇒ Object
Returns the value of attribute history_dir.
3 4 5 |
# File 'lib/lookbook_visual_tester/configuration.rb', line 3 def history_dir @history_dir end |
#history_keep_last_n ⇒ Object
Returns the value of attribute history_keep_last_n.
3 4 5 |
# File 'lib/lookbook_visual_tester/configuration.rb', line 3 def history_keep_last_n @history_keep_last_n end |
#lookbook_host ⇒ Object
Returns the value of attribute lookbook_host.
3 4 5 |
# File 'lib/lookbook_visual_tester/configuration.rb', line 3 def lookbook_host @lookbook_host end |
#threads ⇒ Object
Returns the value of attribute threads.
3 4 5 |
# File 'lib/lookbook_visual_tester/configuration.rb', line 3 def threads @threads end |
Class Method Details
.config ⇒ Object
32 33 34 |
# File 'lib/lookbook_visual_tester/configuration.rb', line 32 def config @config ||= new end |
.configure {|config| ... } ⇒ Object
36 37 38 |
# File 'lib/lookbook_visual_tester/configuration.rb', line 36 def configure yield(config) end |