beat 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 180e9c4402d0553b7218345d9bdba584d640eb7d
4
- data.tar.gz: 8459843677aa093bd2768c44a784b14680aba3ca
3
+ metadata.gz: be284606bef9434ffad9a07d3ec1959e737c6bce
4
+ data.tar.gz: af4962d4787aa5cd0ad130b92c9b82ed76d49d87
5
5
  SHA512:
6
- metadata.gz: 9aa8f09d15bc651b03eb92bab166f9a35d26f23de42b1296e06d70233cfb298bf998be582ed731abf5478a4dd77c8e3fe23f7f61f33ba05416ddb67f3293b114
7
- data.tar.gz: a4d687ff88da7d3d3ed1522a1f44d46088e0b35be64d43c665ccc684fd671046d3d48894110c50ebd0712fdf38934e0d1ac98413f9ac86b482009cfe62e06cb8
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
- in that file put the line:
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
@@ -1,3 +1,3 @@
1
1
  module Beat
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/beat.rb CHANGED
@@ -6,25 +6,24 @@ require 'json'
6
6
 
7
7
  module Beat
8
8
 
9
- class << self
10
-
11
- attr_accessor :username
12
- attr_accessor :password
13
- attr_accessor :api_token
14
-
15
- def send (title)
16
- uri = URI.parse("https://heartbeat-monitor-jackmontfort-1.c9users.io/api/beats")
17
- request = Net::HTTP::Post.new(uri)
18
- request.content_type = "application/json"
19
- request["Accept"] = "application/json"
20
- request.body = JSON.dump({"api_token" => api_token, "title" => title})
21
- response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
22
- http.request(request)
23
- end
24
- return response
25
- end
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.0
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-30 00:00:00.000000000 Z
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
@@ -1,5 +0,0 @@
1
- class InitializerGenerator < Rails::Generators::Base
2
- def create_initializer_file
3
- create_file "config/initializers/beat_initializer.rb", "# Add initialization content here"
4
- end
5
- end