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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/kontakt.rb +26 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a8645398d6f33be16c37eab35fc143f7bce3d8f0
4
- data.tar.gz: 4d073592b8d9b915f2f063cdce38d0abd79f5a55
3
+ metadata.gz: c30962e105c8748209eff05cbf96b9b1f2e1da49
4
+ data.tar.gz: 79c2d2d7474831eb83090a437b860287598beeba
5
5
  SHA512:
6
- metadata.gz: a35437817cfeffeb3285566da3a918bd70b153dff17d383d1bcab8ff9e468f5a7a5d6960875df382e7e5cf7cc8cc2b369965f61910ae22d9add9d71ae18838ff
7
- data.tar.gz: 94416dfdc3ae92e2f50c4858282ea5368c6d6636e1579696ccd55b92525d22b1f6c7e5a8282f602c98a3088b1b36daa66841b7d03fe7cdb9484f28143940f8bf
6
+ metadata.gz: f49fd24d7fb55d1e2cb11ecf25ff85f2d1e7de765ca13c05b462e0097191181836e79addf09d24a3757378c4f1a7cb9d2592046806e6043efdb66218e20aca00
7
+ data.tar.gz: 6846bf9789cd90bdf85eeeb48ee1b0801a75824a622ac37b5491f8b4df949883c83dcecb81d5469a2be0412f43c5efaf3e6afcb723ce2cc9c59e0d90efe51f94
@@ -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
- RESOURCE_DATA = {:accept => "application/vnd.com.kontakt+json;version=6", :"Api-Key" => AUTH_INFO["key"], :content_type => "application/x-www-form-urlencoded"}
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.1.5
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-10-02 00:00:00.000000000 Z
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