dhis2 2.2.0 → 2.2.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 +4 -4
- data/README.md +6 -0
- data/lib/dhis2/client.rb +3 -1
- data/lib/dhis2/version.rb +1 -1
- metadata +2 -3
- data/TODO.md +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae7f039a0975be7f51396cf5726370c122e5c419
|
4
|
+
data.tar.gz: 1030e34afba383313497c392823f840e1d7a2194
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13524e283c71c7470a4a866e10aa9ef9e4dcc7c88480d9b6796f81354582c30807f00f75f65e285306e86dc04527106b5eae80ffd42e4bb53953c057bcb977d7
|
7
|
+
data.tar.gz: e1b1875faae92a86f3a901801988a818ec81f0dec74cecb5611d41f986199f6ff38e0e4405608a718d0c0a35289e76f291ee0239fde39f98fd1c32b7d0b97e7c
|
data/README.md
CHANGED
@@ -55,6 +55,12 @@ The functionalities are available as a module. First thing you need to do is to
|
|
55
55
|
client.data_elements.list # => Array[<DataElement>,..]
|
56
56
|
```
|
57
57
|
|
58
|
+
Regarding SSL, there is an option to disregard SSL error messages (such as bad certificates). USE THIS AT YOUR OWN RISK - it may allow you to access a server that would return in error without it... but you cannot trust the response.
|
59
|
+
|
60
|
+
```ruby
|
61
|
+
dangerous_client = Dhis2::Client.new(url: "https://play.dhis2.org/demo", user: "admin", password: "district", no_ssl_verification: true);
|
62
|
+
```
|
63
|
+
|
58
64
|
### Search for meta elements
|
59
65
|
|
60
66
|
All subsequent calls can be done on the objects themselves and are going to use the provided url and credentials
|
data/lib/dhis2/client.rb
CHANGED
@@ -54,6 +54,7 @@ module Dhis2
|
|
54
54
|
url.user = CGI.escape(options[:user])
|
55
55
|
url.password = CGI.escape(options[:password])
|
56
56
|
@base_url = url.to_s
|
57
|
+
@verify_ssl = options[:no_ssl_verification] ? OpenSSL::SSL::VERIFY_NONE : OpenSSL::SSL::VERIFY_PEER
|
57
58
|
end
|
58
59
|
end
|
59
60
|
|
@@ -84,7 +85,8 @@ module Dhis2
|
|
84
85
|
method: method,
|
85
86
|
url: url,
|
86
87
|
headers: { params: query_params }.merge(headers),
|
87
|
-
payload: payload ? self.class.deep_change_case(payload, :camelize).to_json : nil
|
88
|
+
payload: payload ? self.class.deep_change_case(payload, :camelize).to_json : nil,
|
89
|
+
verify_ssl: @verify_ssl
|
88
90
|
}
|
89
91
|
|
90
92
|
raw_response = RestClient::Request.execute(query)
|
data/lib/dhis2/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dhis2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Van Aken
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -81,7 +81,6 @@ files:
|
|
81
81
|
- LICENSE.txt
|
82
82
|
- README.md
|
83
83
|
- Rakefile
|
84
|
-
- TODO.md
|
85
84
|
- bin/console
|
86
85
|
- bin/setup
|
87
86
|
- dhis2.gemspec
|
data/TODO.md
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# Improvements
|
2
|
-
|
3
|
-
## Reading
|
4
|
-
|
5
|
-
Convert the CamelCase JSON field names to more Ruby-like snake_case fields.
|
6
|
-
|
7
|
-
Ex: shortName => short_name
|
8
|
-
|
9
|
-
## API Structure
|
10
|
-
|
11
|
-
Have a look to Stripe API to use the objects themselves as starting point:
|
12
|
-
|
13
|
-
data_elements = DataElement.list(filter: "...", fields: [...])
|
14
|
-
data_element = DataElement.find(id)
|
15
|
-
|
16
|
-
This would make the "write/update" API better:
|
17
|
-
|
18
|
-
DataElement.create(name: "", short_name: "")
|