pusher-whos-in 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +19 -13
- data/bin/local_scanner +4 -1
- data/lib/whos_in/version.rb +1 -1
- data/lib/whos_in.rb +6 -6
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62826dd9a4113f61f2ac6169252c73ea096ae87b
|
4
|
+
data.tar.gz: 608e00b8c95bb66b807bd826105e5ae98830838e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27e47f4c8e50de3425bb094106ca0cbaca97f89b8d38a5ecbb7d074415a765cfc5426313e20baf0ac97ce45b3d318bd10e8d44e2a0cf73c5f9e833aa37d2b767
|
7
|
+
data.tar.gz: a75645a64b47ad601e40e5ff2313fac6da64226c14b1e5ce507de4b648e932e400c99f85a007dbf7d54300826d95a14cbab389c130ea8277e0a963e1c683396f
|
data/README.md
CHANGED
@@ -1,30 +1,36 @@
|
|
1
|
-
#
|
1
|
+
# Who's In?
|
2
2
|
|
3
|
-
|
3
|
+
This gem allows you to deploy to Heroku an application that lets you keep track of people who come and go from the office in realtime.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
|
7
|
+
$ gem install pusher-whos-in
|
8
8
|
|
9
|
-
|
10
|
-
gem 'whos_in_gem'
|
11
|
-
```
|
9
|
+
## Usage
|
12
10
|
|
13
|
-
|
11
|
+
###Deployment
|
14
12
|
|
15
|
-
|
13
|
+
To deploy your own Who's In app, type into the command-line:
|
16
14
|
|
17
|
-
|
15
|
+
$ pusher-whos-in init
|
18
16
|
|
19
|
-
|
17
|
+
This will take you to the [deployment page for Who's In on Heroku](https://heroku.com/deploy?template=https://github.com/pusher/pusher-whos-in). Fill in the title of your app, and submit when ready. Heroku will provision you a Mongo database and a [Pusher add-on](https://addons.heroku.com/pusher).
|
20
18
|
|
21
|
-
|
19
|
+
View your app, and click the grey hexagon to add colleagues. You will need to enter their name, email and MAC address.
|
20
|
+
|
21
|
+
###Scanning Who's In
|
22
|
+
|
23
|
+
Who's In uses NMap to scan the local network to see who is in the office. If you haven't installed NMap already, you can do so [here](http://nmap.org/download.html).
|
24
|
+
|
25
|
+
When that's done, type the command:
|
26
|
+
|
27
|
+
$ pusher-whos-in run *your_app_name*
|
22
28
|
|
23
|
-
|
29
|
+
E.g. `pusher-whos-in run my_office_whos_in_app`. Then type your password. This script will run every two minutes and your Heroku application should show you who is in your office in realtime.
|
24
30
|
|
25
31
|
## Contributing
|
26
32
|
|
27
|
-
1. Fork it ( https://github.com/
|
33
|
+
1. Fork it ( https://github.com/pusher/pusher-whos-in-gem/fork )
|
28
34
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
35
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
36
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/bin/local_scanner
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
APP_USERNAME="foo"
|
4
4
|
APP_PASSWORD="bar"
|
5
5
|
WHOSIN_URL=$1
|
6
|
+
AUTH_KEY=$2
|
7
|
+
|
6
8
|
|
7
9
|
local_scan() {
|
8
10
|
macs=( $(sudo nmap -sn 192.168.1.0/24 | grep -Eio "([0-9A-F]{2}:){5}[0-9A-F]{2}") )
|
@@ -19,7 +21,8 @@ update_offline_since() {
|
|
19
21
|
json=$( IFS=, ; echo "${json[*]}")
|
20
22
|
json="[$json]"
|
21
23
|
|
22
|
-
|
24
|
+
|
25
|
+
curl -X POST -d "$json" $WHOSIN_URL -u admin:$AUTH_KEY >/dev/null 2>&1
|
23
26
|
|
24
27
|
}
|
25
28
|
|
data/lib/whos_in/version.rb
CHANGED
data/lib/whos_in.rb
CHANGED
@@ -6,7 +6,7 @@ module WhosIn
|
|
6
6
|
class Application
|
7
7
|
|
8
8
|
def launch_heroku_deploy
|
9
|
-
puts "Launching deployment setup... \n\n
|
9
|
+
puts "Launching deployment setup on Heroku... \n\n Input a name for your app (e.g. office_whos_in) then click the 'Deploy For Free' button. \n\nWhen you're done run 'pusher-whos-in run *your_app_name* "
|
10
10
|
sleep 2
|
11
11
|
`open https://heroku.com/deploy?template=https://github.com/pusher/pusher-whos-in`
|
12
12
|
end
|
@@ -17,10 +17,11 @@ module WhosIn
|
|
17
17
|
|
18
18
|
def self.tell_user_and_scan_network
|
19
19
|
script = File.expand_path('../../bin/local_scanner', __FILE__)
|
20
|
+
pusher_url = `heroku config:get PUSHER_URL -a #{@heroku_app}`
|
20
21
|
|
21
|
-
puts "Scanning local network and posting to #{@heroku_url}"
|
22
|
+
puts "Scanning local network every 2 minutes and posting to #{@heroku_url}"
|
22
23
|
puts "Press Ctrl+C to interrupt"
|
23
|
-
`#{script} #{@heroku_url}`
|
24
|
+
`#{script} #{@heroku_url} #{pusher_url}`
|
24
25
|
end
|
25
26
|
|
26
27
|
def self.run_script
|
@@ -40,9 +41,8 @@ module WhosIn
|
|
40
41
|
end
|
41
42
|
|
42
43
|
def self.run_app app_name
|
43
|
-
@heroku_app =
|
44
|
-
@heroku_url =
|
45
|
-
self.open_app
|
44
|
+
@heroku_app = app_name
|
45
|
+
@heroku_url = "http://#{app_name}.herokuapp.com/people"
|
46
46
|
self.run_script
|
47
47
|
end
|
48
48
|
|
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pusher-whos-in
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamie Patel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.7'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: commander
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 4.2.1
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 4.2.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rufus-scheduler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '3.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '3.0'
|
69
69
|
description: Sets up heroku deployment, config variables and the script that scans
|
@@ -76,7 +76,7 @@ executables:
|
|
76
76
|
extensions: []
|
77
77
|
extra_rdoc_files: []
|
78
78
|
files:
|
79
|
-
-
|
79
|
+
- .gitignore
|
80
80
|
- Gemfile
|
81
81
|
- LICENSE.txt
|
82
82
|
- README.md
|
@@ -97,12 +97,12 @@ require_paths:
|
|
97
97
|
- lib
|
98
98
|
required_ruby_version: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
|
-
- -
|
100
|
+
- - '>='
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0'
|
103
103
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
104
|
requirements:
|
105
|
-
- -
|
105
|
+
- - '>='
|
106
106
|
- !ruby/object:Gem::Version
|
107
107
|
version: '0'
|
108
108
|
requirements: []
|