ruby-resty 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/resty/cli.rb +4 -1
- data/lib/resty/commands/method_command.rb +1 -1
- data/lib/version.rb +1 -1
- metadata +2 -2
data/lib/resty/cli.rb
CHANGED
@@ -10,12 +10,15 @@ module Resty
|
|
10
10
|
opt :headers, "The headers sent with each request. Ex: X-NYAN-CAT-SECRET-KEY:nyan_nyan",
|
11
11
|
type: :strings, short: "-H"
|
12
12
|
opt :host, "The hostname of the REST service. Ex: http://nyan.cat", type: :string, short: "-h"
|
13
|
+
opt :list_aliases, "List aliases in ~/.ruby_resty.yml", short: "-l"
|
13
14
|
opt :username, "HTTP basic authentication username", type: :string, short: "-u"
|
14
15
|
opt :password, "HTTP basic authentication password", type: :string, short: "-p"
|
15
16
|
opt :verbose, "Verbose mode", short: "-v"
|
16
17
|
end
|
17
18
|
|
18
|
-
if
|
19
|
+
if options[:list_aliases]
|
20
|
+
system("cat ~/.ruby_resty.yml")
|
21
|
+
elsif missing_host_or_alias?(options)
|
19
22
|
puts "Please specify an alias OR a host. Use --help for more info."
|
20
23
|
elsif basic_auth_invalid?(options)
|
21
24
|
puts "Please specify a username and password. Use --help for more info."
|
@@ -68,7 +68,7 @@ Pry::Commands.create_command /(get|put|post|delete|head|options|patch)/i,
|
|
68
68
|
def eval_response(response)
|
69
69
|
target.eval("response = #{JSON.parse(response)}")
|
70
70
|
rescue
|
71
|
-
target.eval("response =
|
71
|
+
target.eval("response = %q(#{response})")
|
72
72
|
end
|
73
73
|
|
74
74
|
def build_data
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-resty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
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-07-
|
12
|
+
date: 2013-07-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: active_support
|