streamly_ffi 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/streamly_ffi/connection.rb +8 -8
- data/lib/streamly_ffi/version.rb +1 -1
- metadata +2 -2
data/Gemfile.lock
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
module StreamlyFFI
|
2
2
|
class Connection
|
3
3
|
|
4
|
-
attr_accessor :
|
4
|
+
attr_accessor :curl_handle
|
5
5
|
|
6
6
|
def initialize
|
7
|
-
|
7
|
+
@curl_handle = StreamlyFFI::PersistentRequest.new
|
8
8
|
end
|
9
9
|
|
10
10
|
# A helper method to make HEAD requests a dead-simple one-liner
|
@@ -24,7 +24,7 @@ module StreamlyFFI
|
|
24
24
|
def head(url, headers=nil, &block)
|
25
25
|
opts = {:method => :head, :url => url, :headers => headers}
|
26
26
|
opts[:response_header_handler] = block if block_given?
|
27
|
-
|
27
|
+
@curl_handle.execute(opts)
|
28
28
|
end
|
29
29
|
|
30
30
|
# A helper method to make HEAD requests a dead-simple one-liner
|
@@ -44,7 +44,7 @@ module StreamlyFFI
|
|
44
44
|
def get(url, headers=nil, &block)
|
45
45
|
opts = {:method => :get, :url => url, :headers => headers}
|
46
46
|
opts[:response_body_handler] = block if block_given?
|
47
|
-
|
47
|
+
@curl_handle.execute(opts)
|
48
48
|
end
|
49
49
|
|
50
50
|
# A helper method to make HEAD requests a dead-simple one-liner
|
@@ -65,7 +65,7 @@ module StreamlyFFI
|
|
65
65
|
def post(url, payload, headers=nil, &block)
|
66
66
|
opts = {:method => :post, :url => url, :payload => payload, :headers => headers}
|
67
67
|
opts[:response_body_handler] = block if block_given?
|
68
|
-
|
68
|
+
@curl_handle.execute(opts)
|
69
69
|
end
|
70
70
|
|
71
71
|
# A helper method to make HEAD requests a dead-simple one-liner
|
@@ -86,7 +86,7 @@ module StreamlyFFI
|
|
86
86
|
def put(url, payload, headers=nil, &block)
|
87
87
|
opts = {:method => :put, :url => url, :payload => payload, :headers => headers}
|
88
88
|
opts[:response_body_handler] = block if block_given?
|
89
|
-
|
89
|
+
@curl_handle.execute(opts)
|
90
90
|
end
|
91
91
|
|
92
92
|
# A helper method to make HEAD requests a dead-simple one-liner
|
@@ -106,11 +106,11 @@ module StreamlyFFI
|
|
106
106
|
def delete(url, headers={}, &block)
|
107
107
|
opts = {:method => :delete, :url => url, :headers => headers}
|
108
108
|
opts[:response_body_handler] = block if block_given?
|
109
|
-
|
109
|
+
@curl_handle.execute(opts)
|
110
110
|
end
|
111
111
|
|
112
112
|
def escape(_string)
|
113
|
-
|
113
|
+
@curl_handle.escape(_string)
|
114
114
|
end
|
115
115
|
end
|
116
116
|
end
|
data/lib/streamly_ffi/version.rb
CHANGED