faraday-cli 0.8.3 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/bin/dev-exec +5 -0
- data/exec/faraday-cli +0 -3
- data/lib/faraday/cli/client.rb +1 -0
- data/lib/faraday/cli/option/parser.rb +16 -8
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2eee26ba5b209b26ba061d070afcd17e336a6b9f
|
4
|
+
data.tar.gz: d63c929cc4165ff7a816d5098e0de78242053bde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1552832cdb4e5313db93b5169919eb6e3530585cd74d0a7c93b77fb3e913eb54e856d9250f8266450394bc07fbebfb9f495020b71e036724dca566ecba4f2641
|
7
|
+
data.tar.gz: c62da47c7c8b2674169c18d9070569ee7d5aaa89030cedcab46fe6ea4cdf9c7b5569da2bcfa24200d5a3c6cfee82ddf77efb79343b82e12c11d9002db72bf246
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.9.0
|
data/bin/dev-exec
ADDED
data/exec/faraday-cli
CHANGED
data/lib/faraday/cli/client.rb
CHANGED
@@ -42,6 +42,7 @@ class Faraday::CLI::Client
|
|
42
42
|
response = connection.public_send(cli_options[:http_method].downcase) do |request|
|
43
43
|
|
44
44
|
request.url(@argv[0])
|
45
|
+
request.proxy(cli_options[:proxy_url]) unless cli_options[:proxy_url].nil?
|
45
46
|
|
46
47
|
cli_options[:http_headers].each do |key, value|
|
47
48
|
request.headers[key]=value
|
@@ -28,6 +28,8 @@ class Faraday::CLI::Option::Parser
|
|
28
28
|
options[:params].push([query_key,query_value])
|
29
29
|
end
|
30
30
|
|
31
|
+
text = get_stdin_content
|
32
|
+
options[:body]= text unless text.nil?
|
31
33
|
o.on('-d', '--data PAYLOAD_STRING', 'HTTP POST data (H)') { |payload| options[:body]= payload }
|
32
34
|
|
33
35
|
o.on('--upload_file KEY=FILE_PATH[:CONTENT_TYPE]', 'Pass File upload io in the request pointing to the given file') do |payload_file_path|
|
@@ -56,12 +58,16 @@ class Faraday::CLI::Option::Parser
|
|
56
58
|
$stderr.reopen(out_file_path, 'a+')
|
57
59
|
end
|
58
60
|
|
59
|
-
#
|
60
|
-
#
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
61
|
+
# --proxy-anyauth Pick "any" proxy authentication method (H)
|
62
|
+
# --proxy-basic Use Basic authentication on the proxy (H)
|
63
|
+
# --proxy-digest Use Digest authentication on the proxy (H)
|
64
|
+
# --proxy-negotiate Use HTTP Negotiate (SPNEGO) authentication on the proxy (H)
|
65
|
+
# --proxy-ntlm Use NTLM authentication on the proxy (H)
|
66
|
+
# --proxy-service-name NAME SPNEGO proxy service name
|
67
|
+
# -U, --proxy-user USER[:PASSWORD] Proxy user and password
|
68
|
+
o.on('-x', '--proxy [PROTOCOL://]HOST[:PORT] Use proxy on given port') do |proxy_url|
|
69
|
+
options[:proxy_url]= proxy_url.to_s
|
70
|
+
end
|
65
71
|
|
66
72
|
o.on('-v', '--verbose', 'Make the operation more talkative') do
|
67
73
|
options[:flags] << :verbose
|
@@ -89,8 +95,6 @@ class Faraday::CLI::Option::Parser
|
|
89
95
|
options[:flags] << :without_middlewares
|
90
96
|
end
|
91
97
|
|
92
|
-
# Z
|
93
|
-
|
94
98
|
o.parse!
|
95
99
|
|
96
100
|
end
|
@@ -98,6 +102,10 @@ class Faraday::CLI::Option::Parser
|
|
98
102
|
options
|
99
103
|
end
|
100
104
|
|
105
|
+
def get_stdin_content
|
106
|
+
($stdin.tty? ? nil : $stdin.read)
|
107
|
+
end
|
108
|
+
|
101
109
|
protected
|
102
110
|
|
103
111
|
def merge_defaults(hash)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faraday-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Luzsi
|
8
8
|
autorequire:
|
9
9
|
bindir: exec
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -113,6 +113,7 @@ files:
|
|
113
113
|
- TODO
|
114
114
|
- VERSION
|
115
115
|
- bin/console
|
116
|
+
- bin/dev-exec
|
116
117
|
- bin/setup
|
117
118
|
- exec/faraday-cli
|
118
119
|
- faraday-cli.gemspec
|