Module: Webshot
- Defined in:
- lib/webshot.rb,
lib/webshot/errors.rb,
lib/webshot/version.rb,
lib/webshot/screenshot.rb
Defined Under Namespace
Classes: Screenshot, WebshotError
Constant Summary collapse
- VERSION =
'0.0.11'
- @@width =
1024
- @@height =
768
- @@user_agent =
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31"
Class Method Summary collapse
-
.capybara_setup! ⇒ Object
Capibara setup.
-
.setup {|_self| ... } ⇒ Object
Customize settings.
Instance Method Summary collapse
-
#width ⇒ Object
Browser settings Width.
Class Method Details
.capybara_setup! ⇒ Object
Capibara setup
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/webshot.rb', line 31 def self. # By default Capybara will try to boot a rack application # automatically. You might want to switch off Capybara's # rack server if you are running against a remote application .run_server = false .register_driver :poltergeist do |app| ::Poltergeist::Driver.new(app, { # Raise JavaScript errors to Ruby js_errors: false, # Additional command line options for PhantomJS phantomjs_options: ['--ignore-ssl-errors=yes', '--ssl-protocol=any'] }) end .current_driver = :poltergeist end |
.setup {|_self| ... } ⇒ Object
Customize settings
26 27 28 |
# File 'lib/webshot.rb', line 26 def self.setup yield self end |
Instance Method Details
#width ⇒ Object
Browser settings Width
14 |
# File 'lib/webshot.rb', line 14 mattr_accessor :width |