curb 1.0.5 → 1.0.6

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
  SHA256:
3
- metadata.gz: e28b1d05b46460867acfadc87bbe422d58d8f2cdb93397fa6ded906b01cd7dab
4
- data.tar.gz: 33e7037c1c2b23a793ec96c73bc80c008939c880702f884d2b258d4afd18c368
3
+ metadata.gz: 18ca81b9cb8fd33720ab17ba3eff9e9ae4fa1a10542feb60897ac94d7cd801ac
4
+ data.tar.gz: e8747cc63a63ca1561288dd9480b6c30c9dda0a371a6909eb1e2ad2a9a8b6947
5
5
  SHA512:
6
- metadata.gz: 6eb448726a4fdce1e0832e36a45b2c8e0a078fbc2c04b3fe34f87fc38397f5c4ecc4fe621aed5637750c5c7a7a9d05b30c03f9f7db153c23d3694eb6adb464e8
7
- data.tar.gz: 624e3f39af79eff874784a662776debc2b405378c6cdc963a50dee525d36aa225cc5f40558f9b35b396c222416006f66c29fc6193e651b5aa84093fdd52cb2ba
6
+ metadata.gz: 112d4c34fd70b3b77a58e133b9c873d5ac7f850d2644fe02a9713771b47be636cfbc2c66b44bbf59e047cc84d83aa496c2e67cbfd8f2987509577589a87d20f0
7
+ data.tar.gz: a593f46d71b17af90cb9244ee7a92c133eca76024146d9097806f91ec70f34b4611988141063a7624fd51ea103d872495e1efa94b2b6d718ee0a700ca86ef325
data/README.markdown CHANGED
@@ -37,18 +37,6 @@ POST request
37
37
  puts res.body
38
38
  ```
39
39
 
40
- PATCH request
41
- ```
42
- res = Curl.patch("https://your-server.com/endpoint", {post: "this"}.to_json) {|http|
43
- http.headers["Content-Type"] = "application/json"
44
- }
45
- puts res.code
46
- puts res.head
47
- puts res.body
48
- ```
49
-
50
-
51
-
52
40
  ## You will need
53
41
 
54
42
  * A working Ruby installation (`2.0.0+` will work but `2.1+` preferred) (it's possible it still works with 1.8.7 but you'd have to tell me if not...)
@@ -64,7 +52,12 @@ tested and reported to work across a variety of platforms / rubies)
64
52
 
65
53
  | Gem Version | Release Date | libcurl versions |
66
54
  | ----------- | ----------- | ---------------- |
67
- | 1.0.0 | Jan 2022 | 7.58 - 7.81 |
55
+ | 1.0.5 | Jan 2023 | 7.58 - 7.87 |
56
+ | 1.0.4 | Jan 2023 | 7.58 - 7.87 |
57
+ | 1.0.3* | Dec 2022 | 7.58 - 7.87 |
58
+ | 1.0.2* | Dec 2022 | 7.58 - 7.87 |
59
+ | 1.0.1 | Apr 2022 | 7.58 - 7.87 |
60
+ | 1.0.0 | Jan 2022 | 7.58 - 7.87 |
68
61
  | 0.9.8 | Jan 2019 | 7.58 - 7.81 |
69
62
  | 0.9.7 | Nov 2018 | 7.56 - 7.60 |
70
63
  | 0.9.6 | May 2018 | 7.51 - 7.59 |
@@ -72,6 +65,8 @@ tested and reported to work across a variety of platforms / rubies)
72
65
  | 0.9.4 | Aug 2017 | 7.41 - 7.58 |
73
66
  | 0.9.3 | Apr 2016 | 7.26 - 7.58 |
74
67
 
68
+ ```*avoid using these version are known to have issues with segmentation faults```
69
+
75
70
  ## Installation...
76
71
 
77
72
  ... will usually be as simple as:
@@ -137,22 +132,22 @@ require 'curb'
137
132
 
138
133
  ```ruby
139
134
  http = Curl.get("http://www.google.com/")
140
- puts http.body_str
135
+ puts http.body
141
136
 
142
137
  http = Curl.post("http://www.google.com/", {:foo => "bar"})
143
- puts http.body_str
138
+ puts http.body
144
139
 
145
140
  http = Curl.get("http://www.google.com/") do |http|
