cartodb-rb-client 0.3.1 → 0.4.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.
Files changed (63) hide show
  1. data/Gemfile +2 -2
  2. data/lib/cartodb-rb-client/cartodb/client/connection/cartodb.rb +1 -1
  3. data/lib/cartodb-rb-client/cartodb/model/base.rb +1 -1
  4. data/lib/cartodb-rb-client/cartodb/model/getters.rb +6 -9
  5. data/lib/cartodb-rb-client/cartodb/model/schema.rb +13 -2
  6. data/lib/cartodb-rb-client/cartodb/model/setters.rb +5 -9
  7. data/lib/cartodb-rb-client/version.rb +1 -1
  8. data/spec/client_spec.rb +3 -3
  9. data/spec/fixtures/cassettes/CartoDB_client/should_add_and_remove_colums_in_a_previously_created_table.yml +376 -0
  10. data/spec/fixtures/cassettes/CartoDB_client/should_allow_reserved_words_in_columns_names.yml +121 -0
  11. data/spec/fixtures/cassettes/CartoDB_client/should_change_a_previously_created_column.yml +174 -0
  12. data/spec/fixtures/cassettes/CartoDB_client/should_create_a_table_and_get_its_table_definition.yml +123 -0
  13. data/spec/fixtures/cassettes/CartoDB_client/should_create_a_table_forcing_the_schema_and_get_its_table_definition.yml +123 -0
  14. data/spec/fixtures/cassettes/CartoDB_client/should_create_a_table_from_a_csv_file.yml +1971 -0
  15. data/spec/fixtures/cassettes/CartoDB_client/should_create_a_table_with_MULTILINESTRING_type_geometry.yml +123 -0
  16. data/spec/fixtures/cassettes/CartoDB_client/should_create_a_table_with_MULTIPOLYGON_type_geometry.yml +123 -0
  17. data/spec/fixtures/cassettes/CartoDB_client/should_create_a_table_with_POINT_type_geometry.yml +123 -0
  18. data/spec/fixtures/cassettes/CartoDB_client/should_delete_a_table_s_row.yml +221 -0
  19. data/spec/fixtures/cassettes/CartoDB_client/should_drop_a_table.yml +278 -0
  20. data/spec/fixtures/cassettes/CartoDB_client/should_escape_properly_input_data_in_insert_queries.yml +121 -0
  21. data/spec/fixtures/cassettes/CartoDB_client/should_execute_a_select_query_and_return_results.yml +615 -0
  22. data/spec/fixtures/cassettes/CartoDB_client/should_get_a_table_by_its_name.yml +123 -0
  23. data/spec/fixtures/cassettes/CartoDB_client/should_import_any_kind_of_data_file.yml +6612 -0
  24. data/spec/fixtures/cassettes/CartoDB_client/should_insert_a_row_in_a_table.yml +121 -0
  25. data/spec/fixtures/cassettes/CartoDB_client/should_paginate_records.yml +2624 -0
  26. data/spec/fixtures/cassettes/CartoDB_client/should_rename_an_existing_table.yml +123 -0
  27. data/spec/fixtures/cassettes/CartoDB_client/should_return_errors_on_invalid_queries.yml +59 -0
  28. data/spec/fixtures/cassettes/CartoDB_client/should_return_nil_when_requesting_a_table_which_does_not_exists.yml +68 -0
  29. data/spec/fixtures/cassettes/CartoDB_client/should_return_user_s_table_list.yml +176 -0
  30. data/spec/fixtures/cassettes/CartoDB_client/should_update_a_row_in_a_table.yml +170 -0
  31. data/spec/fixtures/cassettes/CartoDB_model_data_methods/should_destroy_a_previously_created_record.yml +1398 -0
  32. data/spec/fixtures/cassettes/CartoDB_model_data_methods/should_initialize_attributes_of_the_model_without_persisting_them.yml +223 -0
  33. data/spec/fixtures/cassettes/CartoDB_model_data_methods/should_persist_into_cartodb_using_the_save_method.yml +1406 -0
  34. data/spec/fixtures/cassettes/CartoDB_model_data_methods/should_persist_into_cartodb_using_the_static_create_method.yml +1299 -0
  35. data/spec/fixtures/cassettes/CartoDB_model_data_methods/should_update_an_existing_record.yml +2028 -0
  36. data/spec/fixtures/cassettes/CartoDB_model_metadata_methods/should_add_more_columns_if_the_table_previously_exists.yml +990 -0
  37. data/spec/fixtures/cassettes/CartoDB_model_metadata_methods/should_contain_an_array_of_columns.yml +1443 -0
  38. data/spec/fixtures/cassettes/CartoDB_model_metadata_methods/should_create_a_table_with_custom_name_if_specified.yml +270 -0
  39. data/spec/fixtures/cassettes/CartoDB_model_metadata_methods/should_create_model_with_custom_data_types_columns.yml +421 -0
  40. data/spec/fixtures/cassettes/CartoDB_model_metadata_methods/should_create_model_with_polygon_type_geometry_columns.yml +272 -0
  41. data/spec/fixtures/cassettes/CartoDB_model_metadata_methods/should_create_the_table_in_cartodb_if_it_doesn_t_exists.yml +780 -0
  42. data/spec/fixtures/cassettes/CartoDB_model_metadata_methods/should_have_a_valid_CartoDB_Client_instance_as_a_connection_object.yml +682 -0
  43. data/spec/fixtures/cassettes/CartoDB_model_metadata_methods/should_have_a_valid_table_name.yml +727 -0
  44. data/spec/fixtures/cassettes/CartoDB_model_metadata_methods/should_return_only_data_columns.yml +829 -0
  45. data/spec/fixtures/cassettes/CartoDB_model_scopes/should_allow_to_select_the_specified_fiels.yml +17953 -0
  46. data/spec/fixtures/cassettes/CartoDB_model_scopes/should_count_all_records.yml +15596 -0
  47. data/spec/fixtures/cassettes/CartoDB_model_scopes/should_find_a_record_by_its_id.yml +15197 -0
  48. data/spec/fixtures/cassettes/CartoDB_model_scopes/should_order_results.yml +16439 -0
  49. data/spec/fixtures/cassettes/CartoDB_model_scopes/should_paginate_results.yml +24501 -0
  50. data/spec/fixtures/cassettes/CartoDB_model_scopes/should_return_all_records_paginated.yml +16488 -0
  51. data/spec/fixtures/cassettes/CartoDB_model_scopes/should_search_records_by_certain_filters.yml +4950 -0
  52. data/spec/fixtures/cassettes/cartodb_spec_models.yml +2467 -0
  53. data/spec/fixtures/cassettes/clean_tables.yml +266 -0
  54. data/spec/model/data_spec.rb +6 -6
  55. data/spec/model/metadata_spec.rb +11 -3
  56. data/spec/model/scopes_spec.rb +2 -2
  57. data/spec/model_specs_helper.rb +2 -0
  58. data/spec/spec_helper.rb +18 -5
  59. data/spec/support/cartodb_factories.rb +3 -3
  60. data/spec/support/cartodb_helpers.rb +1 -1
  61. data/spec/support/cartodb_models.rb +26 -19
  62. metadata +97 -7
  63. data/spec/support/data/ngos.xlsx +0 -0
