vng 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/vng/resource.rb +13 -2
- data/lib/vng/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1356553075599aa2888d10740b02d282d6f6407c69bf49f67e0dbdc46475cebc
|
4
|
+
data.tar.gz: a8d09b9454c4fe51de636f61a880614eca6d12e9fc8455e5fc3888f324eaab9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 273b479db2901d89fbdd880383cdcf212aaffcfd1637ca973464567b33b98eafeb2036a6e7e46357d6e7aadc87d70876733bc7094c7c727a0e04118f0b8772fe
|
7
|
+
data.tar.gz: '088ea1b5e63a121b23f956b533d34b3adcf5a570851d999e583197134ae5af69b8345e9ff4946d15183723e031c87015dae8b112e1bf30edc2a2d683b3ca8ee1'
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -38,7 +38,7 @@ To install on your system, run
|
|
38
38
|
|
39
39
|
To use inside a bundled Ruby project, add this line to the Gemfile:
|
40
40
|
|
41
|
-
gem 'vng', '~>
|
41
|
+
gem 'vng', '~> 1.0'
|
42
42
|
|
43
43
|
Since the gem follows [Semantic Versioning](http://semver.org),
|
44
44
|
indicating the full version in your Gemfile (~> *major*.*minor*.*patch*)
|
data/lib/vng/resource.rb
CHANGED
@@ -18,8 +18,10 @@ module Vng
|
|
18
18
|
request.body = body.to_json
|
19
19
|
end
|
20
20
|
|
21
|
-
response =
|
22
|
-
|
21
|
+
response = instrument do |data|
|
22
|
+
data[:response] = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
|
23
|
+
http.request request
|
24
|
+
end
|
23
25
|
end
|
24
26
|
|
25
27
|
JSON(response.body).tap do |data|
|
@@ -41,5 +43,14 @@ module Vng
|
|
41
43
|
field = data['Fields'].find { |field| field['fieldID'] == field_id }
|
42
44
|
field['fieldValue'] if field
|
43
45
|
end
|
46
|
+
|
47
|
+
def self.instrument(&block)
|
48
|
+
data = {class_name: name} # TODO: Add path, query, ...
|
49
|
+
if defined?(ActiveSupport::Notifications)
|
50
|
+
ActiveSupport::Notifications.instrument 'Vng.request', data, &block
|
51
|
+
else
|
52
|
+
block.call(data)
|
53
|
+
end
|
54
|
+
end
|
44
55
|
end
|
45
56
|
end
|
data/lib/vng/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vng
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- claudiob
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simplecov
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: activesupport
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
description: A Ruby client for the Vonigo API.
|
42
56
|
email:
|
43
57
|
- claudiob@users.noreply.github.com
|