Class: Chemlab::Configuration

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Attributable, Runtime::Logger
Defined in:
lib/chemlab/configuration.rb

Overview

Chemlab Configuration

Constant Summary collapse

"\n              ##                                                ##\n             ####                                              ####\n            ######                                            ######\n           #######                                           #######\n           ########                                         #########\n          ##########                                        #########\n          ##########                                       ###########\n         ############                                      ############\n        ##########/------------------------------------------\\#########\n       ##########/  / ___| |__   ___ _ __ ___ | | __ _| |__   \\#########\n       #########|  | |   | '_ \\ / _ \\ '_ ` _ \\| |/ _` | '_ \\   |########\n      ##########|  | |___| | | |  __/ | | | | | | (_| | |_) |  |#########\n      ###########\\  \\____|_| |_|\\___|_| |_| |_|_|\\__,_|_.__/  /###########\n     #############\\------------------------------------------/#############\n    \\*********************############################********************/\n    \\\\\\********************##########################********************///\n   \\\\\\\\\\\\******************#########################*******************//////\n  \\\\\\\\\\\\\\\\******************########################******************////////\n  \\\\\\\\\\\\\\\\\\\\*****************######################*****************//////////\n \\\\\\\\\\\\\\\\\\\\\\\\****************#####################****************/////////////\n\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\***************####################***************///////////////\n\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\***************##################**************/////////////////\n \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*************#################**************/////////////////\n    \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*************################************////////////////\n       \\\\\\\\\\\\\\\\\\\\\\\\\\\\************##############************//////////////\n         \\\\\\\\\\\\\\\\\\\\\\\\\\\\**********#############***********/////////////\n            \\\\\\\\\\\\\\\\\\\\\\\\**********############**********////////////\n               \\\\\\\\\\\\\\\\\\\\\\********###########*********///////////\n                  \\\\\\\\\\\\\\\\\\********#########********//////////\n                    \\\\\\\\\\\\\\\\\\*******########*******////////\n                       \\\\\\\\\\\\\\*******######******////////\n                          \\\\\\\\\\\\*****######*****//////\n                             \\\\\\\\\\****####****/////\n                               \\\\\\\\***###***////\n                                  \\\\\\**##**///\n                                     \\****/\n                                       **\n"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Attributable

included

Methods included from Runtime::Logger

#log

Constructor Details

#initialize {|_self| ... } ⇒ Configuration

Returns a new instance of Configuration.

Yields:

  • (_self)

Yield Parameters:



52
53
54
55
56
57
58
59
60
61
62
# File 'lib/chemlab/configuration.rb', line 52

def initialize
  yield self if block_given?

  log(BANNER, :begn) unless hide_banner
  log("\n  ==> Base URL: \#{base_url}\n  ==> Browser: \#{browser}\n  ==> Libraries: \#{libraries}\n  CONF\nend\n", :conf)

Instance Attribute Details

#browserObject

Returns the value of attribute browser.



72
73
74
# File 'lib/chemlab/configuration.rb', line 72

def browser
  @browser
end

#librariesObject

Returns the value of attribute libraries.



72
73
74
# File 'lib/chemlab/configuration.rb', line 72

def libraries
  @libraries
end

Instance Method Details

#configure_rspecObject

Call RSpec.configure for additional configuration



89
90
91
92
93
94
95
96
97
# File 'lib/chemlab/configuration.rb', line 89

def configure_rspec
  RSpec.configure do |rspec|
    yield rspec if block_given?

    rspec.after(:each) do
      Chemlab.configuration.browser&.session&.engine&.quit
    end
  end
end