data/Gemfile CHANGED
@@ -6,7 +6,7 @@ gemspec
6
6
  group :development do
7
7
  gem "rspec", "~> 2.3.0"
8
8
  gem "spork", "~> 0.9.0"
9
+ gem "vcr"
9
10
  gem "bundler", "> 1.0.0"
10
- gem 'ruby-debug', :platforms => :mri_18
11
- gem 'ruby-debug19', :require => 'ruby-debug', :platforms => :mri_19
11
+ gem 'debugger'
12
12
  end
@@ -208,7 +208,7 @@ module CartoDB
208
208
  end
209
209
 
210
210
  request = cartodb_request uri, :post, :params => params do |response|
211
- return Utils.parse_json(response)
211
+ Utils.parse_json(response)
212
212
  end
213
213
 
214
214
  execute_queue
@@ -11,7 +11,7 @@ module CartoDB
11
11
 
12
12
  def initialize(attributes = {})
13
13
  self.class.cartodb_table = nil
14
- self.class.send(:field, :the_geom, :type => Point)
14
+ self.class.send(:set_geometry_type) unless self.class.send(:geometry_type).present?
15
15
  self.attributes = attributes
16
16
  self.class.send(:update_cartodb_schema) unless schema_synchronized?
17
17
  end
@@ -39,6 +39,11 @@ module CartoDB
39
39
  end
