motion-beacon 0.0.2 → 0.0.3
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 +36 -10
- data/lib/motion-beacon/version.rb +1 -1
- data/motion-beacon.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3c450e75109a63d7b2ec929c15ae0fb872d1f6c
|
4
|
+
data.tar.gz: 5cf95b83f4ede9267ab8d41e04021cad83ac5c8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47c8c238b1df7fd064b1204ff62433b8dda2a27ef330c74ccc908639e92ee6e9b27b53f12cc5019ffac4e37850de374f0d9f0d5e77fa45984f433da304ad3cc3
|
7
|
+
data.tar.gz: 8676cb93cda4a52164fbbedee3c8472598ef13e1d4bea016208962b94095d6e7fc830a0325fd975b893e86baf26dc475b756e0c024fb4b32a3cbf39be478566f
|
data/README.md
CHANGED
@@ -1,28 +1,54 @@
|
|
1
1
|
# MotionBeacon
|
2
2
|
|
3
|
+
iBeacon detection event system. Detect your beacons with ease!
|
3
4
|
|
4
|
-
##
|
5
|
+
## About
|
6
|
+
|
7
|
+
The goal of this project is to create a simple and powerful event-based detection system for iBeacons. MotionBeacon is build on top of CLLocationManager, CLBeaconRegion and CLBeacon. Events are inspired by sugarcube-events.
|
5
8
|
|
6
|
-
|
9
|
+
example:
|
7
10
|
|
8
|
-
|
11
|
+
```ruby
|
12
|
+
beaconManager.onEnterRegion { |region| my_code }
|
13
|
+
```
|
9
14
|
|
10
|
-
|
15
|
+
## Installation
|
11
16
|
|
12
|
-
|
17
|
+
gem install motion-beacon
|
13
18
|
|
14
|
-
|
19
|
+
# in Rakefile
|
20
|
+
require 'motion-beacon'
|
15
21
|
|
16
|
-
|
22
|
+
# in terminal
|
23
|
+
$ bundle install
|
17
24
|
|
18
25
|
## Usage
|
19
26
|
|
20
|
-
Inlcude MotionBeacon module in your app_delegate.rb:
|
21
27
|
|
22
|
-
|
28
|
+
```ruby
|
29
|
+
# create beacon manager
|
30
|
+
bm = BeaconManager.new('XXXXX-YYY-ZZZ-AAAA-BBBBBBBBB', 'com.company.iBeacons')
|
31
|
+
|
32
|
+
# initialize regions
|
33
|
+
bm.createRegion(major: 0, minor: 1)
|
34
|
+
|
35
|
+
# activate region detection
|
36
|
+
bm.startRangingBeacons(major: 0, minor: 1)
|
37
|
+
|
38
|
+
# entering region events
|
39
|
+
bm.onEnterRegion { |region| my_code }
|
40
|
+
bm.onEnterRegion(major: 1) { |region| my_code }
|
41
|
+
|
42
|
+
# leaving region events
|
43
|
+
bm.onLeaveRegion { |region| my_code }
|
44
|
+
bm.onLeaveRegion(major: 1, minor: 1) { |region| my_code }
|
23
45
|
|
24
|
-
|
46
|
+
# changing regions event
|
47
|
+
bm.onChangeRegion { |oldRegion, newRegion| my_code }
|
25
48
|
|
49
|
+
# loosing all regions event
|
50
|
+
bm.onLostRegions { my_code }
|
51
|
+
```
|
26
52
|
|
27
53
|
|
28
54
|
## Contributing
|
data/motion-beacon.gemspec
CHANGED
@@ -4,7 +4,7 @@ require File.expand_path('../lib/motion-beacon/version', __FILE__)
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.authors = ["CODIUM"]
|
6
6
|
gem.email = ["vaclav.s@codium.co"]
|
7
|
-
gem.description = "detect iBeacons with
|
7
|
+
gem.description = "detect iBeacons with nice events"
|
8
8
|
gem.summary = "Goal of this gem is to add a simple but powerful event system for iBeacon detection."
|
9
9
|
gem.homepage = "https://bitbucket.org/vencacodium/motion-beacon"
|
10
10
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion-beacon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CODIUM
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
description: detect iBeacons with
|
27
|
+
description: detect iBeacons with nice events
|
28
28
|
email:
|
29
29
|
- vaclav.s@codium.co
|
30
30
|
executables: []
|