hold_firefox 0.1.2 → 0.1.3
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 +4 -4
- data/ext/hold_firefox/extconf.rb +1 -2
- data/lib/hold_firefox/version.rb +1 -1
- data/lib/hold_firefox.rb +20 -20
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e25be26e1d8971d6b71ffcdb9100fcaf8c5bd84
|
4
|
+
data.tar.gz: 5343ca5e58ecf12c2ec52d53ad1242d8f370c544
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8791dce8a396a5e340a8fab6146e0a90307d7bc0b0d883683884daf1c54442e72930c8ddebffd64b71611b655ff99f30a128ffe786b4c887966946afbad41f27
|
7
|
+
data.tar.gz: 2c4ed7dfe9f8228b826f37f64acdf59a84027783f6ce78cb891c5eade25ec15021ad7ccb183281cd64e4462e90a38f36efee976963ea51bb8aa96d5ec0b3e0da
|
data/ext/hold_firefox/extconf.rb
CHANGED
@@ -14,12 +14,11 @@ Dir.chdir(File.join(root)) do
|
|
14
14
|
system "rm firefox-45.0.tar.bz2"
|
15
15
|
elsif RUBY_PLATFORM =~ /darwin/i
|
16
16
|
unless File.exist?('/tmp/Firefox_45.0.dmg')
|
17
|
-
system "
|
17
|
+
system "curl -o /tmp/Firefox_45.0.dmg 'https://ftp.mozilla.org/pub/firefox/releases/45.0/mac/pt-BR/Firefox%2045.0.dmg'"
|
18
18
|
end
|
19
19
|
mount_path = `hdiutil attach -nobrowse -noautoopen /tmp/Firefox_45.0.dmg | grep Firefox`.split(' ').first
|
20
20
|
system "cp -R /Volumes/Firefox/Firefox.app . "
|
21
21
|
system "hdiutil detach #{mount_path}"
|
22
|
-
#Selenium::WebDriver::Firefox::Binary.path = "/Users/andreleoni/Documents/Firefox.app/Contents/MacOS/firefox-bin"
|
23
22
|
end
|
24
23
|
end
|
25
24
|
|
data/lib/hold_firefox/version.rb
CHANGED
data/lib/hold_firefox.rb
CHANGED
@@ -2,30 +2,30 @@ require "hold_firefox/version"
|
|
2
2
|
require 'pathname'
|
3
3
|
|
4
4
|
module HoldFirefox
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
class Path
|
6
|
+
def initialize(platform)
|
7
|
+
@platform = platform
|
8
|
+
return unless allowed?
|
9
|
+
Selenium::WebDriver::Firefox::Binary.path = firefox_path
|
10
|
+
end
|
9
11
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
# Folder path
|
13
|
+
def home
|
14
|
+
Pathname.new(File.dirname(__FILE__)).join('..', 'ext', 'hold_firefox')
|
15
|
+
end
|
14
16
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
17
|
+
def firefox_path
|
18
|
+
if @platform =~ /linux/i
|
19
|
+
home.join('firefox', 'firefox-bin').to_s
|
20
|
+
elsif @platform =~ /darwin/i
|
21
|
+
home.join('Firefox.app', 'Contents', 'MacOS', 'firefox-bin').to_s
|
22
|
+
end
|
23
|
+
end
|
19
24
|
|
20
|
-
|
21
|
-
|
22
|
-
self.linux
|
23
|
-
elsif RUBY_PLATFORM =~ /darwin/i
|
24
|
-
self.osx
|
25
|
-
else
|
26
|
-
Selenium::WebDriver::Firefox::Binary.path
|
25
|
+
def allowed?
|
26
|
+
@platform =~ /linux/i || @platform =~ /darwin/i
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
HoldFirefox.
|
31
|
+
HoldFirefox::Path.new(RUBY_PLATFORM)
|