grifter 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/grifter.gemspec +2 -2
- data/lib/grifter/http_service.rb +11 -0
- metadata +3 -3
data/grifter.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "grifter"
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.11"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Robert Schultheis"]
|
12
|
-
s.date = "2013-
|
12
|
+
s.date = "2013-07-01"
|
13
13
|
s.description = "convention based approach to interfacing with an HTTP JSON API."
|
14
14
|
s.email = "rob@knewton.com"
|
15
15
|
s.executables = ["grift"]
|
data/lib/grifter/http_service.rb
CHANGED
@@ -94,6 +94,11 @@ class Grifter
|
|
94
94
|
do_request req
|
95
95
|
end
|
96
96
|
|
97
|
+
def options path, options={}
|
98
|
+
req = Net::HTTP::Options.new(*req_args(path, options))
|
99
|
+
do_request req
|
100
|
+
end
|
101
|
+
|
97
102
|
def delete path, options={}
|
98
103
|
req = Net::HTTP::Delete.new(*req_args(path, options))
|
99
104
|
do_request req
|
@@ -111,6 +116,12 @@ class Grifter
|
|
111
116
|
do_request req
|
112
117
|
end
|
113
118
|
|
119
|
+
def patch path, obj, options={}
|
120
|
+
req = Net::HTTP::Patch.new(*req_args(path, options))
|
121
|
+
req.body = jsonify(obj)
|
122
|
+
do_request req
|
123
|
+
end
|
124
|
+
|
114
125
|
def post_form path, params, options={}
|
115
126
|
request_obj = Net::HTTP::Post.new(*req_args(path, options))
|
116
127
|
request_obj.set_form_data params
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grifter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-07-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
@@ -127,7 +127,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
127
127
|
version: '0'
|
128
128
|
segments:
|
129
129
|
- 0
|
130
|
-
hash:
|
130
|
+
hash: 2667312123342202456
|
131
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
132
|
none: false
|
133
133
|
requirements:
|