commcare_api 0.0.5 → 0.1.0

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: c35502341c3508641810cd09701468ec7636ccb2
4
- data.tar.gz: 5aad2a4a16d179a528fcb11faa9f9fa077b72228
3
+ metadata.gz: 10bc11038fa05f625b82678b3f4e1c73b13b142b
4
+ data.tar.gz: 4273da724c705d51f04311fba14e8aa9d0ef0da4
5
5
  SHA512:
6
- metadata.gz: 73bba04b91c4dc78c1064ca5e3c8c36d16bece30e90e0599f8d21b5d960f7168e4331dbeb38fcc41075ffdef46981843aaa2b833ff5ccfb13ed97082bf41b81f
7
- data.tar.gz: dda7aaab5436fe4eda7f2ff3ec5ecd9055fde13c5446ef21e9298c3eb50c3c8201e59879ee514b75c95daca51cc3d8042391459433f8a672efdacb3be5eb19a3
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
- TODO: Write usage instructions here
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 ( http://github.com/gdeflaux/commcare_api/fork )
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}/?#{options}" if !options.empty?
50
+ url = "#{url}?#{options}" if !options.empty?
51
51
  url
52
52
  end
53
53
 
@@ -1,3 +1,3 @@
1
1
  module CommcareApi
2
- VERSION = "0.0.5"
2
+ VERSION = "0.1.0"
3
3
  end
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.5
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-26 00:00:00.000000000 Z
11
+ date: 2014-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler