watchdoge 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/watchdoge/configuration.rb +6 -1
- data/lib/watchdoge/version.rb +1 -1
- data/lib/watchdoge/worker.rb +6 -7
- data/lib/watchdoge.rb +7 -0
- data/watchdoge.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfb22aaa5b01f2561c6b1a2f7c8d4bafeca2406ba495095e2663e765ff4401bf
|
4
|
+
data.tar.gz: 2c9f199f5e30206d1992d7d2fe3f20dc6c34b0896445f69b44ec513e7773dbc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86ed4a98d6bec1d2758f20ebce4900bceef83771d7f2f146a79e608faf0f84a6d8f2e07910ae5f078ef7dee4ba7e4318f3ea344766bb647344880f90c1ae071f
|
7
|
+
data.tar.gz: c114278043ed264d582ad2c42b6c3b34e0095324ffc4449c61ed1bbcddd00c0ed88158900fea6a2b120a839de7a195abf741494d9af99731a05db6f82b6ddbd5
|
@@ -39,7 +39,12 @@ module WatchDoge
|
|
39
39
|
attr_accessor :firefox_version
|
40
40
|
|
41
41
|
def initialize
|
42
|
-
@base_dir =
|
42
|
+
@base_dir =
|
43
|
+
if defined? Rails
|
44
|
+
Rails.root.to_s
|
45
|
+
else
|
46
|
+
Dir.pwd
|
47
|
+
end
|
43
48
|
|
44
49
|
@web_drivers_dir = @base_dir + "/.webdrivers"
|
45
50
|
@engine = Watir::Browser
|
data/lib/watchdoge/version.rb
CHANGED
data/lib/watchdoge/worker.rb
CHANGED
@@ -10,23 +10,22 @@ module WatchDoge
|
|
10
10
|
height: 768,
|
11
11
|
headless: true,
|
12
12
|
http_client: @http
|
13
|
-
}.merge(opt)
|
14
|
-
|
15
|
-
default_opt.merge! _browser_config
|
13
|
+
}.merge(opt).merge(_browser_profile)
|
16
14
|
|
17
15
|
@core = WatchDoge.configuration.engine.new @browser, default_opt
|
18
16
|
|
19
17
|
# for generate uri hash
|
20
18
|
@landed_page = nil
|
21
19
|
|
22
|
-
#
|
20
|
+
# autosafe cookies while worker closed
|
23
21
|
@cookie_autosafe = false
|
22
|
+
|
23
|
+
# flag for cookies loaded
|
24
24
|
@cookie_loaded = false
|
25
25
|
|
26
|
+
# initilize width/height
|
26
27
|
@width = default_opt[:width]
|
27
28
|
@height = default_opt[:height]
|
28
|
-
|
29
|
-
# initilize width/height
|
30
29
|
@core.window.resize_to @width, @height
|
31
30
|
|
32
31
|
_after_initialize
|
@@ -90,7 +89,7 @@ module WatchDoge
|
|
90
89
|
@browser = WatchDoge.configuration.browser
|
91
90
|
end
|
92
91
|
|
93
|
-
def
|
92
|
+
def _browser_profile
|
94
93
|
case @browser
|
95
94
|
when :chrome
|
96
95
|
prefs = {}
|
data/lib/watchdoge.rb
CHANGED
@@ -29,6 +29,10 @@ module WatchDoge
|
|
29
29
|
@_configuration ||= Configuration.new
|
30
30
|
end
|
31
31
|
|
32
|
+
def supported_browsers
|
33
|
+
%i(firefox chrome)
|
34
|
+
end
|
35
|
+
|
32
36
|
def initialize!
|
33
37
|
path = ENV['WATCHDOGE_CONFIG'] ||
|
34
38
|
if defined?(Rails)
|
@@ -38,6 +42,9 @@ module WatchDoge
|
|
38
42
|
end
|
39
43
|
|
40
44
|
load path
|
45
|
+
supported_browsers.each do |browser|
|
46
|
+
WatchDoge::InstallManager.new browser
|
47
|
+
end
|
41
48
|
end
|
42
49
|
end
|
43
50
|
end
|
data/watchdoge.gemspec
CHANGED