slack_mb_roamer 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/slack_mb_roamer.rb +11 -3
- data/lib/slack_mb_roamer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e60d40b3ba0a1e66137a12aa34e76ec0b759b8b341e3565de02779cc95fccc97
|
4
|
+
data.tar.gz: 43fa53d824319bd98201de323d8159e77d912fa0cc047f413ef11081e2aedbf2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0331767f0abfb5ef53c594744f66fb83c667cd58f2a8eaad3139cfd313562ed2c3d4973b67c54a75b401c9c77c225a04666f562da4c40b0790481a1844508452
|
7
|
+
data.tar.gz: 62103265d0114bd90627fa3999846cf16649ec7895660e04bbd025b088c07412f67323067f98f6a1e0d8b3dfbb898968c108a2b09833d193971331a7116566a9
|
data/Gemfile.lock
CHANGED
data/lib/slack_mb_roamer.rb
CHANGED
@@ -3,13 +3,16 @@ require "yaml"
|
|
3
3
|
require "slack_ruby_client"
|
4
4
|
|
5
5
|
module SlackMbRoamer
|
6
|
+
include Methadone::CLILogging
|
7
|
+
|
6
8
|
class Error < StandardError; end
|
7
9
|
|
8
10
|
AIRPORT_COMMAND = "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I"
|
9
11
|
# Your code goes here...
|
10
12
|
|
13
|
+
info("starting slack_mb_roamer")
|
11
14
|
stdout, stderr, status = Open3.capture3(AIRPORT_COMMAND)
|
12
|
-
|
15
|
+
info("status: #{status}")
|
13
16
|
unless "0" == status.to_s.split(" ").last
|
14
17
|
puts "exit status #{status}"
|
15
18
|
raise stderr
|
@@ -18,6 +21,7 @@ module SlackMbRoamer
|
|
18
21
|
if SSID_line.nil? or SSID_line.empty?
|
19
22
|
raise "no SSID found"
|
20
23
|
end
|
24
|
+
info("SSID is #{SSID_line}")
|
21
25
|
#
|
22
26
|
# Probably some maniac somewhere has colons in their SSID name.
|
23
27
|
#
|
@@ -50,10 +54,14 @@ module SlackMbRoamer
|
|
50
54
|
client.auth_test
|
51
55
|
profile = client.users_profile_get.profile
|
52
56
|
if prefs["post"]
|
53
|
-
client.chat_postMessage(channel: prefs["channel"], text: "@#{profile.real_name} is #{location}")
|
57
|
+
result = client.chat_postMessage(channel: prefs["channel"], text: "@#{profile.real_name} is #{location}")
|
58
|
+
info("postMessage")
|
59
|
+
info(result.inspect)
|
54
60
|
end
|
55
61
|
if prefs["status"]
|
56
|
-
client.users_profile_set(profile: { status_text: "currently #{location}", status_emoji: emoji }.to_json)
|
62
|
+
result = client.users_profile_set(profile: { status_text: "currently #{location}", status_emoji: emoji }.to_json)
|
63
|
+
info("users_profile_set")
|
64
|
+
info(result.inspect)
|
57
65
|
end
|
58
66
|
else
|
59
67
|
puts "empty location, not posting to slack."
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slack_mb_roamer
|
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
|
- Corprew Reed
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|