silkscreen 0.1.1 → 0.1.2
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.
- data/bin/silkscreen +14 -12
- data/lib/silkscreen/version.rb +1 -1
- metadata +1 -1
data/bin/silkscreen
CHANGED
@@ -17,21 +17,23 @@ module Silkscreen
|
|
17
17
|
method_option :full, aliases: '-f', type: :boolean, default: false, desc: 'Capture full page or just the visible area'
|
18
18
|
method_option :output, aliases: '-o', type: :string, desc: 'Save the captured screenshot as a file at this path'
|
19
19
|
def capture(url)
|
20
|
-
headless = Headless.new
|
21
|
-
headless.start
|
20
|
+
# headless = Headless.new
|
21
|
+
# headless.start
|
22
|
+
Headless.ly do
|
23
|
+
driver = Selenium::WebDriver.for :chrome
|
22
24
|
|
23
|
-
|
25
|
+
img = Silkscreen.get_screenshot url, options, driver
|
26
|
+
|
27
|
+
driver.quit
|
28
|
+
|
24
29
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
if options[:output]
|
31
|
-
create_file options[:output], img
|
32
|
-
else
|
33
|
-
print img
|
30
|
+
if options[:output]
|
31
|
+
create_file options[:output], img
|
32
|
+
else
|
33
|
+
print img
|
34
|
+
end
|
34
35
|
end
|
36
|
+
#headless.destroy
|
35
37
|
end
|
36
38
|
end
|
37
39
|
end
|
data/lib/silkscreen/version.rb
CHANGED