curler 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CODE_OF_CONDUCT.md +75 -0
- data/{LICENSE.txt → LICENCE} +0 -0
- data/README.md +29 -13
- data/lib/curler/nethttp.rb +3 -3
- data/lib/curler/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0c8a23f6d3284d88fb3a1fd6f80d50df81de4e391ad06ed836355620ffd98ca4
|
4
|
+
data.tar.gz: 512ffa34ee409290b32f8561364659af13184ba4d701290cd51a5adf1141d380
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cae22d0b704d2bf9f514b609e7621dca8d6f23e6c3b7acb61d7f6eb3e8120a70733e5cd69518d7f6b74f250736a49d50b260f42ac42030a144d00f8102d3f5c7
|
7
|
+
data.tar.gz: e304a34e506c29bab51f9e285f92a6d314ba2a2453018dea0422c864c1cd92d5e3f22d2547c1c85a08bb0e182f27094e22d57f8c8f2333774304b78a0742a511
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age,
|
8
|
+
body size, disability, ethnicity, gender identity and expression, level of
|
9
|
+
experience, nationality, personal appearance, race, religion, or sexual
|
10
|
+
identity and orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an
|
52
|
+
appointed representative at an online or offline event. Representation of a
|
53
|
+
project may be further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at darryl@dpogue.ca. All complaints
|
59
|
+
will be reviewed and investigated and will result in a response that is deemed
|
60
|
+
necessary and appropriate to the circumstances. The project team is obligated
|
61
|
+
to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
71
|
+
version 1.4, available at
|
72
|
+
[http://contributor-covenant.org/version/1/4][version]
|
73
|
+
|
74
|
+
[homepage]: http://contributor-covenant.org
|
75
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/{LICENSE.txt → LICENCE}
RENAMED
File without changes
|
data/README.md
CHANGED
@@ -1,26 +1,28 @@
|
|
1
|
-
|
1
|
+
Curler
|
2
|
+
======
|
2
3
|
|
3
4
|
Log Net::HTTP requests as cURL commands.
|
4
5
|
|
5
6
|
|
6
|
-
|
7
|
+
Installation
|
8
|
+
------------
|
7
9
|
|
8
|
-
|
10
|
+
* Github: https://github.com/dpogue/curler
|
9
11
|
|
10
|
-
|
11
|
-
gem 'curler'
|
12
|
-
```
|
13
|
-
|
14
|
-
And then execute:
|
12
|
+
* Gem:
|
15
13
|
|
16
|
-
|
14
|
+
```
|
15
|
+
$ gem install curler
|
16
|
+
```
|
17
17
|
|
18
|
-
|
18
|
+
* Bundler/Gemfile:
|
19
19
|
|
20
|
-
|
20
|
+
```ruby
|
21
|
+
gem 'curler'
|
22
|
+
```
|
21
23
|
|
22
|
-
|
23
|
-
|
24
|
+
Usage
|
25
|
+
-----
|
24
26
|
|
25
27
|
This adds a class-level `curl_log` method to Net::HTTP to specify a log location for the cURL commands.
|
26
28
|
|
@@ -30,3 +32,17 @@ Net::HTTP.curl_log('requests.log')
|
|
30
32
|
|
31
33
|
# Now make requests with Net::HTTP
|
32
34
|
```
|
35
|
+
|
36
|
+
Contributing
|
37
|
+
------------
|
38
|
+
|
39
|
+
Contributions of bug reports, feature requests, and pull requests are greatly appreciated!
|
40
|
+
|
41
|
+
Please note that this project is released with a [Contributor Code of Conduct](https://github.com/dpogue/curler/blob/master/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
|
42
|
+
|
43
|
+
|
44
|
+
Licence
|
45
|
+
-------
|
46
|
+
|
47
|
+
Copyright © 2018 Darryl Pogue
|
48
|
+
Licensed under the MIT Licence.
|
data/lib/curler/nethttp.rb
CHANGED
@@ -5,7 +5,7 @@ class Net::HTTP
|
|
5
5
|
|
6
6
|
def self.curl_log(path)
|
7
7
|
if path.is_a? String
|
8
|
-
@@logfile = File.open(path, '
|
8
|
+
@@logfile = File.open(path, 'at')
|
9
9
|
elsif path.is_a? IO
|
10
10
|
@@logfile = path
|
11
11
|
elsif path.nil?
|
@@ -46,7 +46,7 @@ class Net::HTTP
|
|
46
46
|
url += ":#{port}"
|
47
47
|
end
|
48
48
|
end
|
49
|
-
url += "
|
49
|
+
url += "#{req.path}"
|
50
50
|
|
51
51
|
method = "-X #{req.method.upcase}"
|
52
52
|
|
@@ -63,7 +63,7 @@ class Net::HTTP
|
|
63
63
|
|
64
64
|
output = ['curl', method, headers.join(' '), data, url].reject(&:empty?)
|
65
65
|
|
66
|
-
@@logfile << output.join(' ')
|
66
|
+
@@logfile << (output.join(' ') + "\n")
|
67
67
|
end
|
68
68
|
|
69
69
|
return res
|
data/lib/curler/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: curler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darryl Pogue
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -47,8 +47,9 @@ extra_rdoc_files: []
|
|
47
47
|
files:
|
48
48
|
- ".editorconfig"
|
49
49
|
- ".gitignore"
|
50
|
+
- CODE_OF_CONDUCT.md
|
50
51
|
- Gemfile
|
51
|
-
-
|
52
|
+
- LICENCE
|
52
53
|
- README.md
|
53
54
|
- Rakefile
|
54
55
|
- curler.gemspec
|
@@ -75,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
76
|
version: '0'
|
76
77
|
requirements: []
|
77
78
|
rubyforge_project:
|
78
|
-
rubygems_version: 2.
|
79
|
+
rubygems_version: 2.7.6
|
79
80
|
signing_key:
|
80
81
|
specification_version: 4
|
81
82
|
summary: Log outgoing network requests as cURL commands.
|