40
40
  private :model_columns
41
41
 
42
+ def geometry_type
43
+ @geometry_type
44
+ end
45
+ private :geometry_type
46
+
42
47
  end
43
48
 
44
49
  def connection
@@ -53,14 +58,6 @@ module CartoDB
53
58
  self.class.cartodb_table
54
59
  end
55
60
 
56
- # def method_missing(name, *args, &block)
57
- # if args.empty? && block.nil? && column_names.include?(name.to_s)
58
- # attributes[name]
59
- # else
60
- # super
61
- # end
62
- # end
63
-
64
61
  def columns
65
62
  self.class.columns
66
63
  end
@@ -76,4 +73,4 @@ module CartoDB
76
73
 
77
74
  end
78
75
  end
79
- end
76
+ end
@@ -22,13 +22,14 @@ module CartoDB
22
22
  end
23
23
 
24
24
  def field(name, options = {:type => String})
25
+ return if name == 'the_geom'
26
+
25
27
  @columns_synchronized = false
26
28
  @model_columns ||= []
27
29
  column = {
28
30
  :name => name.to_s,
29
31
  :type => CARTODB_TYPES[options[:type]] || options[:type]
30
32
  }
31
- column[:geometry_type] = options[:type].name.split('::').last.downcase if column[:type].eql?('geometry')
32
33
  return if model_columns.include?(column)
33
34
 
34
35
  model_columns << column
@@ -36,12 +37,22 @@ module CartoDB
36
37
  end
37
38
  private :field
38
39
 
40
+ def set_geometry_type(geometry_type = Point)
41
+ self.geometry_type = case geometry_type
42
+ when Class, Module
43
+ geometry_type.name.split('::').last.downcase
44
+ else
45
+ geometry_type.to_s.downcase
46
+ end
47
+ end
48
+ private :set_geometry_type
49
+
39
50
  def update_cartodb_schema
40
51
  table = nil
41
52
  if cartodb_table_exists?
42
53
  table = cartodb_table
43
54
  else
44
- table = connection.create_table table_name, model_columns
55
+ table = connection.create_table table_name, geometry_type
45
56
  end
46
57
 
47
58
  read_metadata table
@@ -19,6 +19,10 @@ module CartoDB
19
19
  @columns = columns
20
20
  end
21
21
 
22
+ def geometry_type=(geometry_type)
23
+ @geometry_type = geometry_type
24
+ end
25
+ private :geometry_type=
22
26
  end
23
27
 
24
28
  def cartodb_table=(table)
@@ -29,14 +33,6 @@ module CartoDB
29
33
  @attributes = prepare_geo_attributes(attributes)
30
34
  end
31
35
 
32
- # def method_missing(name, *args, &block)
33
- # if args.count == 1 && block.nil? && name.to_s.ends_with?('=') && column_names.include?(name.to_s[0..-2])
34
- # attributes[name.to_s[0..-2].to_sym] = args.first
35
- # else
36
- # super
37
- # end
38
- # end
39
-
40
36
  end
41
37
  end
42
- end
38
+ end
@@ -1,7 +1,7 @@
1
1
  module Cartodb
2
2
  module Rb
3
3
  module Client
4
- VERSION = "0.3.1"
4
+ VERSION = "0.4.0"
5
5
  end
6
6
  end
7
7
  end
data/spec/client_spec.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # coding: UTF-8
2
2
  require 'spec_helper'
3
3
 
