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 CHANGED
@@ -22,8 +22,8 @@ gem コマンドを用いてインストールできます。
22
22
  ```
23
23
  $ pit set docomo
24
24
  ---
25
- id: tx2ekeu7-spmode@docomo
26
- password: u563a8t6
25
+ id: your-id-spmode@docomo
26
+ password: your-password
27
27
  ```
28
28
 
29
29
  ## Usage
@@ -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
- provider(ssid).login(id, password)
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
 
@@ -1,3 +1,3 @@
1
1
  module WifiLogin
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
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.1
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-25 00:00:00.000000000 Z
12
+ date: 2012-09-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mechanize