cdd 0.0.3 → 0.0.4

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.
data/README.md CHANGED
@@ -100,7 +100,7 @@ vaults = cdd.vaults
100
100
  vault = vaults.first
101
101
  search = vault.searches.first
102
102
  projects = vault.projects
103
- search.export(projects, "sdf") do |data|
103
+ search.export(projects, [], "sdf") do |data|
104
104
  puts data
105
105
  end
106
106
  ```
@@ -109,6 +109,8 @@ end
109
109
 
110
110
  The synchronous export method is provided as a courtesy. If you could be exporting any non-trivial amount of data, you should use the aynchronous method.
111
111
 
112
+ In this example, we will use publicly accessible data sets, this should result in a larger result set (and why we are using the )
113
+
112
114
  To begin an export using the method ```Search#start_export```. This will return an ```Export``` object which can be polled or used to retrieve data.
113
115
 
114
116
  ```ruby
@@ -119,7 +121,8 @@ vaults = cdd.vaults
119
121
  vault = vaults.first
120
122
  search = vault.searches.first
121
123
  projects = vault.projects
122
- export = search.start_export(projects, "sdf")
124
+ data_sets = vault.data_sets
125
+ export = search.start_export(projects, data_sets, "sdf")
123
126
  export_state = export.poll
124
127
  puts export_state["status"]
125
128
  ```
@@ -3,15 +3,16 @@ module CDD
3
3
  attr_accessor :name
4
4
  attr_accessor :vault
5
5
 
6
- def start_export(projects=[], format="csv")
6
+ def start_export(projects=[], data_sets=[], format="csv")
7
7
  project_ids = projects.collect { |p| p.id }
8
- params = { :search => self.id, :projects => project_ids }
8
+ data_set_ids = data_sets.collect { |ds| ds.id }
9
+ params = { :search => self.id, :projects => project_ids.join(","), :data_sets => data_set_ids.join(",") }
9
10
  result = JSON.parse(RestClient.post("#{client.url}#{vault.export_url(format)}", params, { "X-CDD-Token" => client.token }))
10
11
  CDD::Export.new(client, { :search => self, :vault => vault, :format => format }.merge(result))
11
12
  end
12
13
 
13
- def export(projects=[], format="csv", &block)
14
- e = start_export(projects, format)
14
+ def export(projects=[], data_sets=[], format="csv", &block)
15
+ e = start_export(projects, data_sets, format)
15
16
  state = e.poll
16
17
  while ["new", "started", "starting"].include?(state["status"]) do
17
18
  state = e.poll
@@ -1,3 +1,3 @@
1
1
  module CDD
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cdd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-25 00:00:00.000000000 Z
12
+ date: 2013-01-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -114,7 +114,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
114
114
  version: '0'
115
115
  segments:
116
116
  - 0
117
- hash: 3574982497320562979
117
+ hash: -2196299000825545808
118
118
  required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  none: false
120
120
  requirements:
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  version: '0'
124
124
  segments:
125
125
  - 0
126
- hash: 3574982497320562979
126
+ hash: -2196299000825545808
127
127
  requirements: []
128
128
  rubyforge_project:
129
129
  rubygems_version: 1.8.24