beat 0.1.1 → 0.1.2

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 (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/beat/version.rb +1 -1
  3. data/lib/beat.rb +18 -8
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: be284606bef9434ffad9a07d3ec1959e737c6bce
4
- data.tar.gz: af4962d4787aa5cd0ad130b92c9b82ed76d49d87
3
+ metadata.gz: f9d674ea0531456ff4b9f5c340674064104b8968
4
+ data.tar.gz: 83af31d8b225132c5b821f8aae3335fd0820e2bc
5
5
  SHA512:
6
- metadata.gz: 21178e6fcb7cd663bb0757cb5bf6ac9840ab34cf43d762a2b89dec1ac2523e778d3ae32a04ec74fbe38b27632a4dbcb64cdd9b2410d7dca40730165757212959
7
- data.tar.gz: 2046095e679bbaa5dc28462c37f4b0c5036dd24370f889366bbdf74487ed53edf1076fb7f2e005754bac45e7d979fb3fcce019c0f61d4397b7b974bedbca63fa
6
+ metadata.gz: 1eb60896890a2615e2d88876e8e25a9c8855e118aee01953a8b04a94bdbe53cf7fa3b2ab80e9e964d7b1b9ff01ea52721fd4318333c05c2fa1c557a81b5317b7
7
+ data.tar.gz: 77c09198c28ea1f9757aa4bb8d6d5397d2c660ca6bd9605844803feb4dfec90d60187f8af572781a7ba844b132ffe60ef6610d2bfe755b2ad9a32978b3dbb587
data/lib/beat/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Beat
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/beat.rb CHANGED
@@ -11,16 +11,26 @@ module Beat
11
11
  attr_accessor :api_token
12
12
  attr_accessor :api_url
13
13
 
14
+ # def send (title)
15
+ # uri = URI.parse(api_url)
16
+ # request = Net::HTTP::Post.new(uri)
17
+ # request.verify_mode = OpenSSL::SSL::VERIFY_NONE
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
+
14
27
  def send (title)
15
28
  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
29
+ http = Net::HTTP.new(uri.host, uri.port)
30
+ http.use_ssl = true
31
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
32
+ to_return = http.post(uri, JSON.dump({"api_token" => api_token, "title" => title}))
33
+ return to_return
24
34
  end
25
35
 
26
36
  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.1
4
+ version: 0.1.2
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-07-06 00:00:00.000000000 Z
11
+ date: 2016-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler