kontakt 0.1.5 → 1.0.0
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/lib/kontakt.rb +26 -3
- 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: c30962e105c8748209eff05cbf96b9b1f2e1da49
|
4
|
+
data.tar.gz: 79c2d2d7474831eb83090a437b860287598beeba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f49fd24d7fb55d1e2cb11ecf25ff85f2d1e7de765ca13c05b462e0097191181836e79addf09d24a3757378c4f1a7cb9d2592046806e6043efdb66218e20aca00
|
7
|
+
data.tar.gz: 6846bf9789cd90bdf85eeeb48ee1b0801a75824a622ac37b5491f8b4df949883c83dcecb81d5469a2be0412f43c5efaf3e6afcb723ce2cc9c59e0d90efe51f94
|
data/lib/kontakt.rb
CHANGED
@@ -8,10 +8,33 @@ require 'rest-client'
|
|
8
8
|
require 'yaml'
|
9
9
|
|
10
10
|
module Kontakt
|
11
|
-
GEM_ROOT = File.expand_path("../..", __FILE__)
|
12
|
-
AUTH_INFO = YAML.load_file("#{GEM_ROOT}/config/kontakt.yml")
|
13
11
|
API_URL = "https://api.kontakt.io"
|
14
|
-
|
12
|
+
|
13
|
+
|
14
|
+
class Configuration
|
15
|
+
attr_accessor :key
|
16
|
+
def initialize
|
17
|
+
self.key = nil
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.configuration
|
22
|
+
@configuration ||= Configuration.new
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.configure
|
26
|
+
yield(configuration) if block_given?
|
27
|
+
end
|
28
|
+
|
29
|
+
class << self
|
30
|
+
attr_accessor :key
|
31
|
+
def key
|
32
|
+
raise "The API key is needed" unless @key
|
33
|
+
@key
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
RESOURCE_DATA = {:accept => "application/vnd.com.kontakt+json;version=6", :"Api-Key" => Kontakt.configuration.key, :content_type => "application/x-www-form-urlencoded"}
|
15
38
|
|
16
39
|
class Auth
|
17
40
|
# => Kontakt Authentication
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kontakt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Winn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: For use with Kontakt.io API (iBeacon / EddyStone) Beacons, and Cloud
|
14
14
|
Beacons
|