4
- describe 'CartoDB client' do
4
+ describe 'CartoDB client', :vcr => true do
5
5
 
6
6
  it "should create a table and get its table definition" do
7
7
 
@@ -195,7 +195,7 @@ describe 'CartoDB client' do
195
195
  {:name => 'field4', :type => 'boolean'}
196
196
  ]
197
197
 
198
- today = DateTime.now
198
+ today = DateTime.new(2004, 1, 1)
199
199
 
200
200
  record = CartoDB::Connection.insert_row 'table_1', {
201
201
  'field1' => 'lorem',
@@ -218,7 +218,7 @@ describe 'CartoDB client' do
218
218
  {:name => 'field4', :type => 'boolean'}
219
219
  ]
220
220
 
221
- today = DateTime.now
221
+ today = DateTime.new(2004, 1, 1)
222
222
 
223
223
  record = CartoDB::Connection.insert_row 'table_1', {
224
224
  'field1' => 'lorem',
@@ -0,0 +1,376 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://cartodb-rb-client.cartodb.com/api/v1/tables
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - &70262196348080 !ruby/object:MIME::Type
12
+ content_type: application/json
13
+ raw_media_type: application
14
+ raw_sub_type: json
15
+ simplified: application/json
16
+ media_type: application
17
+ sub_type: json
18
+ extensions:
19
+ - json
20
+ encoding: 8bit
21
+ system: !!null
22
+ registered: true
23
+ url:
24
+ - IANA
25
+ - RFC4627
26
+ obsolete: !!null
27
+ docs: !!null
28
+ Authorization:
29
+ - OAuth oauth_consumer_key="0gRpcgKQK8bpcvSzM5ED4NqaSbNQ8ivS4q0pVdJF", oauth_nonce="bdvzk2VWKWsmpl7gXIBV1b758HaIVOEwZdVsc5Cp4",
30
+ oauth_signature="SogMvFiKih6zTMsKHWcZCRzRO20%3D", oauth_signature_method="HMAC-SHA1",
31
+ oauth_timestamp="1337787362", oauth_token="7PalByYmKY8Dzh76fnt05e0YPXRJino0dyqHZYCw",
32
+ oauth_version="1.0"
33
+ response:
34
+ status:
35
+ code: 200
36
+ message: OK
37
+ headers:
38
+ Server:
39
+ - nginx
40
+ Date:
41
+ - Wed, 23 May 2012 15:36:03 GMT
42
+ Content-Type:
43
+ - application/json; charset=utf-8
44
+ Transfer-Encoding:
45
+ - chunked
46
+ Connection:
47
+ - keep-alive
48
+ Vary:
49
+ - Accept-Encoding
50
+ Status:
51
+ - 200 OK
52
+ Location:
53
+ - /tables/4703
54
+ Etag:
55
+ - ! '"41cecdf0c6e52daf7bc424ee58db7a21"'
56
+ Cache-Control:
57
+ - max-age=0, private, must-revalidate
58
+ X-Ua-Compatible:
59
+ - IE=Edge,chrome=1
60
+ Set-Cookie:
61
+ - _cartodb_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlOTUwMTlmNDgwNGM0M2E2Mzk4ZjkxNjM4MDE3MTBhMGNJIiZ3YXJkZW4udXNlci5jYXJ0b2RiLXJiLWNsaWVudC5rZXkGOwBUSSIWY2FydG9kYi1yYi1jbGllbnQGOwBU--6246dc7af608fc5c098b291ba1801b535b021231;
62
+ domain=.cartodb.com; path=/; HttpOnly
63
+ X-Runtime:
64
+ - '0.894393'
65
+ Content-Encoding:
66
+ - gzip
67
+ body:
68
+ encoding: ASCII-8BIT
69
+ string: ! '{"id":4703,"name":"cartodb_spec","schema":[["cartodb_id","number"],["the_geom","geometry","geometry","point"],["description","string"],["name","string"],["created_at","date"],["updated_at","date"]]}'
70
+ http_version: '1.1'
71
+ recorded_at: Wed, 23 May 2012 15:36:03 GMT
72
+ - request:
73
+ method: post
74
+ uri: https://cartodb-rb-client.cartodb.com/api/v1/tables/cartodb_spec/columns
75
+ body:
76
+ encoding: US-ASCII
77
+ string: ''
78
+ headers:
79
+ Accept:
80
+ - *70262196348080
81
+ Authorization:
82
+ - OAuth oauth_consumer_key="0gRpcgKQK8bpcvSzM5ED4NqaSbNQ8ivS4q0pVdJF", oauth_nonce="4B0EJDWN8bVCntpGvvzhQviMUboYwRxS7MX11W6I1c",
83
+ oauth_signature="Sv5aOjf%2Fr3rrw%2BaW08V9B2VrR48%3D", oauth_signature_method="HMAC-SHA1",
84
+ oauth_timestamp="1337787363", oauth_token="7PalByYmKY8Dzh76fnt05e0YPXRJino0dyqHZYCw",
85
+ oauth_version="1.0"
86
+ response:
87
+ status:
88
+ code: 200
89
+ message: OK
90
+ headers:
91
+ Server:
92
+ - nginx
93
+ Date:
94
+ - Wed, 23 May 2012 15:36:04 GMT
95
+ Content-Type:
96
+ - application/json; charset=utf-8
97
+ Transfer-Encoding:
98
+ - chunked
99
+ Connection:
100
+ - keep-alive
101
+ Vary:
102
+ - Accept-Encoding
103
+ Status:
104
+ - 200 OK
105
+ Etag:
106
+ - ! '"14150c7f1989f7817685d810140166b7"'
107
+ Cache-Control:
108
+ - max-age=0, private, must-revalidate
109
+ X-Ua-Compatible:
110
+ - IE=Edge,chrome=1
111
+ Set-Cookie:
112
+ - _cartodb_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlZGJiYzk5ODllYmEyM2VjMmJmM2Y1NDU0MWFmNmUxMmVJIiZ3YXJkZW4udXNlci5jYXJ0b2RiLXJiLWNsaWVudC5rZXkGOwBUSSIWY2FydG9kYi1yYi1jbGllbnQGOwBU--f132967538362bc40fba5de1702d6515c6d21a08;
113
+ domain=.cartodb.com; path=/; HttpOnly
114
+ X-Runtime:
115
+ - '0.143315'
116
+ Content-Encoding:
117
+ - gzip
118
+ body:
119
+ encoding: ASCII-8BIT
120
+ string: ! '{"name":"field1","type":"text","cartodb_type":"string"}'
121
+ http_version: '1.1'
122
+ recorded_at: Wed, 23 May 2012 15:36:04 GMT
123
+ - request:
124
+ method: post
125
+ uri: https://cartodb-rb-client.cartodb.com/api/v1/tables/cartodb_spec/columns
126
+ body:
127
+ encoding: US-ASCII
128
+ string: ''
129
+ headers:
130
+ Accept:
131
+ - *70262196348080
132
+ Authorization:
133
+ - OAuth oauth_consumer_key="0gRpcgKQK8bpcvSzM5ED4NqaSbNQ8ivS4q0pVdJF", oauth_nonce="FW6kb9Xm64tDvXWhS8pRrFDYQdVqkNulzV41MNLS0",
134
+ oauth_signature="zIskA0Fq3Z3SfhaftkVN2uhAi%2FU%3D", oauth_signature_method="HMAC-SHA1",
135
+ oauth_timestamp="1337787364", oauth_token="7PalByYmKY8Dzh76fnt05e0YPXRJino0dyqHZYCw",
136
+ oauth_version="1.0"
137
+ response:
138
+ status:
139
+ code: 200
140
+ message: OK
141
+ headers:
142
+ Server:
143
+ - nginx
144
+ Date:
145
+ - Wed, 23 May 2012 15:36:04 GMT
146
+ Content-Type:
147
+ - application/json; charset=utf-8
148
+ Transfer-Encoding:
149
+ - chunked
150
+ Connection:
151
+ - keep-alive
152
+ Vary:
153
+ - Accept-Encoding
154
+ Status:
155
+ - 200 OK
156
+ Etag:
157
+ - ! '"40daf8be8a04d57de7c8342e58087688"'
158
+ Cache-Control:
159
+ - max-age=0, private, must-revalidate
160
+ X-Ua-Compatible:
161
+ - IE=Edge,chrome=1
162
+ Set-Cookie:
163
+ - _cartodb_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlYTFlZmI2Y2FjZjg2YTlkZDVmZTVlZDBiNDQwNTQ5YmZJIiZ3YXJkZW4udXNlci5jYXJ0b2RiLXJiLWNsaWVudC5rZXkGOwBUSSIWY2FydG9kYi1yYi1jbGllbnQGOwBU--ca5e2dc9289a51c9452d0ddaf0b84a34ce3a257f;
164
+ domain=.cartodb.com; path=/; HttpOnly
165
+ X-Runtime:
166
+ - '0.028874'
167
+ Content-Encoding:
168
+ - gzip
169
+ body:
170
+ encoding: ASCII-8BIT
171
+ string: ! '{"name":"field2","type":"numeric","cartodb_type":"number"}'
172
+ http_version: '1.1'
173
+ recorded_at: Wed, 23 May 2012 15:36:04 GMT
174
+ - request:
175
+ method: post
176
+ uri: https://cartodb-rb-client.cartodb.com/api/v1/tables/cartodb_spec/columns
177
+ body:
178
+ encoding: US-ASCII
179
+ string: ''
180
+ headers:
181
+ Accept:
182
+ - *70262196348080
183
+ Authorization:
184
+ - OAuth oauth_consumer_key="0gRpcgKQK8bpcvSzM5ED4NqaSbNQ8ivS4q0pVdJF", oauth_nonce="if46UvqfLKusCfzSAPjm44BxeunRIfbF1p70S2VGo",
185
+ oauth_signature="3cM87VoL8YHtMNBuOLsnha37gYo%3D", oauth_signature_method="HMAC-SHA1",
186
+ oauth_timestamp="1337787364", oauth_token="7PalByYmKY8Dzh76fnt05e0YPXRJino0dyqHZYCw",
187
+ oauth_version="1.0"
188
+ response:
189
+ status:
190
+ code: 200
191
+ message: OK
192
+ headers:
193
+ Server:
194
+ - nginx
195
+ Date:
196
+ - Wed, 23 May 2012 15:36:04 GMT
197
+ Content-Type:
198
+ - application/json; charset=utf-8
199
+ Transfer-Encoding:
200
+ - chunked
201
+ Connection:
202
+ - keep-alive
203
+ Vary:
204
+ - Accept-Encoding
205
+ Status:
206
+ - 200 OK
207
+ Etag:
208
+ - ! '"1ea402cd5ebab4741be7a08e8724df77"'
209
+ Cache-Control:
210
+ - max-age=0, private, must-revalidate
211
+ X-Ua-Compatible:
212
+ - IE=Edge,chrome=1
213
+ Set-Cookie:
214
+ - _cartodb_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlYzYzYzA3MDVkMzVlMjdmNjM1YmRjYTE4MjNiZTIyMWRJIiZ3YXJkZW4udXNlci5jYXJ0b2RiLXJiLWNsaWVudC5rZXkGOwBUSSIWY2FydG9kYi1yYi1jbGllbnQGOwBU--a0933b31d3ecfd40556f5d08067892a268760e9f;
215
+ domain=.cartodb.com; path=/; HttpOnly
216
+ X-Runtime:
217
+ - '0.055465'
218
+ Content-Encoding:
219
+ - gzip
220
+ body:
221
+ encoding: ASCII-8BIT
222
+ string: ! '{"name":"field3","type":"timestamp","cartodb_type":"date"}'
223
+ http_version: '1.1'
224
+ recorded_at: Wed, 23 May 2012 15:36:04 GMT
225
+ - request:
226
+ method: get
227
+ uri: https://cartodb-rb-client.cartodb.com/api/v1/tables/cartodb_spec?
228
+ body:
229
+ encoding: US-ASCII
230
+ string: ''
231
+ headers:
232
+ Accept:
233
+ - *70262196348080
234
+ Authorization:
235
+ - OAuth oauth_consumer_key="0gRpcgKQK8bpcvSzM5ED4NqaSbNQ8ivS4q0pVdJF", oauth_nonce="03DI9hvfrAmkEQu9uBKCGHtZbP2XDG8Ydd2fsD94xlE",
236
+ oauth_signature="LIEjl%2Fw5Dysls%2FtZSTABqaNVOEQ%3D", oauth_signature_method="HMAC-SHA1",
237
+ oauth_timestamp="1337787364", oauth_token="7PalByYmKY8Dzh76fnt05e0YPXRJino0dyqHZYCw",
238
+ oauth_version="1.0"
239
+ response:
240
+ status:
241
+ code: 200
242
+ message: OK
243
+ headers:
244
+ Server:
245
+ - nginx
246
+ Date:
247
+ - Wed, 23 May 2012 15:36:04 GMT
248
+ Content-Type:
249
+ - application/json; charset=utf-8
250
+ Transfer-Encoding:
251
+ - chunked
252
+ Connection:
253
+ - keep-alive
254
+ Vary:
255
+ - Accept-Encoding
256
+ Status:
257
+ - 200 OK
258
+ Etag:
259
+ - ! '"129d11545b57a9f8af7afb37f74daffc"'
260
+ Cache-Control:
261
+ - max-age=0, private, must-revalidate
262
+ X-Ua-Compatible:
263
+ - IE=Edge,chrome=1
264
+ Set-Cookie:
265
+ - _cartodb_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlODRiNjdiYTE5MDA1MTBkMjIwYjgxMWE5NDM5NTkyNzJJIiZ3YXJkZW4udXNlci5jYXJ0b2RiLXJiLWNsaWVudC5rZXkGOwBUSSIWY2FydG9kYi1yYi1jbGllbnQGOwBU--c09a11e58c2ffdecc88c8911c834915390011b73;
266
+ domain=.cartodb.com; path=/; HttpOnly
267
+ X-Runtime:
268
+ - '0.008816'
269
+ Content-Encoding:
270
+ - gzip
271
+ body:
272
+ encoding: ASCII-8BIT
273
+ string: ! '{"id":4703,"name":"cartodb_spec","privacy":"PUBLIC","tags":"","schema":[["cartodb_id","number"],["the_geom","geometry","geometry","point"],["description","string"],["field1","string"],["field2","number"],["field3","date"],["name","string"],["created_at","date"],["updated_at","date"]]}'
274
+ http_version: '1.1'
275
+ recorded_at: Wed, 23 May 2012 15:36:04 GMT
276
+ - request:
277
+ method: delete
278
+ uri: https://cartodb-rb-client.cartodb.com/api/v1/tables/cartodb_spec/columns/field3?
279
+ body:
280
+ encoding: US-ASCII
281
+ string: ''
282
+ headers:
283
+ Accept:
284
+ - *70262196348080
285
+ Authorization:
286
+ - OAuth oauth_consumer_key="0gRpcgKQK8bpcvSzM5ED4NqaSbNQ8ivS4q0pVdJF", oauth_nonce="2ID6Ycp46B3Tj6GEAHvCPzBi3BSyCW3WBcwOGebw",
287
+ oauth_signature="a%2B6yh8cshrmvNwG%2FLieqyyeqFos%3D", oauth_signature_method="HMAC-SHA1",
288
+ oauth_timestamp="1337787364", oauth_token="7PalByYmKY8Dzh76fnt05e0YPXRJino0dyqHZYCw",
289
+ oauth_version="1.0"
290
+ response:
291
+ status:
292
+ code: 200
293
+ message: OK
294
+ headers:
295
+ Server:
296
+ - nginx
297
+ Date:
298
+ - Wed, 23 May 2012 15:36:05 GMT
299
+ Content-Type:
300
+ - application/json; charset=utf-8
301
+ Transfer-Encoding:
302
+ - chunked
303
+ Connection:
304
+ - keep-alive
305
+ Vary:
306
+ - Accept-Encoding
307
+ Status:
308
+ - 200 OK
309
+ Cache-Control:
310
+ - no-cache
311
+ X-Ua-Compatible:
312
+ - IE=Edge,chrome=1
313
+ Set-Cookie:
314
+ - _cartodb_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlNWM4NzExNzYxMzBiYThjMGM5YzFkYTVhYmJkMWRmZDNJIiZ3YXJkZW4udXNlci5jYXJ0b2RiLXJiLWNsaWVudC5rZXkGOwBUSSIWY2FydG9kYi1yYi1jbGllbnQGOwBU--f7fa3e847149b3047978c5598adc13531bc2a612;
315
+ domain=.cartodb.com; path=/; HttpOnly
316
+ X-Runtime:
317
+ - '0.477615'
318
+ Content-Encoding:
319
+ - gzip
320
+ body:
321
+ encoding: ASCII-8BIT
322
+ string: ! ' '
323
+ http_version: '1.1'
324
+ recorded_at: Wed, 23 May 2012 15:36:05 GMT
325
+ - request:
326
+ method: get
327
+ uri: https://cartodb-rb-client.cartodb.com/api/v1/tables/cartodb_spec?
328
+ body:
329
+ encoding: US-ASCII
330
+ string: ''
331
+ headers:
332
+ Accept:
333
+ - *70262196348080
334
+ Authorization:
335
+ - OAuth oauth_consumer_key="0gRpcgKQK8bpcvSzM5ED4NqaSbNQ8ivS4q0pVdJF", oauth_nonce="RsPMFomBwsPlLUHdDyygfNzV2RZjqjKrGmwiZS3x8UE",
336
+ oauth_signature="QbKfathYEMjZYQAEQQuO3e7vEcM%3D", oauth_signature_method="HMAC-SHA1",
337
+ oauth_timestamp="1337787365", oauth_token="7PalByYmKY8Dzh76fnt05e0YPXRJino0dyqHZYCw",
338
+ oauth_version="1.0"
339
+ response:
340
+ status:
341
+ code: 200
342
+ message: OK
343
+ headers:
344
+ Server:
345
+ - nginx
346
+ Date:
347
+ - Wed, 23 May 2012 15:36:06 GMT
348
+ Content-Type:
349
+ - application/json; charset=utf-8
350
+ Transfer-Encoding:
351
+ - chunked
352
+ Connection:
353
+ - keep-alive
354
+ Vary:
355
+ - Accept-Encoding
356
+ Status:
357
+ - 200 OK
358
+ Etag:
359
+ - ! '"7e50f496bdf43316cd5d9b955211e296"'
360
+ Cache-Control:
361
+ - max-age=0, private, must-revalidate
362
+ X-Ua-Compatible:
363
+ - IE=Edge,chrome=1
364
+ Set-Cookie:
365
+ - _cartodb_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlOTE1ZjdkMzBlODFmYjFlM2QwYTkxMWQ1Yzc5Y2JlMWJJIiZ3YXJkZW4udXNlci5jYXJ0b2RiLXJiLWNsaWVudC5rZXkGOwBUSSIWY2FydG9kYi1yYi1jbGllbnQGOwBU--ab74a7a774f2772125c355fcb8ad327d97c6768c;
366
+ domain=.cartodb.com; path=/; HttpOnly
367
+ X-Runtime:
368
+ - '0.711614'
369
+ Content-Encoding:
370
+ - gzip
371
+ body:
372
+ encoding: ASCII-8BIT
373
+ string: ! '{"id":4703,"name":"cartodb_spec","privacy":"PUBLIC","tags":"","schema":[["cartodb_id","number"],["the_geom","geometry","geometry","point"],["description","string"],["field1","string"],["field2","number"],["name","string"],["created_at","date"],["updated_at","date"]]}'
374
+ http_version: '1.1'
375
+ recorded_at: Wed, 23 May 2012 15:36:06 GMT
376
+ recorded_with: VCR 2.1.1