faraday-cli 0.0.1.pre

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 422ecea14fe22fc9d7308942710b1dc28fcf0253
4
+ data.tar.gz: 2fb4a86c3f4a6506ddcfc50eb65daf97468bddd3
5
+ SHA512:
6
+ metadata.gz: c21676617cdaed2b043425f79caf41ec97e62974b365e97ef42ee3563b2b66c8ea981504b9f1253e3c300bc5543faff289c85117c041a1975ffdb7caa10ce3ba
7
+ data.tar.gz: 302af50419a83995ae40d90eb422400566549816a6c8bd859c9493a0625988a495cbe878a00c6ea669f105da7172f9b39299ea4e2bd1245a7d0b26ffb4184389
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.2
4
+ before_install: gem install bundler -v 1.10.6
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in faraday-cli.gemspec
4
+ gemspec
@@ -0,0 +1,34 @@
1
+ # Faraday::Cli
2
+
3
+ Console line interface for faraday gem client so you can use your favorite middleware based ruby http client on the terminal!
4
+
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem 'faraday-cli'
12
+ ```
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install faraday-cli
21
+
22
+ ## Usage
23
+
24
+
25
+ ## Development
26
+
27
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
28
+
29
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
30
+
31
+ ## Contributing
32
+
33
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/faraday-cli. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
34
+
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/TODO ADDED
@@ -0,0 +1,178 @@
1
+ implement the following cli options
2
+ Options: (H) means HTTP/HTTPS only, (F) means FTP only
3
+ --anyauth Pick "any" authentication method (H)
4
+ -a, --append Append to target file when uploading (F/SFTP)
5
+ --basic Use HTTP Basic Authentication (H)
6
+ --cacert FILE CA certificate to verify peer against (SSL)
7
+ --capath DIR CA directory to verify peer against (SSL)
8
+ -E, --cert CERT[:PASSWD] Client certificate file and password (SSL)
9
+ --cert-status Verify the status of the server certificate (SSL)
10
+ --cert-type TYPE Certificate file type (DER/PEM/ENG) (SSL)
11
+ --ciphers LIST SSL ciphers to use (SSL)
12
+ --compressed Request compressed response (using deflate or gzip)
13
+ -K, --config FILE Read config from FILE
14
+ --connect-timeout SECONDS Maximum time allowed for connection
15
+ -C, --continue-at OFFSET Resumed transfer OFFSET
16
+ -b, --cookie STRING/FILE Read cookies from STRING/FILE (H)
17
+ -c, --cookie-jar FILE Write cookies to FILE after operation (H)
18
+ --create-dirs Create necessary local directory hierarchy
19
+ --crlf Convert LF to CRLF in upload
20
+ --crlfile FILE Get a CRL list in PEM format from the given file
21
+ -d, --data DATA HTTP POST data (H)
22
+ --data-raw DATA HTTP POST data, '@' allowed (H)
23
+ --data-ascii DATA HTTP POST ASCII data (H)
24
+ --data-binary DATA HTTP POST binary data (H)
25
+ --data-urlencode DATA HTTP POST data url encoded (H)
26
+ --delegation STRING GSS-API delegation permission
27
+ --digest Use HTTP Digest Authentication (H)
28
+ --disable-eprt Inhibit using EPRT or LPRT (F)
29
+ --disable-epsv Inhibit using EPSV (F)
30
+ --dns-servers DNS server addrs to use: 1.1.1.1;2.2.2.2
31
+ --dns-interface Interface to use for DNS requests
32
+ --dns-ipv4-addr IPv4 address to use for DNS requests, dot notation
33
+ --dns-ipv6-addr IPv6 address to use for DNS requests, dot notation
34
+ -D, --dump-header FILE Write the headers to FILE
35
+ --egd-file FILE EGD socket path for random data (SSL)
36
+ --engine ENGINE Crypto engine (use "--engine list" for list) (SSL)
37
+ -f, --fail Fail silently (no output at all) on HTTP errors (H)
38
+ --false-start Enable TLS False Start.
39
+ -F, --form CONTENT Specify HTTP multipart POST data (H)
40
+ --form-string STRING Specify HTTP multipart POST data (H)
41
+ --ftp-account DATA Account data string (F)
42
+ --ftp-alternative-to-user COMMAND String to replace "USER [name]" (F)
43
+ --ftp-create-dirs Create the remote dirs if not present (F)
44
+ --ftp-method [MULTICWD/NOCWD/SINGLECWD] Control CWD usage (F)
45
+ --ftp-pasv Use PASV/EPSV instead of PORT (F)
46
+ -P, --ftp-port ADR Use PORT with given address instead of PASV (F)
47
+ --ftp-skip-pasv-ip Skip the IP address for PASV (F)
48
+ --ftp-pret Send PRET before PASV (for drftpd) (F)
49
+ --ftp-ssl-ccc Send CCC after authenticating (F)
50
+ --ftp-ssl-ccc-mode ACTIVE/PASSIVE Set CCC mode (F)
51
+ --ftp-ssl-control Require SSL/TLS for FTP login, clear for transfer (F)
52
+ -G, --get Send the -d data with a HTTP GET (H)
53
+ -g, --globoff Disable URL sequences and ranges using {} and []
54
+ -H, --header LINE Pass custom header LINE to server (H)
55
+ -I, --head Show document info only
56
+ -h, --help This help text
57
+ --hostpubmd5 MD5 Hex-encoded MD5 string of the host public key. (SSH)
58
+ -0, --http1.0 Use HTTP 1.0 (H)
59
+ --http1.1 Use HTTP 1.1 (H)
60
+ --http2 Use HTTP 2 (H)
61
+ --ignore-content-length Ignore the HTTP Content-Length header
62
+ -i, --include Include protocol headers in the output (H/F)
63
+ -k, --insecure Allow connections to SSL sites without certs (H)
64
+ --interface INTERFACE Use network INTERFACE (or address)
65
+ -4, --ipv4 Resolve name to IPv4 address
66
+ -6, --ipv6 Resolve name to IPv6 address
67
+ -j, --junk-session-cookies Ignore session cookies read from file (H)
68
+ --keepalive-time SECONDS Wait SECONDS between keepalive probes
69
+ --key KEY Private key file name (SSL/SSH)
70
+ --key-type TYPE Private key file type (DER/PEM/ENG) (SSL)
71
+ --krb LEVEL Enable Kerberos with security LEVEL (F)
72
+ --libcurl FILE Dump libcurl equivalent code of this command line
73
+ --limit-rate RATE Limit transfer speed to RATE
74
+ -l, --list-only List only mode (F/POP3)
75
+ --local-port RANGE Force use of RANGE for local port numbers
76
+ -L, --location Follow redirects (H)
77
+ --location-trusted Like '--location', and send auth to other hosts (H)
78
+ --login-options OPTIONS Server login options (IMAP, POP3, SMTP)
79
+ -M, --manual Display the full manual
80
+ --mail-from FROM Mail from this address (SMTP)
81
+ --mail-rcpt TO Mail to this/these addresses (SMTP)
82
+ --mail-auth AUTH Originator address of the original email (SMTP)
83
+ --max-filesize BYTES Maximum file size to download (H/F)
84
+ --max-redirs NUM Maximum number of redirects allowed (H)
85
+ -m, --max-time SECONDS Maximum time allowed for the transfer
86
+ --metalink Process given URLs as metalink XML file
87
+ --negotiate Use HTTP Negotiate (SPNEGO) authentication (H)
88
+ -n, --netrc Must read .netrc for user name and password
89
+ --netrc-optional Use either .netrc or URL; overrides -n
90
+ --netrc-file FILE Specify FILE for netrc
91
+ -:, --next Allows the following URL to use a separate set of options
92
+ --no-alpn Disable the ALPN TLS extension (H)
93
+ -N, --no-buffer Disable buffering of the output stream
94
+ --no-keepalive Disable keepalive use on the connection
95
+ --no-npn Disable the NPN TLS extension (H)
96
+ --no-sessionid Disable SSL session-ID reusing (SSL)
97
+ --noproxy List of hosts which do not use proxy
98
+ --ntlm Use HTTP NTLM authentication (H)
99
+ --oauth2-bearer TOKEN OAuth 2 Bearer Token (IMAP, POP3, SMTP)
100
+ -o, --output FILE Write to FILE instead of stdout
101
+ --pass PASS Pass phrase for the private key (SSL/SSH)
102
+ --path-as-is Do not squash .. sequences in URL path
103
+ --pinnedpubkey FILE Public key (PEM/DER) to verify peer against (OpenSSL/GnuTLS/NSS/wolfSSL/CyaSSL/GSKit only)
104
+ --post301 Do not switch to GET after following a 301 redirect (H)
105
+ --post302 Do not switch to GET after following a 302 redirect (H)
106
+ --post303 Do not switch to GET after following a 303 redirect (H)
107
+ -#, --progress-bar Display transfer progress as a progress bar
108
+ --proto PROTOCOLS Enable/disable PROTOCOLS
109
+ --proto-redir PROTOCOLS Enable/disable PROTOCOLS on redirect
110
+ -x, --proxy [PROTOCOL://]HOST[:PORT] Use proxy on given port
111
+ --proxy-anyauth Pick "any" proxy authentication method (H)
112
+ --proxy-basic Use Basic authentication on the proxy (H)
113
+ --proxy-digest Use Digest authentication on the proxy (H)
114
+ --proxy-negotiate Use HTTP Negotiate (SPNEGO) authentication on the proxy (H)
115
+ --proxy-ntlm Use NTLM authentication on the proxy (H)
116
+ --proxy-service-name NAME SPNEGO proxy service name
117
+ --service-name NAME SPNEGO service name
118
+ -U, --proxy-user USER[:PASSWORD] Proxy user and password
119
+ --proxy1.0 HOST[:PORT] Use HTTP/1.0 proxy on given port
120
+ -p, --proxytunnel Operate through a HTTP proxy tunnel (using CONNECT)
121
+ --pubkey KEY Public key file name (SSH)
122
+ -Q, --quote CMD Send command(s) to server before transfer (F/SFTP)
123
+ --random-file FILE File for reading random data from (SSL)
124
+ -r, --range RANGE Retrieve only the bytes within RANGE
125
+ --raw Do HTTP "raw"; no transfer decoding (H)
126
+ -e, --referer Referer URL (H)
127
+ -J, --remote-header-name Use the header-provided filename (H)
128
+ -O, --remote-name Write output to a file named as the remote file
129
+ --remote-name-all Use the remote file name for all URLs
130
+ -R, --remote-time Set the remote file's time on the local output
131
+ -X, --request COMMAND Specify request command to use
132
+ --resolve HOST:PORT:ADDRESS Force resolve of HOST:PORT to ADDRESS
133
+ --retry NUM Retry request NUM times if transient problems occur
134
+ --retry-delay SECONDS Wait SECONDS between retries
135
+ --retry-max-time SECONDS Retry only within this period
136
+ --sasl-ir Enable initial response in SASL authentication
137
+ -S, --show-error Show error. With -s, make curl show errors when they occur
138
+ -s, --silent Silent mode (don't output anything)
139
+ --socks4 HOST[:PORT] SOCKS4 proxy on given host + port
140
+ --socks4a HOST[:PORT] SOCKS4a proxy on given host + port
141
+ --socks5 HOST[:PORT] SOCKS5 proxy on given host + port
142
+ --socks5-hostname HOST[:PORT] SOCKS5 proxy, pass host name to proxy
143
+ --socks5-gssapi-service NAME SOCKS5 proxy service name for GSS-API
144
+ --socks5-gssapi-nec Compatibility with NEC SOCKS5 server
145
+ -Y, --speed-limit RATE Stop transfers below RATE for 'speed-time' secs
146
+ -y, --speed-time SECONDS Trigger 'speed-limit' abort after SECONDS (default: 30)
147
+ --ssl Try SSL/TLS (FTP, IMAP, POP3, SMTP)
148
+ --ssl-reqd Require SSL/TLS (FTP, IMAP, POP3, SMTP)
149
+ -2, --sslv2 Use SSLv2 (SSL)
150
+ -3, --sslv3 Use SSLv3 (SSL)
151
+ --ssl-allow-beast Allow security flaw to improve interop (SSL)
152
+ --stderr FILE Where to redirect stderr (use "-" for stdout)
153
+ --tcp-nodelay Use the TCP_NODELAY option
154
+ -t, --telnet-option OPT=VAL Set telnet option
155
+ --tftp-blksize VALUE Set TFTP BLKSIZE option (must be >512)
156
+ -z, --time-cond TIME Transfer based on a time condition
157
+ -1, --tlsv1 Use => TLSv1 (SSL)
158
+ --tlsv1.0 Use TLSv1.0 (SSL)
159
+ --tlsv1.1 Use TLSv1.1 (SSL)
160
+ --tlsv1.2 Use TLSv1.2 (SSL)
161
+ --trace FILE Write a debug trace to FILE
162
+ --trace-ascii FILE Like --trace, but without hex output
163
+ --trace-time Add time stamps to trace/verbose output
164
+ --tr-encoding Request compressed transfer encoding (H)
165
+ -T, --upload-file FILE Transfer FILE to destination
166
+ --url URL URL to work with
167
+ -B, --use-ascii Use ASCII/text transfer
168
+ -u, --user USER[:PASSWORD] Server user and password
169
+ --tlsuser USER TLS username
170
+ --tlspassword STRING TLS password
171
+ --tlsauthtype STRING TLS authentication type (default: SRP)
172
+ --unix-socket FILE Connect through this Unix domain socket
173
+ -A, --user-agent STRING Send User-Agent STRING to server (H)
174
+ -v, --verbose Make the operation more talkative
175
+ -V, --version Show version number and quit
176
+ -w, --write-out FORMAT Use output FORMAT after completion
177
+ --xattr Store metadata in extended file attributes
178
+ -q Disable .curlrc (must be first parameter)
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.1.pre
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "faraday/cli"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,36 @@
1
+ # coding: utf-8
2
+ #lib = File.expand_path('../lib', __FILE__)
3
+ #$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ FARADAY_CLI_VERSION = File.read(File.join(File.dirname(__FILE__),'VERSION')).strip
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "faraday-cli"
8
+ spec.version = FARADAY_CLI_VERSION
9
+ spec.authors = ["Adam Luzsi"]
10
+ spec.email = ["adamluzsi@gmail.com"]
11
+
12
+ spec.summary = %q{Console line interface for faraday gem.}
13
+ spec.description = %q{Console line interface for faraday gem client so you can use your favorite middleware based ruby http client on the terminal!}
14
+ spec.homepage = "https://github.com/adamluzsi/faraday-cli.rb"
15
+
16
+ # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
17
+ # delete this section to allow pushing this gem to any host.
18
+ #if spec.respond_to?(:metadata)
19
+ # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
20
+ #else
21
+ # raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
22
+ #end
23
+
24
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
25
+ spec.bindir = "exe"
26
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
+ spec.require_paths = ["lib"]
28
+
29
+ spec.add_development_dependency "bundler", "~> 1.10"
30
+ spec.add_development_dependency "rake", "~> 10.0"
31
+ spec.add_development_dependency "rspec"
32
+
33
+ spec.add_dependency 'commander'
34
+ spec.add_dependency 'faraday'
35
+
36
+ end
@@ -0,0 +1,4 @@
1
+ require 'faraday'
2
+ module Faraday::Cli
3
+ # Your code goes here...
4
+ end
metadata ADDED
@@ -0,0 +1,127 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: faraday-cli
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1.pre
5
+ platform: ruby
6
+ authors:
7
+ - Adam Luzsi
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-09-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: commander
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: faraday
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: Console line interface for faraday gem client so you can use your favorite
84
+ middleware based ruby http client on the terminal!
85
+ email:
86
+ - adamluzsi@gmail.com
87
+ executables: []
88
+ extensions: []
89
+ extra_rdoc_files: []
90
+ files:
91
+ - ".gitignore"
92
+ - ".rspec"
93
+ - ".travis.yml"
94
+ - CODE_OF_CONDUCT.md
95
+ - Gemfile
96
+ - README.md
97
+ - Rakefile
98
+ - TODO
99
+ - VERSION
100
+ - bin/console
101
+ - bin/setup
102
+ - faraday-cli.gemspec
103
+ - lib/faraday/cli.rb
104
+ homepage: https://github.com/adamluzsi/faraday-cli.rb
105
+ licenses: []
106
+ metadata: {}
107
+ post_install_message:
108
+ rdoc_options: []
109
+ require_paths:
110
+ - lib
111
+ required_ruby_version: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ version: '0'
116
+ required_rubygems_version: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - ">"
119
+ - !ruby/object:Gem::Version
120
+ version: 1.3.1
121
+ requirements: []
122
+ rubyforge_project:
123
+ rubygems_version: 2.2.2
124
+ signing_key:
125
+ specification_version: 4
126
+ summary: Console line interface for faraday gem.
127
+ test_files: []