plamo 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/ext/plamo/plamo_request.c +28 -2
- data/lib/plamo/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cab3539112c672ea5eb45491df5a5b740bbf1fe19f8ec35adfdad9d937128bd8
|
4
|
+
data.tar.gz: 1016de83b7ad33261e4dbaaf46490c7ecb2387b003d4854e3836226ee87c358b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58e897b1567398794880bdbbd9e74c1afcf13180f747817cf3ced1af6d711a352aa26a93d0776e9fb7ef2c8723df806bda411c5718b22c2830a65d2824f918b1
|
7
|
+
data.tar.gz: ab5390f33a0a24c42d4131c6b970f68a21a3fd028ebe842af7551a0bac3332a5fdfd84f3f17f14c22fb11af8c29b7e905e181a575ae9042ecf199e052b5e295b
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# plamo-ruby
|
2
|
-
plamo-ruby is libplamo wrapper for Ruby.
|
2
|
+
plamo-ruby is [libplamo](https://github.com/plamo/libplamo) wrapper for Ruby.
|
3
3
|
## Installation
|
4
|
-
Please install libplamo before using plamo-ruby.
|
4
|
+
Please install [libplamo](https://github.com/plamo/libplamo) before using plamo-ruby.
|
5
5
|
## License
|
6
6
|
MIT License
|
data/ext/plamo/plamo_request.c
CHANGED
@@ -22,7 +22,12 @@ static VALUE initialize(VALUE self, VALUE rb_scheme, VALUE rb_version, VALUE rb_
|
|
22
22
|
: sym_http_1_1 == rb_version ? PlamoHttpVersionHttp11
|
23
23
|
: sym_http_1_0 == rb_version ? PlamoHttpVersionHttp10
|
24
24
|
: PlamoHttpVersionHttp09;
|
25
|
-
|
25
|
+
PlamoHttpMethod method;
|
26
|
+
if (RB_TYPE_P(rb_method, RUBY_T_FIXNUM)) {
|
27
|
+
method.defined_http_method = NUM2SIZET(rb_method);
|
28
|
+
} else {
|
29
|
+
method.undefined_http_method = StringValueCStr(rb_method);
|
30
|
+
}
|
26
31
|
const char *path = StringValueCStr(rb_path);
|
27
32
|
Wrapper *plamo_http_query_wrapper;
|
28
33
|
Data_Get_Struct(rb_query, Wrapper, plamo_http_query_wrapper);
|
@@ -58,7 +63,28 @@ static VALUE version(VALUE self) {
|
|
58
63
|
static VALUE method(VALUE self) {
|
59
64
|
Wrapper *wrapper;
|
60
65
|
Data_Get_Struct(self, Wrapper, wrapper);
|
61
|
-
|
66
|
+
PlamoDefinedHttpMethod method = ((PlamoRequest*)wrapper->inner)->method.defined_http_method;
|
67
|
+
if (method == PLAMO_HTTP_METHOD_GET) {
|
68
|
+
return rb_str_new2("GET");
|
69
|
+
} else if (method == PLAMO_HTTP_METHOD_POST) {
|
70
|
+
return rb_str_new2("POST");
|
71
|
+
} else if (method == PLAMO_HTTP_METHOD_PUT) {
|
72
|
+
return rb_str_new2("PUT");
|
73
|
+
} else if (method == PLAMO_HTTP_METHOD_DELETE) {
|
74
|
+
return rb_str_new2("DELETE");
|
75
|
+
} else if (method == PLAMO_HTTP_METHOD_HEAD) {
|
76
|
+
return rb_str_new2("HEAD");
|
77
|
+
} else if (method == PLAMO_HTTP_METHOD_CONNECT) {
|
78
|
+
return rb_str_new2("CONNECT");
|
79
|
+
} else if (method == PLAMO_HTTP_METHOD_OPTIONS) {
|
80
|
+
return rb_str_new2("OPTIONS");
|
81
|
+
} else if (method == PLAMO_HTTP_METHOD_TRACE) {
|
82
|
+
return rb_str_new2("TRACE");
|
83
|
+
} else if (method == PLAMO_HTTP_METHOD_PATCH) {
|
84
|
+
return rb_str_new2("PATCH");
|
85
|
+
} else {
|
86
|
+
return rb_str_new2(((PlamoRequest*)wrapper->inner)->method.undefined_http_method);
|
87
|
+
}
|
62
88
|
}
|
63
89
|
|
64
90
|
static VALUE path(VALUE self) {
|
data/lib/plamo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plamo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shogo Otake
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
112
|
- !ruby/object:Gem::Version
|
113
113
|
version: '0'
|
114
114
|
requirements: []
|
115
|
-
rubygems_version: 3.0.
|
115
|
+
rubygems_version: 3.0.6
|
116
116
|
signing_key:
|
117
117
|
specification_version: 4
|
118
118
|
summary: Ruby Bindings for libplamo
|