browserly 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a8d15b23d265199e1b11d6cb144ca1493255a8beaa7f28207534c9c3c93f277
4
- data.tar.gz: 24a4800b88f94c1fca2ca42145457fb2cdd730bf3e396d441e2eb5a81617c3ce
3
+ metadata.gz: f53fa92854c720723ff9cffdbb2e082b0119319b0e1be774d7c1fb8935c48d5c
4
+ data.tar.gz: 5b7e46847076cde7def8f31aebd8088e9d1eb372d855b0e40876fe3d947e35b8
5
5
  SHA512:
6
- metadata.gz: 4dcce2144fdd52a4347a13557e16380c4289329e7ccc9c2178b797374afd6928b2997d98008f1ade04c31d2f60cd82bd47a570908d3ae3b40bf1bbbac4cfe294
7
- data.tar.gz: 771b69fbff3bc8b9f33ed134b4436685dda56e8e15b3a013b082205b6fec5480a610fa16a12411ba45d62da1d5a8d4293bcbcd9cadaf2f0849ea5c27303b4886
6
+ metadata.gz: 312c8944b2adaf49f4e957c19037a088d664a6d57fce281447bf9be861e781940a0d88d01c8958616bb11c7d3a468107fcb843874dd3748f5d000c3b42172498
7
+ data.tar.gz: ba7099286f393e71685fd43112c8df6a9508a6ace23098d84fa254cc2750a288c062c3407c00f73027f238d924318e2ac0179a088a7193578a6b81fc0e9f52b8
data/README.md CHANGED
@@ -1,8 +1,5 @@
1
1
  # Browserly
2
- Short description and motivation.
3
-
4
- ## Usage
5
- How to use my plugin.
2
+ Is a simple tool that helps to create website screenshots using selenium + chrome driver. This gem creates pool of browsers thus increases speed of taking webpage screenshot.
6
3
 
7
4
  ## Installation
8
5
  Add this line to your application's Gemfile:
@@ -21,6 +18,22 @@ Or install it yourself as:
21
18
  $ gem install browserly
22
19
  ```
23
20
 
21
+ ## Configuration
22
+
23
+ ```ruby
24
+ Browserly.configure do |config|
25
+ config.tmp_path = 'path/to/store/screenshots'
26
+ config.pool_size = 1 # count of browsers instance to start
27
+ end
28
+ ```
29
+
30
+ ## Usage
31
+
32
+ ```ruby
33
+ screenshot = Browserly::Screenshot.new('http://example.com').perform
34
+ screenshot.file #=> screenshot image file
35
+ ```
36
+
24
37
  ## Contributing
25
38
  Contribution directions go here.
26
39
 
@@ -6,8 +6,8 @@ module Browserly
6
6
  attr_reader :browsers
7
7
 
8
8
  def initialize
9
- @browsers = SizedQueue.new(pool_size)
10
- pool_size.times { @browsers.push(new_browser) }
9
+ @browsers = SizedQueue.new(Browserly.configuration.pool_size)
10
+ Browserly.configuration.pool_size.times { @browsers.push(new_browser) }
11
11
  end
12
12
 
13
13
  def take_browser
@@ -24,10 +24,6 @@ module Browserly
24
24
 
25
25
  private
26
26
 
27
- def pool_size
28
- ENV.fetch('BROWSER_POOL_SIZE') { 1 }.to_i
29
- end
30
-
31
27
  def new_browser
32
28
  options = Selenium::WebDriver::Chrome::Options.new(
33
29
  args: [
@@ -1,3 +1,3 @@
1
1
  module Browserly
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: browserly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Selivanov