dhis2 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a392c3f988989d0b3f6e14785464d5abba279cc3
4
- data.tar.gz: 35acd3072f5a4ebdd7d47a136eb12e14dd5beade
3
+ metadata.gz: ae7f039a0975be7f51396cf5726370c122e5c419
4
+ data.tar.gz: 1030e34afba383313497c392823f840e1d7a2194
5
5
  SHA512:
6
- metadata.gz: 79ac47b20d744f9cfa6e24b0dc23fc8bd923213d3aa358f22f48c2b544e807cf17cbfe7cc98378edd6072f7c6183f251cbc42c9ad5059c568b7829b02f73a453
7
- data.tar.gz: 04a31d19f9097937e350fe6f29ec674cbcdcd8381d82deda6cc279f69670b19632a089d1509e32de3364b33d50b6194cec920a0acbfc7f59013f29e90109acc0
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
@@ -1,3 +1,3 @@
1
1
  module Dhis2
2
- VERSION = "2.2.0"
2
+ VERSION = "2.2.1"
3
3
  end
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.0
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-10-18 00:00:00.000000000 Z
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: "")