spy-satelite 0.0.1 → 0.0.2
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.
- data/README.rdoc +5 -5
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/spy-satelite.rb +6 -6
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
= spy-satelite
|
2
2
|
|
3
|
-
Usage
|
4
|
-
=====
|
3
|
+
= Usage
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
|
6
|
+
= Rails
|
7
|
+
|
8
|
+
config.middleware.use Rack::SpySatelite, {:id => '1', :key => '1234abcd, :secret => '1234abcd'}
|
9
9
|
|
10
10
|
== Note on Patches/Pull Requests
|
11
11
|
|
data/Rakefile
CHANGED
@@ -12,7 +12,7 @@ begin
|
|
12
12
|
gem.authors = ["Wildfalcon"]
|
13
13
|
gem.add_development_dependency "rspec", ">= 1.2.9"
|
14
14
|
gem.add_development_dependency "cucumber", ">= 0"
|
15
|
-
gem.
|
15
|
+
gem.add_dependency "pusher", ">= 0.4.2"
|
16
16
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
17
17
|
end
|
18
18
|
Jeweler::GemcutterTasks.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/lib/spy-satelite.rb
CHANGED
@@ -3,19 +3,19 @@ require 'pusher'
|
|
3
3
|
module Rack
|
4
4
|
class SpySatelite
|
5
5
|
def initialize(app, args)
|
6
|
-
|
7
|
-
puts args.inspect
|
8
|
-
|
6
|
+
|
9
7
|
Pusher.app_id = args[:id]
|
10
8
|
Pusher.key = args[:key]
|
11
9
|
Pusher.secret = args[:secret]
|
12
|
-
|
10
|
+
|
11
|
+
@cities = [[57.0, -2.0], [-34.0, 138.0], [36.0, 3.0], [52.0, 4.0], [39.0, 32.0], [-25.0, -57.0], [37.0, 23.0], [-36.0, 174.0], [13.0, 100.0], [41.0, 2.0], [39.0, 116.0], [-1.0, -48.0], [54.0, -5.0], [44.0, 20.0], [52.0, 13.0], [52.0, -1.0], [4.0, -74.0], [19.0, 72.0], [44.0, -0.0], [53.0, 8.0], [-27.0, 153.0], [51.0, -2.0], [50.0, 4.0], [44.0, 26.0], [47.0, 19.0], [-34.0, -58.0], [30.0, 31.0], [22.0, 88.0], [23.0, 113.0], [-33.0, 18.0], [10.0, -67.0], [4.0, -52.0], [28.0, -106.0], [29.0, 106.0], [55.0, 12.0], [-31.0, -64.0], [14.0, -17.0], [-12.0, 130.0], [11.0, 43.0], [53.0, -6.0], [-29.0, 30.0], [55.0, -3.0], [50.0, 8.0], [6.0, -58.0], [55.0, -4.0], [14.0, -90.0], [-2.0, -79.0], [53.0, 10.0], [70.0, 23.0], [23.0, -82.0], [60.0, 25.0], [-42.0, 147.0], [22.0, 114.0], [-20.0, -70.0], [52.0, 104.0], [-6.0, 106.0], [-26.0, 28.0], [17.0, -76.0], [-4.0, 15.0], [3.0, 101.0], [-16.0, -68.0], [53.0, -1.0], [-12.0, -77.0], [38.0, -9.0], [53.0, -3.0], [51.0, -0.0], [45.0, 4.0], [40.0, -3.0], [53.0, -2.0], [14.0, 120.0], [43.0, 5.0], [23.0, -106.0], [21.0, 39.0], [-37.0, 144.0], [19.0, -99.0], [45.0, 9.0], [-34.0, -56.0], [55.0, 37.0], [48.0, 11.0], [32.0, 129.0], [35.0, 136.0], [-1.0, 36.0], [32.0, 118.0], [40.0, 14.0], [28.0, 77.0], [54.0, -1.0], [46.0, 30.0], [34.0, 135.0], [59.0, 10.0], [8.0, -79.0], [5.0, -55.0], [48.0, 2.0], [-31.0, 115.0], [50.0, -4.0], [-9.0, 147.0], [50.0, 14.0], [16.0, 96.0], [64.0, -21.0], [-22.0, -43.0], [41.0, 12.0], [-12.0, -38.0], [-33.0, -70.0], [59.0, 30.0], [-23.0, -46.0], [31.0, 121.0], [1.0, 103.0], [42.0, 23.0], [59.0, 18.0], [-34.0, 151.0], [-18.0, 47.0], [35.0, 51.0], [35.0, 139.0], [32.0, 13.0], [45.0, 12.0], [19.0, -96.0], [48.0, 16.0], [43.0, 132.0], [52.0, 21.0], [-41.0, 174.0], [47.0, 8.0]]
|
13
12
|
@app = app
|
14
13
|
end
|
15
14
|
|
16
15
|
def call(env)
|
17
|
-
|
18
|
-
|
16
|
+
city = @cities[rand(@cities.length)]
|
17
|
+
lat = city.first
|
18
|
+
long = city.last
|
19
19
|
Pusher['visitors'].trigger('new-visit', {:lat => lat, :long => long})
|
20
20
|
@app.call(env)
|
21
21
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 2
|
9
|
+
version: 0.0.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Wildfalcon
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-05-
|
17
|
+
date: 2010-05-09 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -55,7 +55,7 @@ dependencies:
|
|
55
55
|
- 4
|
56
56
|
- 2
|
57
57
|
version: 0.4.2
|
58
|
-
type: :
|
58
|
+
type: :runtime
|
59
59
|
version_requirements: *id003
|
60
60
|
description: A rack middlewear that watches incoming requests and pushes data (via pusher) so that they can be graphed on a moving globe
|
61
61
|
email: laurie@wildfalcon.com
|