app_monit 0.0.7 → 0.0.8

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: ddbe4f23a6c0bd7e8cd3cecd8dc2f1517568f38e
4
- data.tar.gz: 41dab05d90d69581d06a10ae6f3339d172eaeddf
3
+ metadata.gz: e46f1d8fcbf444975b5d9c8ba3f743454e8ace06
4
+ data.tar.gz: fb7161001cbc233a5a0042697a14dec6e143fbb2
5
5
  SHA512:
6
- metadata.gz: ccdfe6021752a7a4c964649d72f3a5531319787ecadf30e535cf32ae4719982323cd3cfca43e807ee86453a06d28fdb158e7c35fedad4bbef65ea30115ee00bd
7
- data.tar.gz: 3525b0d93ee1a02d19ab30e7521c3d849979932548ac60916ebce0ac1d7b163bd7b523bbfde85441af43a255ae0bf9613a2f7a050604a3d41c5be78c08b6c58c
6
+ metadata.gz: bed68ca508a66d0ad28801b106eb88d7c04d9b471952ecb85e8b3e44f8f4f4a9f541cf5b72975818c233112b70531920af6a9d72cb8783afaeb0cba446df06a2
7
+ data.tar.gz: 612d8e2a6545282a5122d901b6a76e0e4bfab1f3e78efbf7a8b27d97c9813d2d9ca743c0b00097d2acb2c0f7287df4074a0aaaaa9bd0232b1b25b8e318c5971e
data/README.md CHANGED
@@ -205,6 +205,7 @@ You can also specify the environment and API key through the parameters
205
205
 
206
206
  ```ruby
207
207
  AppMonit::Query.count('registered', ap_key: 'KEY', environment: 'ENV')
208
+ AppMonit::Event.create('registered', ap_key: 'KEY', environment: 'ENV')
208
209
  ```
209
210
 
210
211
  ## Contributing
@@ -1,7 +1,7 @@
1
1
  module AppMonit
2
2
  class Config
3
3
  class << self
4
- attr_writer :api_key, :env, :end_point, :fail_silent, :enabled, :timeout
4
+ attr_writer :api_key, :env, :end_point, :fail_silent, :enabled, :timeout, :version
5
5
 
6
6
  def api_key
7
7
  @api_key || raise(ApiKeyNotSetError.new("Please set your API key"))
@@ -15,6 +15,10 @@ module AppMonit
15
15
  @end_point || "https://api.appmon.it"
16
16
  end
17
17
 
18
+ def version
19
+ @version || "v1"
20
+ end
21
+
18
22
  def fail_silent
19
23
  @fail_silent || false
20
24
  end
@@ -9,7 +9,6 @@ module AppMonit
9
9
 
10
10
  def query(method_name, collection_name, params)
11
11
  require 'cgi'
12
- path = "/v1/queries/#{method_name}"
13
12
 
14
13
  params[:event_collection] = collection_name
15
14
 
@@ -21,6 +20,9 @@ module AppMonit
21
20
 
22
21
  query_string = query_string_parts.join('&')
23
22
 
23
+
24
+ version = params[:version] || Config.version
25
+ path = "/#{version}/queries/#{method_name}"
24
26
  response = Http.get("#{path}?#{query_string}")
25
27
 
26
28
  case response.code.to_i
@@ -1,3 +1,3 @@
1
1
  module AppMonit
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_monit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Redmar Kerkhoff
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-24 00:00:00.000000000 Z
12
+ date: 2014-11-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler