Class: Browsate::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/browsate/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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
# File 'lib/browsate/configuration.rb', line 10

def initialize
  @chrome_path = ENV["CHROME_PATH"] || default_chrome_path
  @chrome_args = [
    "--no-sandbox",
    "--disable-setuid-sandbox",
    "--disable-dev-shm-usage",
    "--disable-accelerated-2d-canvas",
    "--disable-gpu",
    "--window-size=1280,800"
  ]
  @user_agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36"
  @viewport_width = 1280
  @viewport_height = 800
  @session_dir = File.join(Dir.pwd, "tmp")
  @debug = false
  @timeout = 30
  @logger = Logger.new($stdout)
  @logger.level = Logger::INFO
end

Instance Attribute Details

#chrome_argsObject

Returns the value of attribute chrome_args.



7
8
9
# File 'lib/browsate/configuration.rb', line 7

def chrome_args
  @chrome_args
end

#chrome_pathObject

Returns the value of attribute chrome_path.



7
8
9
# File 'lib/browsate/configuration.rb', line 7

def chrome_path
  @chrome_path
end

#debugObject

Returns the value of attribute debug.



7
8
9
# File 'lib/browsate/configuration.rb', line 7

def debug
  @debug
end

#loggerObject

Returns the value of attribute logger.



7
8
9
# File 'lib/browsate/configuration.rb', line 7

def logger
  @logger
end

#session_dirObject

Returns the value of attribute session_dir.



7
8
9
# File 'lib/browsate/configuration.rb', line 7

def session_dir
  @session_dir
end

#timeoutObject

Returns the value of attribute timeout.



7
8
9
# File 'lib/browsate/configuration.rb', line 7

def timeout
  @timeout
end

#user_agentObject

Returns the value of attribute user_agent.



7
8
9
# File 'lib/browsate/configuration.rb', line 7

def user_agent
  @user_agent
end

#viewport_heightObject

Returns the value of attribute viewport_height.



7
8
9
# File 'lib/browsate/configuration.rb', line 7

def viewport_height
  @viewport_height
end

#viewport_widthObject

Returns the value of attribute viewport_width.



7
8
9
# File 'lib/browsate/configuration.rb', line 7

def viewport_width
  @viewport_width
end