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 +4 -4
- data/README.md +1 -0
- data/lib/app_monit/config.rb +5 -1
- data/lib/app_monit/query.rb +3 -1
- data/lib/app_monit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e46f1d8fcbf444975b5d9c8ba3f743454e8ace06
|
|
4
|
+
data.tar.gz: fb7161001cbc233a5a0042697a14dec6e143fbb2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
data/lib/app_monit/config.rb
CHANGED
|
@@ -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
|
data/lib/app_monit/query.rb
CHANGED
|
@@ -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
|
data/lib/app_monit/version.rb
CHANGED
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.
|
|
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-
|
|
12
|
+
date: 2014-11-28 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: bundler
|