rhack 1.2.1 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +13 -5
  2. data/README.md +21 -9
  3. data/ext/curb/curb.c +977 -977
  4. data/ext/curb/curb.h +52 -52
  5. data/ext/curb/curb_config.h +270 -270
  6. data/ext/curb/curb_easy.c +3437 -3434
  7. data/ext/curb/curb_easy.h +94 -94
  8. data/ext/curb/curb_errors.c +647 -647
  9. data/ext/curb/curb_errors.h +129 -129
  10. data/ext/curb/curb_macros.h +162 -162
  11. data/ext/curb/curb_multi.c +704 -702
  12. data/ext/curb/curb_multi.h +26 -26
  13. data/ext/curb/curb_postfield.c +523 -523
  14. data/ext/curb/curb_postfield.h +40 -40
  15. data/ext/curb/curb_upload.c +80 -80
  16. data/ext/curb/curb_upload.h +30 -30
  17. data/ext/curb-original/curb.c +977 -977
  18. data/ext/curb-original/curb.h +52 -52
  19. data/ext/curb-original/curb_config.h +238 -238
  20. data/ext/curb-original/curb_easy.c +3404 -3404
  21. data/ext/curb-original/curb_easy.h +90 -90
  22. data/ext/curb-original/curb_errors.c +647 -647
  23. data/ext/curb-original/curb_errors.h +129 -129
  24. data/ext/curb-original/curb_macros.h +159 -159
  25. data/ext/curb-original/curb_multi.c +633 -633
  26. data/ext/curb-original/curb_multi.h +26 -26
  27. data/ext/curb-original/curb_postfield.c +523 -523
  28. data/ext/curb-original/curb_postfield.h +40 -40
  29. data/ext/curb-original/curb_upload.c +80 -80
  30. data/ext/curb-original/curb_upload.h +30 -30
  31. data/lib/rhack/clients/base.rb +61 -10
  32. data/lib/rhack/clients/oauth.rb +4 -4
  33. data/lib/rhack/curl/easy.rb +1 -0
  34. data/lib/rhack/curl/global.rb +2 -0
  35. data/lib/rhack/curl/response.rb +4 -2
  36. data/lib/rhack/frame.rb +70 -32
  37. data/lib/rhack/js/browser/env.js +697 -697
  38. data/lib/rhack/js/browser/jquery.js +7180 -7180
  39. data/lib/rhack/js/browser/xmlsax.js +1564 -1564
  40. data/lib/rhack/js/browser/xmlw3cdom_1.js +1443 -1443
  41. data/lib/rhack/js/browser/xmlw3cdom_2.js +2744 -2744
  42. data/lib/rhack/page.rb +227 -68
  43. data/lib/rhack/scout.rb +52 -26
  44. data/lib/rhack/scout_squad.rb +10 -2
  45. data/lib/rhack/version.rb +1 -1
  46. data/rhack.gemspec +1 -1
  47. metadata +17 -17
