commcare_api 0.0.5 → 0.1.0
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 +16 -3
- data/lib/commcare_api.rb +2 -2
- data/lib/commcare_api/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: 10bc11038fa05f625b82678b3f4e1c73b13b142b
|
4
|
+
data.tar.gz: 4273da724c705d51f04311fba14e8aa9d0ef0da4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f452a84ce3dad3024a1597d176c135ac195257bdde4c50e4e17ad5371b0eb91e437d678a781996027590b5cf2ad0fd3218a25ccb37d0bd94d889d65cdece329
|
7
|
+
data.tar.gz: ac5a9e8ff74162e69b59941070fefe21c89ba44a6ccb296023dbf3022764dcfa52f99afb4bc0428133944ec4e942e94893ced31c3fd87aacd825456199a01d3c
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# CommcareApi
|
2
2
|
|
3
|
-
A CommCare API wrapper in Ruby
|
3
|
+
A CommCare API wrapper in Ruby.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -16,13 +16,26 @@ Or install it yourself as:
|
|
16
16
|
|
17
17
|
$ gem install commcare_api
|
18
18
|
|
19
|
+
## Supported APIs
|
20
|
+
|
21
|
+
* [List cases](https://wiki.commcarehq.org/display/commcarepublic/List+Cases)
|
22
|
+
* [Case data](https://wiki.commcarehq.org/display/commcarepublic/Case+Data)
|
23
|
+
* [List forms](https://wiki.commcarehq.org/display/commcarepublic/Form+Data)
|
24
|
+
* [Form data](https://wiki.commcarehq.org/display/commcarepublic/Form+Data)
|
25
|
+
|
19
26
|
## Usage
|
20
27
|
|
21
|
-
|
28
|
+
require 'commcare_api'
|
29
|
+
|
30
|
+
ccc = CommcareApi::CommcareConnector.new(username, password)
|
31
|
+
response = ccc.get_cases("my_domain", type: "my_case_type", date_modified_start: "2014-05-30", limit: 15)
|
32
|
+
puts response.body
|
33
|
+
|
34
|
+
Filters are added to the request with an options hash as shown above.
|
22
35
|
|
23
36
|
## Contributing
|
24
37
|
|
25
|
-
1. Fork it (
|
38
|
+
1. Fork it (http://github.com/gdeflaux/commcare_api/fork)
|
26
39
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
40
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
41
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/lib/commcare_api.rb
CHANGED
@@ -45,9 +45,9 @@ module CommcareApi
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def build_url(domain, action, options)
|
48
|
-
url = "#{CommcareApi::CC_BASE_URL}/#{domain}/api/#{@version}/#{action}"
|
48
|
+
url = "#{CommcareApi::CC_BASE_URL}/#{domain}/api/#{@version}/#{action}/"
|
49
49
|
options = options.map {|k,v| "#{k.to_s}=#{v}"}.join("&")
|
50
|
-
url = "#{url}
|
50
|
+
url = "#{url}?#{options}" if !options.empty?
|
51
51
|
url
|
52
52
|
end
|
53
53
|
|
data/lib/commcare_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: commcare_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guillaume Deflaux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|