curb 0.8.6 → 0.8.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b76360d30b92902398314af1674ec02db1ad9f74
4
+ data.tar.gz: 05ae393053e953fa773dcca22b50d18252c90244
5
+ SHA512:
6
+ metadata.gz: e8777897444b5ad6dad48f0a56d78d9826d96a4e3cd3cd53d318c3f733d0242f8b7ece9600c6aa06f53125c37f4f7c144bd82da62f9619a0a94b560f1546617b
7
+ data.tar.gz: 77a42a5ad6b26233a3c7917c945d694d560474c54eab71023439ad840ef5af1fd0f5037d6e4dcae680273785e8870ab952d9dab6955c11b127533e2ef60b0adc
data/README.markdown CHANGED
@@ -26,7 +26,13 @@ Ruby license. See the LICENSE file for the gory details.
26
26
  ... will usually be as simple as:
27
27
 
28
28
  $ gem install curb
29
-
29
+
30
+ On Windows, make sure you're using the [DevKit](http://rubyinstaller.org/downloads/) and
31
+ the [development version of libcurl](http://curl.haxx.se/gknw.net/7.39.0/dist-w32/curl-7.39.0-devel-mingw32.zip). Unzip, then run this in your command
32
+ line (alter paths to your curl location, but remember to use forward slashes):
33
+
34
+ gem install curb --platform=ruby -- --with-curl-lib=C:/curl-7.39.0-devel-mingw32/bin --with-curl-include=C:/curl-7.39.0-devel-mingw32/include
35
+
30
36
  Or, if you downloaded the archive:
31
37
 
32
38
  $ rake install
@@ -44,6 +50,10 @@ On Ubuntu, the dependencies can be satisfied by installing the following package
44
50
 
45
51
  $ sudo apt-get install libcurl3 libcurl3-gnutls libcurl4-openssl-dev
46
52
 
53
+ On RedHat:
54
+
55
+ $ sudo yum install ruby-devel libcurl-devel openssl-devel
56
+
47
57
  Curb has fairly extensive RDoc comments in the source. You can build the
48
58
  documentation with:
49
59
 
data/Rakefile CHANGED
@@ -68,11 +68,6 @@ end
68
68
  desc "Compile the shared object"
69
69
  task :compile => [CURB_SO]
70
70
 
71
- desc "Create the markdown file"
72
- task :markdown do
73
- cp "README", "README.markdown"
74
- end
75
-
76
71
  desc "Install to your site_ruby directory"
77
72
  task :install => :alltests do
78
73
  m = make 'install'
@@ -171,13 +166,13 @@ else
171
166
 
172
167
  desc 'Build gem'
173
168
  task :package => :gemspec do
174
- require 'rubygems/specification'
169
+ require 'rubygems/package'
175
170
  spec_source = File.read File.join(File.dirname(__FILE__),'curb.gemspec')
176
171
  spec = nil
177
172
  # see: http://gist.github.com/16215
178
173
  Thread.new { spec = eval("$SAFE = 3\n#{spec_source}") }.join
179
174
  spec.validate
180
- Gem::Builder.new(spec).build
175
+ Gem::Package.build(spec)
181
176
  end
182
177
 
183
178
  task :static do
data/ext/curb.h CHANGED
@@ -20,11 +20,11 @@
20
20
  #include "curb_macros.h"
21
21
 
22
22
  // These should be managed from the Rake 'release' task.
23
- #define CURB_VERSION "0.8.6"
24
- #define CURB_VER_NUM 806
23
+ #define CURB_VERSION "0.8.8"
24
+ #define CURB_VER_NUM 808
25
25
  #define CURB_VER_MAJ 0
26
26
  #define CURB_VER_MIN 8
27
- #define CURB_VER_MIC 6
27
+ #define CURB_VER_MIC 8
28
28
  #define CURB_VER_PATCH 0
29
29
 
30
30
 
data/ext/curb_easy.c CHANGED
@@ -791,9 +791,13 @@ static VALUE ruby_curl_easy_put_data_set(VALUE self, VALUE data) {
791
791
  curl_easy_setopt(curl, CURLOPT_NOBODY, 0);
792
792
  curl_easy_setopt(curl, CURLOPT_UPLOAD, 1);
793
793
  curl_easy_setopt(curl, CURLOPT_READFUNCTION, (curl_read_callback)read_data_handler);
794
+ #if HAVE_CURLOPT_SEEKFUNCTION
794
795
  curl_easy_setopt(curl, CURLOPT_SEEKFUNCTION, (curl_seek_callback)seek_data_handler);
796
+ #endif
795
797
  curl_easy_setopt(curl, CURLOPT_READDATA, rbce);
798
+ #if HAVE_CURLOPT_SEEKDATA
796
799
  curl_easy_setopt(curl, CURLOPT_SEEKDATA, rbce);
800
+ #endif
797
801
 
798
802
  /*
799
803
  * we need to set specific headers for the PUT to work... so
@@ -3121,6 +3125,13 @@ static VALUE ruby_curl_easy_set_opt(VALUE self, VALUE opt, VALUE val) {
3121
3125
  case CURLOPT_NOPROGRESS:
3122
3126
  case CURLOPT_NOSIGNAL:
3123
3127
  case CURLOPT_HTTPGET:
3128
+ break;
3129
+ case CURLOPT_POST: {
3130
+ curl_easy_setopt(rbce->curl, CURLOPT_POST, rb_type(val) == T_TRUE);
3131
+ } break;
3132
+ case CURLOPT_POSTFIELDS: {
3133
+ curl_easy_setopt(rbce->curl, CURLOPT_POSTFIELDS, NIL_P(val) ? NULL : StringValueCStr(val));
3134
+ } break;
3124
3135
  case CURLOPT_NOBODY: {
3125
3136
  int type = rb_type(val);
3126
3137
  VALUE value;
@@ -3162,6 +3173,9 @@ static VALUE ruby_curl_easy_set_opt(VALUE self, VALUE opt, VALUE val) {
3162
3173
  case CURLOPT_FAILONERROR: {
3163
3174
  curl_easy_setopt(rbce->curl, CURLOPT_FAILONERROR, FIX2LONG(val));
3164
3175
  } break;
3176
+ case CURLOPT_SSL_CIPHER_LIST: {
3177
+ curl_easy_setopt(rbce->curl, CURLOPT_SSL_CIPHER_LIST, StringValueCStr(val));
3178
+ } break;
3165
3179
  #if HAVE_CURLOPT_GSSAPI_DELEGATION
3166
3180
  case CURLOPT_GSSAPI_DELEGATION: {
3167
3181
  curl_easy_setopt(rbce->curl, CURLOPT_GSSAPI_DELEGATION, FIX2LONG(val));
data/ext/curb_multi.c CHANGED
@@ -581,6 +581,8 @@ VALUE ruby_curl_multi_perform(int argc, VALUE *argv, VALUE self) {
581
581
  rc = (int)(VALUE) rb_thread_call_without_gvl((void *(*)(void *))curb_select, &fdset_args, RUBY_UBF_IO, 0);
582
582
  #elif HAVE_RB_THREAD_BLOCKING_REGION
583
583
  rc = rb_thread_blocking_region(curb_select, &fdset_args, RUBY_UBF_IO, 0);
584
+ #elif HAVE_RB_THREAD_FD_SELECT
585
+ rc = rb_thread_fd_select(maxfd+1, &fdread, &fdwrite, &fdexcep, &tv);
584
586
  #else
585
587
  rc = rb_thread_select(maxfd+1, &fdread, &fdwrite, &fdexcep, &tv);
586
588
  #endif
data/lib/curl.rb CHANGED
@@ -61,4 +61,8 @@ module Curl
61
61
  params.respond_to?(:map) ? URI.encode_www_form(params) : (params.respond_to?(:to_s) ? params.to_s : params)
62
62
  end
63
63
 
64
+ def self.reset
65
+ Thread.current[:curb_curl] = Curl::Easy.new
66
+ end
67
+
64
68
  end
@@ -4,6 +4,12 @@ class FooNoToS
4
4
  end
5
5
 
6
6
  class TestCurbCurlEasy < Test::Unit::TestCase
7
+ def test_global_reset
8
+ c = Curl.get($TEST_URL)
9
+ # in a Timeout block you should reset the thread current handle
10
+ Curl.reset
11
+ end
12
+
7
13
  def test_threads
8
14
  t = []
9
15
  5.times do
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: curb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.6
5
- prerelease:
4
+ version: 0.8.8
6
5
  platform: ruby
7
6
  authors:
8
7
  - Ross Bamford
@@ -10,7 +9,7 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2014-07-22 00:00:00.000000000 Z
12
+ date: 2015-04-08 00:00:00.000000000 Z
14
13
  dependencies: []
15
14
  description: Curb (probably CUrl-RuBy or something) provides Ruby-language bindings
16
15
  for the libcurl(3), a fully-featured client-side URL transfer library. cURL and
@@ -27,24 +26,24 @@ files:
27
26
  - README.markdown
28
27
  - Rakefile
29
28
  - doc.rb
30
- - ext/extconf.rb
31
- - lib/curb.rb
32
- - lib/curl/easy.rb
33
- - lib/curl/multi.rb
34
- - lib/curl.rb
35
29
  - ext/curb.c
36
- - ext/curb_easy.c
37
- - ext/curb_errors.c
38
- - ext/curb_multi.c
39
- - ext/curb_postfield.c
40
- - ext/curb_upload.c
41
30
  - ext/curb.h
31
+ - ext/curb_easy.c
42
32
  - ext/curb_easy.h
33
+ - ext/curb_errors.c
43
34
  - ext/curb_errors.h
44
35
  - ext/curb_macros.h
36
+ - ext/curb_multi.c
45
37
  - ext/curb_multi.h
38
+ - ext/curb_postfield.c
46
39
  - ext/curb_postfield.h
40
+ - ext/curb_upload.c
47
41
  - ext/curb_upload.h
42
+ - ext/extconf.rb
43
+ - lib/curb.rb
44
+ - lib/curl.rb
45
+ - lib/curl/easy.rb
46
+ - lib/curl/multi.rb
48
47
  - tests/alltests.rb
49
48
  - tests/bug_crash_on_debug.rb
50
49
  - tests/bug_crash_on_progress.rb
@@ -72,30 +71,29 @@ files:
72
71
  - tests/unittests.rb
73
72
  homepage: http://curb.rubyforge.org/
74
73
  licenses: []
74
+ metadata: {}
75
75
  post_install_message:
76
76
  rdoc_options:
77
- - --main
77
+ - "--main"
78
78
  - README.markdown
79
79
  require_paths:
80
80
  - lib
81
81
  - ext
82
82
  required_ruby_version: !ruby/object:Gem::Requirement
83
- none: false
84
83
  requirements:
85
- - - ! '>='
84
+ - - ">="
86
85
  - !ruby/object:Gem::Version
87
86
  version: '0'
88
87
  required_rubygems_version: !ruby/object:Gem::Requirement
89
- none: false
90
88
  requirements:
91
- - - ! '>='
89
+ - - ">="
92
90
  - !ruby/object:Gem::Version
93
91
  version: '0'
94
92
  requirements: []
95
93
  rubyforge_project: curb
96
- rubygems_version: 1.8.24
94
+ rubygems_version: 2.4.5
97
95
  signing_key:
98
- specification_version: 3
96
+ specification_version: 4
99
97
  summary: Ruby libcurl bindings
100
98
  test_files:
101
99
  - tests/alltests.rb
@@ -123,4 +121,3 @@ test_files:
123
121
  - tests/timeout.rb
124
122
  - tests/timeout_server.rb
125
123
  - tests/unittests.rb
126
- has_rdoc: true