hoick 0.0.5 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/README.md +7 -3
- data/lib/hoick/command.rb +11 -1
- data/lib/hoick/version.rb +1 -1
- metadata +5 -17
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NzBmYTdjZGE4OGVlM2FlN2NhMjY2YTUwNDhlNjhjMjYyZWE1MjkxNg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
Y2NkM2Q5YzU0NWE0MWMyOTM1YWU5YWI0OGYyZjk4MjkxOWE0NjkxZA==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MWFiMGI4NjkyMGIzZjNhMzY5NzdkMzQ4MzFlYzkxMDcyODUwYjlkOWQwZmRk
|
10
|
+
MDYzNWRkYjQ4ZDg4OGI1NjQ1ZWRhZWFhNTA0OTRkOTYwMTZmYzdkMDIwMzdk
|
11
|
+
NTI3YzdhYjg1ZThmZGFmMWMzYzNiOTJmN2NlMTYzNDYwNGFkMDQ=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
YjczOWQ4NTM5NDM2YmRhZDNkMmUwNTc0NDVhMDAzZGMzNjJjNDdmNjY4OThj
|
14
|
+
ZTM0NDQwZGQwNzA3OGMyODJlNzEwNTE1YzI2ZjgxZjg4OGNkNDAyNDMzNmE1
|
15
|
+
OWZmOGE2YjExODBiMzE1ZDk3NWM0OGQ3YjcwOTc5NTIwNDMyMWE=
|
data/README.md
CHANGED
@@ -12,11 +12,11 @@ Hoick is distributed as a Ruby gem, installable using:
|
|
12
12
|
|
13
13
|
## Usage
|
14
14
|
|
15
|
-
Hoick has subcommands modelled on HTTP verbs.
|
15
|
+
Hoick has subcommands modelled on HTTP verbs.
|
16
16
|
|
17
17
|
### GET
|
18
18
|
|
19
|
-
To fetch a resource, use GET. The response body will be printed to STDOUT.
|
19
|
+
To fetch a resource, use GET. The response body will be printed to STDOUT.
|
20
20
|
|
21
21
|
$ hoick GET http://api.example.com/widgets/123
|
22
22
|
|
@@ -24,7 +24,7 @@ If you're interested in response headers too, add the "`-h`" flag. Add the "`--
|
|
24
24
|
|
25
25
|
### PUT and POST
|
26
26
|
|
27
|
-
The "PUT" subcommand uploads data to a specified URL.
|
27
|
+
The "PUT" subcommand uploads data to a specified URL.
|
28
28
|
|
29
29
|
$ hoick PUT -T json http://api.example.com/widgets/123 < widget-123.json
|
30
30
|
|
@@ -36,6 +36,10 @@ Hoick guesses a "Content-Type" from the file-name. If a type cannot be guessed,
|
|
36
36
|
|
37
37
|
The "POST" subcommand works in a similar way.
|
38
38
|
|
39
|
+
### HEAD and DELETE
|
40
|
+
|
41
|
+
Rounding out the RESTful actions, "HEAD" and "DELETE" do pretty much what you'd expect.
|
42
|
+
|
39
43
|
## Contributing
|
40
44
|
|
41
45
|
1. Fork it
|
data/lib/hoick/command.rb
CHANGED
@@ -84,6 +84,16 @@ module Hoick
|
|
84
84
|
|
85
85
|
end
|
86
86
|
|
87
|
+
subcommand ["delete", "DELETE"], "HTTP DELETE" do
|
88
|
+
|
89
|
+
declare_url_parameter
|
90
|
+
|
91
|
+
def execute
|
92
|
+
http_request("DELETE", full_url, nil, nil, &method(:display_response))
|
93
|
+
end
|
94
|
+
|
95
|
+
end
|
96
|
+
|
87
97
|
module PayloadOptions
|
88
98
|
|
89
99
|
extend Clamp::Option::Declaration
|
@@ -182,7 +192,7 @@ module Hoick
|
|
182
192
|
|
183
193
|
def with_http_connection(uri)
|
184
194
|
http = Net::HTTP.new(uri.host, uri.port)
|
185
|
-
http.use_ssl = (uri.scheme == "https")
|
195
|
+
http.use_ssl = true if (uri.scheme == "https")
|
186
196
|
http.set_debug_output($stderr) if debug?
|
187
197
|
if timeout
|
188
198
|
http.open_timeout = timeout
|
data/lib/hoick/version.rb
CHANGED
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hoick
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Mike Williams
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-19 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: clamp
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: mime-types
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -65,32 +60,25 @@ files:
|
|
65
60
|
homepage: https://github.com/mdub/hoick
|
66
61
|
licenses:
|
67
62
|
- MIT
|
63
|
+
metadata: {}
|
68
64
|
post_install_message:
|
69
65
|
rdoc_options: []
|
70
66
|
require_paths:
|
71
67
|
- lib
|
72
68
|
required_ruby_version: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
69
|
requirements:
|
75
70
|
- - ! '>='
|
76
71
|
- !ruby/object:Gem::Version
|
77
72
|
version: '0'
|
78
|
-
segments:
|
79
|
-
- 0
|
80
|
-
hash: -3857892055023656216
|
81
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
|
-
none: false
|
83
74
|
requirements:
|
84
75
|
- - ! '>='
|
85
76
|
- !ruby/object:Gem::Version
|
86
77
|
version: '0'
|
87
|
-
segments:
|
88
|
-
- 0
|
89
|
-
hash: -3857892055023656216
|
90
78
|
requirements: []
|
91
79
|
rubyforge_project:
|
92
|
-
rubygems_version:
|
80
|
+
rubygems_version: 2.0.7
|
93
81
|
signing_key:
|
94
|
-
specification_version:
|
82
|
+
specification_version: 4
|
95
83
|
summary: A command-line HTTP client
|
96
84
|
test_files: []
|