hold_firefox 0.1.0 → 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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +2 -0
- data/ext/hold_firefox/extconf.rb +15 -6
- data/lib/hold_firefox/version.rb +1 -1
- data/lib/hold_firefox.rb +25 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a5e255c765d9e7bc4a0b0df91941980adfb8328
|
4
|
+
data.tar.gz: 4b2f4e8fa8786f499a4973a59cd7a476130eec73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1681a170835120f3acc4a3fe9323a4316b7cad3dcaf3e967d31efd5ef08cb08d28ca18f92273e61abfa0b4ec7008c34c3e70076f64c80ff825994cba5f5c0077
|
7
|
+
data.tar.gz: d30119e8bf33b4b11d31a52c3201fbb6dd6af3639e8035f2c2b4617a4f0480700705e9a5c6f6b87b0cf2ba399975fb6cf3f539f77beb4c45c41e6c0ecaa64b11
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -20,6 +20,8 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
$ gem install hold_firefox
|
22
22
|
|
23
|
+
Tested on Ubuntu, MacOSX.
|
24
|
+
|
23
25
|
## Development
|
24
26
|
|
25
27
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/ext/hold_firefox/extconf.rb
CHANGED
@@ -4,13 +4,22 @@ create_makefile 'hold_firefox'
|
|
4
4
|
exit if RUBY_PLATFORM =~ /mswin/i || RUBY_PLATFORM =~ /win32/i || RUBY_PLATFORM =~ /mingw/
|
5
5
|
|
6
6
|
root = File.expand_path('..', __FILE__)
|
7
|
-
|
8
7
|
Dir.chdir(File.join(root)) do
|
9
|
-
|
10
|
-
|
8
|
+
if RUBY_PLATFORM =~ /linux/i
|
9
|
+
unless File.exist?('/tmp/firefox-45.0.tar.bz2')
|
10
|
+
system "wget https://ftp.mozilla.org/pub/firefox/releases/45.0/linux-x86_64/pt-BR/firefox-45.0.tar.bz2 -O /tmp/firefox-45.0.tar.bz2"
|
11
|
+
end
|
12
|
+
system "cp /tmp/firefox-45.0.tar.bz2 firefox-45.0.tar.bz2"
|
13
|
+
system "tar -jxvf firefox-45.0.tar.bz2"
|
14
|
+
system "rm firefox-45.0.tar.bz2"
|
15
|
+
elsif RUBY_PLATFORM =~ /darwin/i
|
16
|
+
unless File.exist?('/tmp/Firefox_45.0.dmg')
|
17
|
+
system "wget https://ftp.mozilla.org/pub/firefox/releases/45.0/mac/pt-BR/Firefox%2045.0.dmg -O /tmp/Firefox_45.0.dmg"
|
18
|
+
end
|
19
|
+
mount_path = `hdiutil attach -nobrowse -noautoopen /tmp/Firefox_45.0.dmg | grep Firefox`.split(' ').first
|
20
|
+
system "cp -R /Volumes/Firefox/Firefox.app . "
|
21
|
+
system "hdiutil detach #{mount_path}"
|
22
|
+
#Selenium::WebDriver::Firefox::Binary.path = "/Users/andreleoni/Documents/Firefox.app/Contents/MacOS/firefox-bin"
|
11
23
|
end
|
12
|
-
system "cp /tmp/firefox-45.0.tar.bz2 firefox-45.0.tar.bz2"
|
13
|
-
system "tar -jxvf firefox-45.0.tar.bz2"
|
14
|
-
system "rm firefox-45.0.tar.bz2"
|
15
24
|
end
|
16
25
|
|
data/lib/hold_firefox/version.rb
CHANGED
data/lib/hold_firefox.rb
CHANGED
@@ -2,9 +2,30 @@ require "hold_firefox/version"
|
|
2
2
|
require 'pathname'
|
3
3
|
|
4
4
|
module HoldFirefox
|
5
|
-
#
|
6
|
-
|
5
|
+
# Folder path
|
6
|
+
def self.gem_path
|
7
|
+
Pathname.new(File.dirname(__FILE__)).join('..', 'ext', 'hold_firefox')
|
8
|
+
end
|
9
|
+
|
10
|
+
# Path to Ubuntu
|
11
|
+
def self.linux
|
12
|
+
self.gem_path.join('firefox', 'firefox-bin').to_s
|
13
|
+
end
|
7
14
|
|
8
|
-
|
9
|
-
|
15
|
+
# Path to MacOSX
|
16
|
+
def self.osx
|
17
|
+
self.gem_path.join('Firefox.app', 'Contents', 'MacOS', 'firefox-bin').to_s
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.setup!
|
21
|
+
Selenium::WebDriver::Firefox::Binary.path = if RUBY_PLATFORM =~ /linux/i
|
22
|
+
self.linux
|
23
|
+
elsif RUBY_PLATFORM =~ /darwin/i
|
24
|
+
self.osx
|
25
|
+
else
|
26
|
+
Selenium::WebDriver::Firefox::Binary.path
|
27
|
+
end
|
28
|
+
end
|
10
29
|
end
|
30
|
+
|
31
|
+
HoldFirefox.setup!
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hold_firefox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danilo Jeremias da Silva
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|