Class: Browserly::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/browserly/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
29
30
31
# File 'lib/browserly/configuration.rb', line 10

def initialize
  @output_dir = File.join(Dir.tmpdir, 'siter_screenshots')

  unless File.directory?(@output_dir)
    FileUtils.mkdir_p(@output_dir)
  end

  @width = 1280
  @height = 780
  @remote_driver = true
  @remote_driver_url = "http://localhost:4444/wd/hub"
  @chrome_args = [
    '--headless',
    '--hide-scrollbars',
    '--ignore-certificate-errors',
    '--disable-popup-blocking',
    '--disable-translate',
    "--window-size=#{@width},#{@height}",
    '--enable-font-antialiasing',
    '--font-cache-shared-handle[6]'
  ]
end

Instance Attribute Details

#chrome_argsObject

Returns the value of attribute chrome_args.



3
4
5
# File 'lib/browserly/configuration.rb', line 3

def chrome_args
  @chrome_args
end

#heightObject

Returns the value of attribute height.



3
4
5
# File 'lib/browserly/configuration.rb', line 3

def height
  @height
end

#output_dirObject

Returns the value of attribute output_dir.



3
4
5
# File 'lib/browserly/configuration.rb', line 3

def output_dir
  @output_dir
end

#remote_driverObject

Returns the value of attribute remote_driver.



3
4
5
# File 'lib/browserly/configuration.rb', line 3

def remote_driver
  @remote_driver
end

#remote_driver_urlObject

Returns the value of attribute remote_driver_url.



3
4
5
# File 'lib/browserly/configuration.rb', line 3

def remote_driver_url
  @remote_driver_url
end

#widthObject

Returns the value of attribute width.



3
4
5
# File 'lib/browserly/configuration.rb', line 3

def width
  @width
end