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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d19f43a48b487a34c7e57216817f8027abbfac8b208236c4315f95e7dc931737
4
- data.tar.gz: e0a0597d1bf8884aa2b7c8b9d832dac9a1e46386129fea96c36ef98d19fb1e05
3
+ metadata.gz: e60d40b3ba0a1e66137a12aa34e76ec0b759b8b341e3565de02779cc95fccc97
4
+ data.tar.gz: 43fa53d824319bd98201de323d8159e77d912fa0cc047f413ef11081e2aedbf2
5
5
  SHA512:
6
- metadata.gz: 3ab76cf2ccd24b2e4ecee163c0feb84a0c36fdb8c25b1790d84f301e8d69934e1f32ce23ec728e8cc3368e1f02a264bf39e988c83d6f0120275382f08092b260
7
- data.tar.gz: a0c8657894d145a35ab7d60b36bfde98b98e46e4bb9cfde1efb250771dca8ac2d0e31b5798753ca718ec8fb8f711277f6385021d268bfb5159b27af42a8be784
6
+ metadata.gz: 0331767f0abfb5ef53c594744f66fb83c667cd58f2a8eaad3139cfd313562ed2c3d4973b67c54a75b401c9c77c225a04666f562da4c40b0790481a1844508452
7
+ data.tar.gz: 62103265d0114bd90627fa3999846cf16649ec7895660e04bbd025b088c07412f67323067f98f6a1e0d8b3dfbb898968c108a2b09833d193971331a7116566a9
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- slack_mb_roamer (0.1.0)
4
+ slack_mb_roamer (0.1.1)
5
5
  methadone (~> 2.0.2)
6
6
  slack-notifier
7
7
  slack-ruby-client
@@ -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."
@@ -1,3 +1,3 @@
1
1
  module SlackMbRoamer
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.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-29 00:00:00.000000000 Z
11
+ date: 2019-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler