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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fcfa6aba9e7e4286737429edf5e49f33562180e8
4
- data.tar.gz: afe4b1e169f05676957d9beb087b205f56f62183
3
+ metadata.gz: d3c450e75109a63d7b2ec929c15ae0fb872d1f6c
4
+ data.tar.gz: 5cf95b83f4ede9267ab8d41e04021cad83ac5c8c
5
5
  SHA512:
6
- metadata.gz: ce0a119b10fd74dd2ff6592d15f733c4366ce68c95c7c7f72e5199ff748582ec052352076b987655de6a55f0d3a30fa3ef3527f48929c62385e248f7845ed017
7
- data.tar.gz: 9251c20f07d1c9dbd632362fb1ec20ea00aaa9a2fc16878c2b3e488248fb8362de26aeee01cceb596f2d1b960215ac1a6f949ba2c563302d978b6cfe5be72a5b
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
- ## Installation
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
- Add this line to your application's Gemfile:
9
+ example:
7
10
 
8
- gem 'motion-beaon'
11
+ ```ruby
12
+ beaconManager.onEnterRegion { |region| my_code }
13
+ ```
9
14
 
10
- And then execute:
15
+ ## Installation
11
16
 
12
- $ bundle
17
+ gem install motion-beacon
13
18
 
14
- Or install it yourself as:
19
+ # in Rakefile
20
+ require 'motion-beacon'
15
21
 
16
- $ gem install motion-beacon
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
- include MotionBeacon
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
- Once MotionBeacon module is included, you can start using it:
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
@@ -1,5 +1,5 @@
1
1
  module Motion
2
2
  module Beacon
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -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 simple events"
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.2
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 simple events
27
+ description: detect iBeacons with nice events
28
28
  email:
29
29
  - vaclav.s@codium.co
30
30
  executables: []