titech-pubnet-auth 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -0
- data/bin/titech-pubnet-auth +3 -6
- data/lib/titech_pubnet_auth/extension.rb +1 -0
- data/lib/titech_pubnet_auth/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
data/bin/titech-pubnet-auth
CHANGED
@@ -8,6 +8,8 @@ require 'titech_pubnet_auth'
|
|
8
8
|
require 'optparse'
|
9
9
|
require 'terminal-notifier' if OS_X
|
10
10
|
|
11
|
+
notifier = ->{TerminalNotifier.notify(nil,:title => 'Titech Punet Auth',:subtitle => 'Connected!') if OS_X}
|
12
|
+
|
11
13
|
opt = OptionParser.new
|
12
14
|
|
13
15
|
interval = TitechPubnetAuth::INTERVAL
|
@@ -58,14 +60,9 @@ end
|
|
58
60
|
pubnet_auth = TitechPubnetAuth.new
|
59
61
|
loop do
|
60
62
|
begin
|
61
|
-
mputs_with_notify = ->(auth,is_success){
|
62
|
-
mputs auth, is_success
|
63
|
-
TerminalNotifier.notify(nil,:title => 'Titech Punet Auth',:subtitle => 'Connected!') if OS_X and is_success
|
64
|
-
}
|
65
|
-
|
66
63
|
mputs 'network_available?', pubnet_auth.network_available?
|
67
64
|
mputs 'is_connected?', pubnet_auth.is_connected? if pubnet_auth.network_available?
|
68
|
-
|
65
|
+
mputs 'auth', pubnet_auth.auth and notifier.call if pubnet_auth.network_available? and not pubnet_auth.is_connected?
|
69
66
|
rescue => e
|
70
67
|
p e
|
71
68
|
ensure
|