Class: Shrimp::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/shrimp/configuration.rb', line 14

def initialize
  @default_options = {
      :format               => 'A4',
      :margin               => '1cm',
      :zoom                 => 1,
      :orientation          => 'portrait',
      :tmpdir               => Dir.tmpdir,
      :rendering_timeout    => 90000,
      :rendering_time       => 1000,
      :command_config_file  => File.expand_path('../config.json', __FILE__),
      :viewport_width       => 600,
      :viewport_height      => 600,
      :max_redirect_count   => 0
  }
end

Instance Attribute Details

#default_optionsObject

Returns the value of attribute default_options.



5
6
7
# File 'lib/shrimp/configuration.rb', line 5

def default_options
  @default_options
end

#phantomjsObject



30
31
32
# File 'lib/shrimp/configuration.rb', line 30

def phantomjs
  @phantomjs ||= (defined?(Bundler::GemfileError) ? `bundle exec which phantomjs` : `which phantomjs`).chomp
end