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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f1cd073f8eefe747300d00c7a936059d3aa139a5a3d67669e2f45c04c94f3b3b
4
- data.tar.gz: c45615ff6e501c680d7f536894a007c711fced0e84796acd8625f5beeec823d9
3
+ metadata.gz: bfb22aaa5b01f2561c6b1a2f7c8d4bafeca2406ba495095e2663e765ff4401bf
4
+ data.tar.gz: 2c9f199f5e30206d1992d7d2fe3f20dc6c34b0896445f69b44ec513e7773dbc8
5
5
  SHA512:
6
- metadata.gz: daffdbc9604a1a7f82080bf7dd1d13307985e7fecf98c4f776c0a69883ef3a53afe1555e0ebd609856c3d4e570c0869a598881e9187b74a53c69bdb1df51eecf
7
- data.tar.gz: e35387cbea9604ab45548946820091daf0d2f28db2aca557f442878a1f0c5fe4288891d160a64833461ee17727fd58e498957c144821d1cc0caaf9798ddfc86e
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 = Dir.pwd
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
@@ -1,3 +1,3 @@
1
1
  module WatchDoge
2
- Version = '0.1.1'
2
+ Version = '0.1.2'
3
3
  end
@@ -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
- # flag that cookie is loaded
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 _browser_config
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'watchdoge'
3
- s.version = '0.1.1'
3
+ s.version = '0.1.2'
4
4
  s.date = '2019-07-22'
5
5
  s.summary = "dogi"
6
6
  s.description = "A collection of web test tools"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watchdoge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shen Lee