wifi_login 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -2
- data/lib/wifi_login.rb +15 -1
- data/lib/wifi_login/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
data/lib/wifi_login.rb
CHANGED
@@ -17,8 +17,18 @@ module WifiLogin
|
|
17
17
|
|
18
18
|
def self.login
|
19
19
|
ssid = self.ssid
|
20
|
+
puts "detected SSID: #{ssid}"
|
21
|
+
provider = provider(ssid)
|
20
22
|
id, password = credential(ssid)
|
21
|
-
|
23
|
+
begin
|
24
|
+
provider(ssid).login(id, password)
|
25
|
+
rescue SocketError => e
|
26
|
+
puts e.message
|
27
|
+
retry_count ||= 0
|
28
|
+
raise if (retry_count += 1) > 6
|
29
|
+
sleep 10
|
30
|
+
retry
|
31
|
+
end
|
22
32
|
end
|
23
33
|
|
24
34
|
def self.provider(ssid)
|
@@ -53,5 +63,9 @@ module WifiLogin
|
|
53
63
|
end
|
54
64
|
ssid_line.chomp.split(': ')[1]
|
55
65
|
end
|
66
|
+
|
67
|
+
def self.in_rbenv?
|
68
|
+
ENV.has_key?('RBENV_ROOT')
|
69
|
+
end
|
56
70
|
end
|
57
71
|
|
data/lib/wifi_login/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wifi_login
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mechanize
|