146
141
  http.headers['Cookie'] = 'foo=1;bar=2'
147
142
  end
148
- puts http.body_str
143
+ puts http.body
149
144
  ```
150
145
 
151
146
  ### Simple fetch via HTTP:
152
147
 
153
148
  ```ruby
154
149
  c = Curl::Easy.perform("http://www.google.co.uk")
155
- puts c.body_str
150
+ puts c.body
156
151
  ```
157
152
 
158
153
  Same thing, more manual:
@@ -160,13 +155,13 @@ Same thing, more manual:
160
155
  ```ruby
161
156
  c = Curl::Easy.new("http://www.google.co.uk")
162
157
  c.perform
163
- puts c.body_str
158
+ puts c.body
164
159
  ```
165
160
 
166
161
  ### Additional config:
167
162
 
168
163
  ```ruby
169
- Curl::Easy.perform("http://www.google.co.uk") do |curl|
164
+ http = Curl::Easy.perform("http://www.google.co.uk") do |curl|
170
165
  curl.headers["User-Agent"] = "myapp-0.0"
171
166
  curl.verbose = true
172
167
  end
data/ext/curb.h CHANGED
@@ -28,11 +28,11 @@
28
28
  #include "curb_macros.h"
29
29
 
30
30
  // These should be managed from the Rake 'release' task.
31
- #define CURB_VERSION "1.0.5"
32
- #define CURB_VER_NUM 1005
31
+ #define CURB_VERSION "1.0.6"
32
+ #define CURB_VER_NUM 1006
33
33
  #define CURB_VER_MAJ 1
34
34
  #define CURB_VER_MIN 0
35
- #define CURB_VER_MIC 5
35
+ #define CURB_VER_MIC 6
36
36
  #define CURB_VER_PATCH 0
37
37
 
38
38
 
data/ext/curb_easy.c CHANGED
@@ -79,7 +79,7 @@ static size_t read_data_handler(void *ptr,
79
79
  remaining = len - rbcu->offset;
80
80
  str_ptr = RSTRING_PTR(str);
81
81
 
82
- if( remaining < read_bytes ) {
82
+ if( remaining <= read_bytes ) {
83
83
  if( remaining > 0 ) {
84
84
  memcpy(ptr, str_ptr+rbcu->offset, remaining);
85
85
  read_bytes = remaining;
@@ -87,14 +87,10 @@ static size_t read_data_handler(void *ptr,
87
87
  }
88
88
  return remaining;
89
89
  }
90
- else if( remaining > read_bytes ) { // read_bytes <= remaining - send what we can fit in the buffer(ptr)
90
+ else { // read_bytes < remaining - send what we can fit in the buffer(ptr)
91
91
  memcpy(ptr, str_ptr+rbcu->offset, read_bytes);
92
92
  rbcu->offset += read_bytes;
93
93
  }
94
- else { // they're equal
95
- memcpy(ptr, str_ptr+rbcu->offset, --read_bytes);
96
- rbcu->offset += read_bytes;
97
- }
98
94
  return read_bytes;
99
95
  }
100
96
  else {
data/ext/extconf.rb CHANGED
@@ -9,7 +9,7 @@ if find_executable('curl-config')
9
9
  else
10
10
  $LIBS << " #{`curl-config --libs`.strip}"
11
11
  end
12
- ca_bundle_path=`curl-config --ca`.strip
12
+ ca_bundle_path=`curl-config --ca`.strip.gsub(/^"([^"]+)"$/,'\1')
13
13
  if !ca_bundle_path.nil? and ca_bundle_path != ''
14
14
  $defs.push( %{-D HAVE_CURL_CONFIG_CA} )
15
15
  $defs.push( %{-D CURL_CONFIG_CA='#{ca_bundle_path.inspect}'} )
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: curb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ross Bamford
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-01-04 00:00:00.000000000 Z
12
+ date: 2024-08-23 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Curb (probably CUrl-RuBy or something) provides Ruby-language bindings
15
15
  for the libcurl(3), a fully-featured client-side URL transfer library. cURL and
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  - !ruby/object:Gem::Version
99
99
  version: '0'
100
100
  requirements: []
101
- rubygems_version: 3.2.33
101
+ rubygems_version: 3.4.6
102
102
  signing_key:
103
103
  specification_version: 4
104
104
  summary: Ruby libcurl bindings