@@ -1,40 +1,40 @@
1
- /* curb_postfield.h - Field class for POST method
2
- * Copyright (c)2006 Ross Bamford.
3
- * Licensed under the Ruby License. See LICENSE for details.
4
- *
5
- * $Id: curb_postfield.h 4 2006-11-17 18:35:31Z roscopeco $
6
- */
7
- #ifndef __CURB_POSTFIELD_H
8
- #define __CURB_POSTFIELD_H
9
-
10
- #include "curb.h"
11
-
12
- /*
13
- * postfield doesn't actually wrap a curl_httppost - instead,
14
- * it just holds together some ruby objects and has a C-side
15
- * method to add it to a given form list during the perform.
16
- */
17
- typedef struct {
18
- /* Objects we associate */
19
- VALUE name;
20
- VALUE content;
21
- VALUE content_type;
22
- VALUE content_proc;
23
- VALUE local_file;
24
- VALUE remote_file;
25
-
26
- /* this will sometimes hold a string, which is the result
27
- * of the content_proc invocation. We need it to hang around.
28
- */
29
- VALUE buffer_str;
30
- } ruby_curl_postfield;
31
-
32
- extern VALUE cCurlPostField;
33
-
34
- void append_to_form(VALUE self,
35
- struct curl_httppost **first,
36
- struct curl_httppost **last);
37
-
38
- void init_curb_postfield();
39
-
40
- #endif
1
+ /* curb_postfield.h - Field class for POST method
2
+ * Copyright (c)2006 Ross Bamford.
3
+ * Licensed under the Ruby License. See LICENSE for details.
4
+ *
5
+ * $Id: curb_postfield.h 4 2006-11-17 18:35:31Z roscopeco $
6
+ */
7
+ #ifndef __CURB_POSTFIELD_H
8
+ #define __CURB_POSTFIELD_H
9
+
10
+ #include "curb.h"
11
+
12
+ /*
13
+ * postfield doesn't actually wrap a curl_httppost - instead,
14
+ * it just holds together some ruby objects and has a C-side
15
+ * method to add it to a given form list during the perform.
16
+ */
17
+ typedef struct {
18
+ /* Objects we associate */
19
+ VALUE name;
20
+ VALUE content;
21
+ VALUE content_type;
22
+ VALUE content_proc;
23
+ VALUE local_file;
24
+ VALUE remote_file;
25
+
26
+ /* this will sometimes hold a string, which is the result
27
+ * of the content_proc invocation. We need it to hang around.
28
+ */
29
+ VALUE buffer_str;
30
+ } ruby_curl_postfield;
31
+
32
+ extern VALUE cCurlPostField;
33
+
34
+ void append_to_form(VALUE self,
35
+ struct curl_httppost **first,
36
+ struct curl_httppost **last);
37
+
38
+ void init_curb_postfield();
39
+
40
+ #endif
@@ -1,80 +1,80 @@
1
- /* curb_upload.c - Curl upload handle
2
- * Copyright (c)2009 Todd A Fisher.
3
- * Licensed under the Ruby License. See LICENSE for details.
4
- */
5
- #include "curb_upload.h"
6
- extern VALUE mCurl;
7
- VALUE cCurlUpload;
8
-
9
- #ifdef RDOC_NEVER_DEFINED
10
- mCurl = rb_define_module("Curl");
11
- #endif
12
-
13
- static void curl_upload_mark(ruby_curl_upload *rbcu) {
14
- if (rbcu->stream && !NIL_P(rbcu->stream)) rb_gc_mark(rbcu->stream);
15
- }
16
- static void curl_upload_free(ruby_curl_upload *rbcu) {
17
- free(rbcu);
18
- }
19
-
20
- /*
21
- * call-seq:
22
- * internal class for sending large file uploads
23
- */
24
- VALUE ruby_curl_upload_new(VALUE klass) {
25
- VALUE upload;
26
- ruby_curl_upload *rbcu = ALLOC(ruby_curl_upload);
27
- rbcu->stream = Qnil;
28
- rbcu->offset = 0;
29
- upload = Data_Wrap_Struct(klass, curl_upload_mark, curl_upload_free, rbcu);
30
- return upload;
31
- }
32
-
33
- /*
34
- * call-seq:
35
- * internal class for sending large file uploads
36
- */
37
- VALUE ruby_curl_upload_stream_set(VALUE self, VALUE stream) {
38
- ruby_curl_upload *rbcu;
39
- Data_Get_Struct(self, ruby_curl_upload, rbcu);
40
- rbcu->stream = stream;
41
- return stream;
42
- }
43
- /*
44
- * call-seq:
45
- * internal class for sending large file uploads
46
- */
47
- VALUE ruby_curl_upload_stream_get(VALUE self) {
48
- ruby_curl_upload *rbcu;
49
- Data_Get_Struct(self, ruby_curl_upload, rbcu);
50
- return rbcu->stream;
51
- }
52
- /*
53
- * call-seq:
54
- * internal class for sending large file uploads
55
- */
56
- VALUE ruby_curl_upload_offset_set(VALUE self, VALUE offset) {
57
- ruby_curl_upload *rbcu;
58
- Data_Get_Struct(self, ruby_curl_upload, rbcu);
59
- rbcu->offset = FIX2LONG(offset);
60
- return offset;
61
- }
62
- /*
63
- * call-seq:
64
- * internal class for sending large file uploads
65
- */
66
- VALUE ruby_curl_upload_offset_get(VALUE self) {
67
- ruby_curl_upload *rbcu;
68
- Data_Get_Struct(self, ruby_curl_upload, rbcu);
69
- return INT2FIX(rbcu->offset);
70
- }
71
-
72
- /* =================== INIT LIB =====================*/
73
- void init_curb_upload() {
74
- cCurlUpload = rb_define_class_under(mCurl, "Upload", rb_cObject);
75
- rb_define_singleton_method(cCurlUpload, "new", ruby_curl_upload_new, 0);
76
- rb_define_method(cCurlUpload, "stream=", ruby_curl_upload_stream_set, 1);
77
- rb_define_method(cCurlUpload, "stream", ruby_curl_upload_stream_get, 0);
78
- rb_define_method(cCurlUpload, "offset=", ruby_curl_upload_offset_set, 1);
79
- rb_define_method(cCurlUpload, "offset", ruby_curl_upload_offset_get, 0);
80
- }
1
+ /* curb_upload.c - Curl upload handle
2
+ * Copyright (c)2009 Todd A Fisher.
3
+ * Licensed under the Ruby License. See LICENSE for details.
4
+ */
5
+ #include "curb_upload.h"
6
+ extern VALUE mCurl;
7
+ VALUE cCurlUpload;
8
+
9
+ #ifdef RDOC_NEVER_DEFINED
10
+ mCurl = rb_define_module("Curl");
11
+ #endif
12
+
13
+ static void curl_upload_mark(ruby_curl_upload *rbcu) {
14
+ if (rbcu->stream && !NIL_P(rbcu->stream)) rb_gc_mark(rbcu->stream);
15
+ }
16
+ static void curl_upload_free(ruby_curl_upload *rbcu) {
17
+ free(rbcu);
18
+ }
19
+
20
+ /*
21
+ * call-seq:
22
+ * internal class for sending large file uploads
23
+ */
24
+ VALUE ruby_curl_upload_new(VALUE klass) {
25
+ VALUE upload;
26
+ ruby_curl_upload *rbcu = ALLOC(ruby_curl_upload);
27
+ rbcu->stream = Qnil;
28
+ rbcu->offset = 0;
29
+ upload = Data_Wrap_Struct(klass, curl_upload_mark, curl_upload_free, rbcu);
30
+ return upload;
31
+ }
32
+
33
+ /*
34
+ * call-seq:
35
+ * internal class for sending large file uploads
36
+ */
37
+ VALUE ruby_curl_upload_stream_set(VALUE self, VALUE stream) {
38
+ ruby_curl_upload *rbcu;
39
+ Data_Get_Struct(self, ruby_curl_upload, rbcu);
40
+ rbcu->stream = stream;
41
+ return stream;
42
+ }
43
+ /*
44
+ * call-seq:
45
+ * internal class for sending large file uploads
46
+ */
47
+ VALUE ruby_curl_upload_stream_get(VALUE self) {
48
+ ruby_curl_upload *rbcu;
49
+ Data_Get_Struct(self, ruby_curl_upload, rbcu);
50
+ return rbcu->stream;
51
+ }
52
+ /*
53
+ * call-seq:
54
+ * internal class for sending large file uploads
55
+ */
56
+ VALUE ruby_curl_upload_offset_set(VALUE self, VALUE offset) {
57
+ ruby_curl_upload *rbcu;
58
+ Data_Get_Struct(self, ruby_curl_upload, rbcu);
59
+ rbcu->offset = FIX2LONG(offset);
60
+ return offset;
61
+ }
62
+ /*
63
+ * call-seq:
64
+ * internal class for sending large file uploads
65
+ */
66
+ VALUE ruby_curl_upload_offset_get(VALUE self) {
67
+ ruby_curl_upload *rbcu;
68
+ Data_Get_Struct(self, ruby_curl_upload, rbcu);
69
+ return INT2FIX(rbcu->offset);
70
+ }
71
+
72
+ /* =================== INIT LIB =====================*/
73
+ void init_curb_upload() {
74
+ cCurlUpload = rb_define_class_under(mCurl, "Upload", rb_cObject);
75
+ rb_define_singleton_method(cCurlUpload, "new", ruby_curl_upload_new, 0);
76
+ rb_define_method(cCurlUpload, "stream=", ruby_curl_upload_stream_set, 1);
77
+ rb_define_method(cCurlUpload, "stream", ruby_curl_upload_stream_get, 0);
78
+ rb_define_method(cCurlUpload, "offset=", ruby_curl_upload_offset_set, 1);
79
+ rb_define_method(cCurlUpload, "offset", ruby_curl_upload_offset_get, 0);
80
+ }
@@ -1,30 +1,30 @@
1
- /* curb_upload.h - Curl upload handle
2
- * Copyright (c)2009 Todd A Fisher.
3
- * Licensed under the Ruby License. See LICENSE for details.
4
- */
5
- #ifndef __CURB_UPLOAD_H
6
- #define __CURB_UPLOAD_H
7
-
8
- #include "curb.h"
9
-
10
- #include <curl/easy.h>
11
-
12
- /*
13
- * Maintain the state of an upload e.g. for putting large streams with very little memory
14
- * out to a server. via PUT requests
15
- */
16
- typedef struct {
17
- VALUE stream;
18
- size_t offset;
19
- } ruby_curl_upload;
20
-
21
- extern VALUE cCurlUpload;
22
- void init_curb_upload();
23
-
24
- VALUE ruby_curl_upload_new(VALUE klass);
25
- VALUE ruby_curl_upload_stream_set(VALUE self, VALUE stream);
26
- VALUE ruby_curl_upload_stream_get(VALUE self);
27
- VALUE ruby_curl_upload_offset_set(VALUE self, VALUE offset);
28
- VALUE ruby_curl_upload_offset_get(VALUE self);
29
-
30
- #endif
1
+ /* curb_upload.h - Curl upload handle
2
+ * Copyright (c)2009 Todd A Fisher.
3
+ * Licensed under the Ruby License. See LICENSE for details.
4
+ */
5
+ #ifndef __CURB_UPLOAD_H
6
+ #define __CURB_UPLOAD_H
7
+
8
+ #include "curb.h"
9
+
10
+ #include <curl/easy.h>
11
+
12
+ /*
13
+ * Maintain the state of an upload e.g. for putting large streams with very little memory
14
+ * out to a server. via PUT requests
15
+ */
16
+ typedef struct {
17
+ VALUE stream;
18
+ size_t offset;
19
+ } ruby_curl_upload;
20
+
21
+ extern VALUE cCurlUpload;
22
+ void init_curb_upload();
23
+
24
+ VALUE ruby_curl_upload_new(VALUE klass);
25
+ VALUE ruby_curl_upload_stream_set(VALUE self, VALUE stream);
26
+ VALUE ruby_curl_upload_stream_get(VALUE self);
27
+ VALUE ruby_curl_upload_offset_set(VALUE self, VALUE offset);
28
+ VALUE ruby_curl_upload_offset_get(VALUE self);
29
+
30
+ #endif