beat 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -1
- data/lib/beat/version.rb +1 -1
- data/lib/beat.rb +18 -19
- metadata +2 -3
- data/lib/generators/beat_generator.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be284606bef9434ffad9a07d3ec1959e737c6bce
|
4
|
+
data.tar.gz: af4962d4787aa5cd0ad130b92c9b82ed76d49d87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21178e6fcb7cd663bb0757cb5bf6ac9840ab34cf43d762a2b89dec1ac2523e778d3ae32a04ec74fbe38b27632a4dbcb64cdd9b2410d7dca40730165757212959
|
7
|
+
data.tar.gz: 2046095e679bbaa5dc28462c37f4b0c5036dd24370f889366bbdf74487ed53edf1076fb7f2e005754bac45e7d979fb3fcce019c0f61d4397b7b974bedbca63fa
|
data/README.md
CHANGED
@@ -23,11 +23,21 @@ Or install it yourself as:
|
|
23
23
|
## Usage
|
24
24
|
|
25
25
|
in order to use this gem:
|
26
|
+
|
26
27
|
create an account, get your api_token from settings. Create file config/initializers/beat.rb
|
27
|
-
|
28
|
+
|
29
|
+
in that file put the lines:
|
30
|
+
|
28
31
|
Beat.api_token = api_token
|
32
|
+
|
33
|
+
Beat.api_url = api_url
|
34
|
+
|
35
|
+
where api_token is the api_token for your user, and api_url is the url where you have the api set up.
|
36
|
+
|
29
37
|
To send beats use the line:
|
38
|
+
|
30
39
|
Beat.send("title")
|
40
|
+
|
31
41
|
where title is the title of one of your heartbeats
|
32
42
|
|
33
43
|
## Development
|
data/lib/beat/version.rb
CHANGED
data/lib/beat.rb
CHANGED
@@ -6,25 +6,24 @@ require 'json'
|
|
6
6
|
|
7
7
|
module Beat
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
end
|
9
|
+
class << self
|
10
|
+
|
11
|
+
attr_accessor :api_token
|
12
|
+
attr_accessor :api_url
|
13
|
+
|
14
|
+
def send (title)
|
15
|
+
uri = URI.parse(api_url)
|
16
|
+
request = Net::HTTP::Post.new(uri)
|
17
|
+
request.content_type = "application/json"
|
18
|
+
request["Accept"] = "application/json"
|
19
|
+
request.body = JSON.dump({"api_token" => api_token, "title" => title})
|
20
|
+
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
|
21
|
+
http.request(request)
|
22
|
+
end
|
23
|
+
return response
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
28
27
|
|
29
28
|
|
30
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jack Montfort
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06
|
11
|
+
date: 2016-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -84,7 +84,6 @@ files:
|
|
84
84
|
- bin/setup
|
85
85
|
- lib/beat.rb
|
86
86
|
- lib/beat/version.rb
|
87
|
-
- lib/generators/beat_generator.rb
|
88
87
|
homepage: https://github.com/jackmontfort/Beat
|
89
88
|
licenses:
|
90
89
|
- MIT
|