soda-ruby 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.mkd +1 -0
- data/lib/soda/client.rb +0 -39
- data/lib/soda/version.rb +1 -1
- metadata +13 -9
- checksums.yaml +0 -7
data/CHANGELOG.mkd
CHANGED
data/lib/soda/client.rb
CHANGED
@@ -6,7 +6,6 @@ require 'uri'
|
|
6
6
|
require 'json'
|
7
7
|
require 'cgi'
|
8
8
|
require 'hashie'
|
9
|
-
require 'curb'
|
10
9
|
|
11
10
|
module SODA
|
12
11
|
class Client
|
@@ -30,44 +29,6 @@ module SODA
|
|
30
29
|
connection(:delete, resource, body, params)
|
31
30
|
end
|
32
31
|
|
33
|
-
def upload_file(path, filename, params = {}, field = 'file', remote_filename = filename)
|
34
|
-
# c = Curl::Easy.new("https://#{@config[:domain]}#{path}?#{query_string(params)}")
|
35
|
-
# c.multipart_form_post = true
|
36
|
-
# c.http_auth_types = :basic
|
37
|
-
# c.username = @config[:username]
|
38
|
-
# c.password = @config[:password]
|
39
|
-
# c.headers['X-App-Token'] = @config[:app_token]
|
40
|
-
# c.http_post(Curl::PostField.file(field, filename, remote_filename))
|
41
|
-
|
42
|
-
# puts c.body_str.inspect
|
43
|
-
# return Hashie::Mash.new(JSON.parse(c.body_str))
|
44
|
-
|
45
|
-
query = query_string(params)
|
46
|
-
|
47
|
-
# If we didn't get a full path, assume "/resource/"
|
48
|
-
if !resource.start_with?("/")
|
49
|
-
resource = "/resource/" + resource
|
50
|
-
end
|
51
|
-
|
52
|
-
# Create our request
|
53
|
-
uri = URI.parse("https://#{@config[:domain]}#{resource}.json?#{query}")
|
54
|
-
http = Net::HTTP.new(uri.host, uri.port)
|
55
|
-
http.use_ssl = true
|
56
|
-
|
57
|
-
request = Net::HTTP::Post.new(uri.request_uri)
|
58
|
-
request.add_field("X-App-Token", @config[:app_token])
|
59
|
-
request.content_type = "application/json"
|
60
|
-
request.body = body.to_json
|
61
|
-
|
62
|
-
# Authenticate if we're supposed to
|
63
|
-
if @config[:username]
|
64
|
-
request.basic_auth @config[:username], @config[:password]
|
65
|
-
end
|
66
|
-
|
67
|
-
# BAM!
|
68
|
-
return handle_response(http.request(request))
|
69
|
-
end
|
70
|
-
|
71
32
|
def post_form(path, fields = {}, params = {})
|
72
33
|
query = query_string(params)
|
73
34
|
resource = resoure_path(path)
|
data/lib/soda/version.rb
CHANGED
metadata
CHANGED
@@ -1,27 +1,30 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soda-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Chris Metcalf
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
12
|
+
date: 2014-01-10 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: hashie
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
|
-
- - '>='
|
19
|
+
- - ! '>='
|
18
20
|
- !ruby/object:Gem::Version
|
19
21
|
version: '0'
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
|
-
- - '>='
|
27
|
+
- - ! '>='
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '0'
|
27
30
|
description: A simple wrapper for SODA 2.0
|
@@ -38,25 +41,26 @@ files:
|
|
38
41
|
- README.mkd
|
39
42
|
homepage: http://github.com/socrata/soda-ruby
|
40
43
|
licenses: []
|
41
|
-
metadata: {}
|
42
44
|
post_install_message:
|
43
45
|
rdoc_options: []
|
44
46
|
require_paths:
|
45
47
|
- lib
|
46
48
|
required_ruby_version: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
47
50
|
requirements:
|
48
|
-
- - '>='
|
51
|
+
- - ! '>='
|
49
52
|
- !ruby/object:Gem::Version
|
50
53
|
version: '0'
|
51
54
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
52
56
|
requirements:
|
53
|
-
- - '>='
|
57
|
+
- - ! '>='
|
54
58
|
- !ruby/object:Gem::Version
|
55
59
|
version: 1.3.6
|
56
60
|
requirements: []
|
57
61
|
rubyforge_project: soda-ruby
|
58
|
-
rubygems_version:
|
62
|
+
rubygems_version: 1.8.25
|
59
63
|
signing_key:
|
60
|
-
specification_version:
|
64
|
+
specification_version: 3
|
61
65
|
summary: Ruby for SODA 2.0
|
62
66
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 03728c85703cdcf58f02132e9e296fc4600dcf55
|
4
|
-
data.tar.gz: 38e6f85d3d02a3189dd6176954233a450eea6dfc
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: ffab275d914f469e2c6292a3c2ecba5f72aa6ac9fe525f3665e2d78bd3009ee769d11ac0f12279ea102d8a76a215f51ad2c1d57ea53b9fc566513c38595a64e9
|
7
|
-
data.tar.gz: d5cf160a323314a370e9da4fd9fd0243f6e346231dc017127569973d48d396ef06c5fd70ebb3a88edd7af8e2102f42cd09de0897efb9d2d9173552d408fdd9da
|