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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 33f57152ba258d34004fe9f2a687aa170b7c8494
4
- data.tar.gz: f634659c2b2e36e9a9a7de928c67870d57eccec9
3
+ metadata.gz: 2eee26ba5b209b26ba061d070afcd17e336a6b9f
4
+ data.tar.gz: d63c929cc4165ff7a816d5098e0de78242053bde
5
5
  SHA512:
6
- metadata.gz: 1efe3302cf27e69356689154f60bcf0b9b9276feb71f53d237f1ad8fa146c55214a036b65c73a343ef13e109697555de9da7bd4a9e0ea953597b09c20b506aa8
7
- data.tar.gz: 7bc37644f7c14caac610d4988a32a804a7c4e7167973a840d2fb6769fb2f51fbfb5829805d7c9f46a3b9566ba3beca4f7bf8df57eb418c1b1a230f7e12a8cf84
6
+ metadata.gz: 1552832cdb4e5313db93b5169919eb6e3530585cd74d0a7c93b77fb3e913eb54e856d9250f8266450394bc07fbebfb9f495020b71e036724dca566ecba4f2641
7
+ data.tar.gz: c62da47c7c8b2674169c18d9070569ee7d5aaa89030cedcab46fe6ea4cdf9c7b5569da2bcfa24200d5a3c6cfee82ddf77efb79343b82e12c11d9002db72bf246
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.3
1
+ 0.9.0
data/bin/dev-exec ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ PROJECT_ROOT = File.realpath(File.join(File.dirname(__FILE__),'..'))
3
+ lib_folder = File.join(PROJECT_ROOT, 'lib')
4
+ $LOAD_PATH.unshift(lib_folder) if Dir.exists?(lib_folder)
5
+ load(File.join(PROJECT_ROOT,'exec','faraday-cli'))
data/exec/faraday-cli CHANGED
@@ -1,6 +1,3 @@
1
1
  #!/usr/bin/env ruby
2
- lib_folder = File.join(File.dirname(__FILE__), '..', 'lib')
3
- $LOAD_PATH.unshift(lib_folder) if Dir.exists?(lib_folder)
4
-
5
2
  require 'faraday/cli'
6
3
  Faraday::CLI::Client.start(ARGV)
@@ -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
- # o.on('-x', '--proxy HOST:PORT', 'HOST[:PORT] Use proxy on given port') do |host_port_str|
60
- # host, port = host_port_str.split(':')
61
- # port = '80' if port.nil?
62
- #
63
- # options[:proxy]= {host: host, port: port}
64
- # end
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.8.3
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: 2015-10-30 00:00:00.000000000 Z
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