Class: Chemlab::Configuration
- Inherits:
-
Object
- Object
- Chemlab::Configuration
- Includes:
- Runtime::Logger
- Defined in:
- lib/chemlab/configuration.rb
Overview
Chemlab Configuration
Constant Summary collapse
- BANNER =
Chemlab Terminal Banner
<<~'BANNER' ## ## #### #### ###### ###### ####### ####### ######## ######### ########## ######### ########## ########### ############ ############ ##########/------------------------------------------\######### ##########/ / ___| |__ ___ _ __ ___ | | __ _| |__ \######### #########| | | | '_ \ / _ \ '_ ` _ \| |/ _` | '_ \ |######## ##########| | |___| | | | __/ | | | | | | (_| | |_) | |######### ###########\ \____|_| |_|\___|_| |_| |_|_|\__,_|_.__/ /########### #############\------------------------------------------/############# \*********************############################********************/ \\\********************##########################********************/// \\\\\\******************#########################*******************////// \\\\\\\\******************########################******************//////// \\\\\\\\\\*****************######################*****************////////// \\\\\\\\\\\\****************#####################****************///////////// \\\\\\\\\\\\\\\***************####################***************/////////////// \\\\\\\\\\\\\\\\***************##################**************///////////////// \\\\\\\\\\\\\\\\\*************#################**************///////////////// \\\\\\\\\\\\\\\*************################************//////////////// \\\\\\\\\\\\\\************##############************////////////// \\\\\\\\\\\\\\**********#############***********///////////// \\\\\\\\\\\\**********############**********//////////// \\\\\\\\\\\********###########*********/////////// \\\\\\\\\********#########********////////// \\\\\\\\\*******########*******//////// \\\\\\\*******######******//////// \\\\\\*****######*****////// \\\\\****####****///// \\\\***###***//// \\\**##**/// \****/ ** BANNER
Instance Attribute Summary collapse
-
#browser ⇒ Object
Returns the value of attribute browser.
-
#libraries ⇒ Object
Returns the value of attribute libraries.
Class Method Summary collapse
-
.add_config(name) ⇒ Object
Add a chemlab configuration.
Instance Method Summary collapse
-
#configure_rspec ⇒ Object
Call RSpec.configure for additional configuration.
-
#initialize {|_self| ... } ⇒ Configuration
constructor
A new instance of Configuration.
Methods included from Runtime::Logger
Constructor Details
#initialize {|_self| ... } ⇒ Configuration
Returns a new instance of Configuration.
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/chemlab/configuration.rb', line 50 def initialize yield self if block_given? log(BANNER, :begn) unless log(<<-CONF, :conf) ==> Base URL: #{base_url} ==> Browser: #{browser} ==> Libraries: #{libraries} CONF end |
Instance Attribute Details
#browser ⇒ Object
Returns the value of attribute browser.
70 71 72 |
# File 'lib/chemlab/configuration.rb', line 70 def browser @browser end |
#libraries ⇒ Object
Returns the value of attribute libraries.
70 71 72 |
# File 'lib/chemlab/configuration.rb', line 70 def libraries @libraries end |
Class Method Details
.add_config(name) ⇒ Object
Add a chemlab configuration
63 64 65 |
# File 'lib/chemlab/configuration.rb', line 63 def self.add_config(name) attr_accessor name end |
Instance Method Details
#configure_rspec ⇒ Object
Call RSpec.configure for additional configuration
87 88 89 90 91 92 93 94 95 |
# File 'lib/chemlab/configuration.rb', line 87 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 |