scaledrone 0.1
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 +7 -0
- data/lib/scaledrone.rb +29 -0
- metadata +59 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 278f539f4ff05fb5fb6719e1caa22e02843268d5
|
4
|
+
data.tar.gz: 027bd1d1d2ca7b2dbda99b6c7432b97341cbd7e0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4502aab633fa07328157e2a8292d15557c6966280c23f5392c1836ef045db94128fb32100e1b5f56f794c7386c912239fdb88190c5c4cb2f1d1eb8f4d452e0de
|
7
|
+
data.tar.gz: f695a93e9ba8fca24d2989edde6b898bc2ee894c2d81decfb3ec75a2493fd04daa6c728550a2053c73009706778c7fca170ad25f132fc8fca46b7dcc12664963
|
data/lib/scaledrone.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'httparty'
|
2
|
+
|
3
|
+
BASE_URL = 'https://api2.scaledrone.com'
|
4
|
+
|
5
|
+
class ScaleDrone
|
6
|
+
include HTTParty
|
7
|
+
|
8
|
+
def initialize(channel_id, secret_key, base_url = BASE_URL)
|
9
|
+
@channel_id = channel_id
|
10
|
+
@base_url = base_url
|
11
|
+
@auth = {username: channel_id, password: secret_key}
|
12
|
+
end
|
13
|
+
|
14
|
+
def publish(room, data = {})
|
15
|
+
options = {body: data, basic_auth: @auth}
|
16
|
+
self.class.post("#{@base_url}/#{@channel_id}/#{room}/publish", options)
|
17
|
+
end
|
18
|
+
|
19
|
+
def channel_stats
|
20
|
+
options = {basic_auth: @auth}
|
21
|
+
self.class.get("#{@base_url}/#{@channel_id}/stats", options)
|
22
|
+
end
|
23
|
+
|
24
|
+
def users_list
|
25
|
+
options = {basic_auth: @auth}
|
26
|
+
self.class.get("#{@base_url}/#{@channel_id}/users", options)
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: scaledrone
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.1'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Serge Herkül
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-10-31 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: httparty
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.13'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.13'
|
27
|
+
description: Push messaging that makes sense
|
28
|
+
email:
|
29
|
+
- info@scaledrone.com
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- lib/scaledrone.rb
|
35
|
+
homepage: https://www.scaledrone.com/
|
36
|
+
licenses:
|
37
|
+
- MIT
|
38
|
+
metadata: {}
|
39
|
+
post_install_message:
|
40
|
+
rdoc_options: []
|
41
|
+
require_paths:
|
42
|
+
- lib
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
requirements: []
|
54
|
+
rubyforge_project:
|
55
|
+
rubygems_version: 2.4.5
|
56
|
+
signing_key:
|
57
|
+
specification_version: 4
|
58
|
+
summary: Official ScaleDrone Ruby pushing library
|
59
|
+
test_files: []
|