Skip to content

Commit

Permalink
✨ feat: add .gitignore, LICENSE, README.md, curlify.gemspec, and spec…
Browse files Browse the repository at this point in the history
…/curlify_spec.rb files

📝 chore(.gitignore): add .gem files to the gitignore

📝 chore(LICENSE): add MIT License

📝 chore(README.md): add initial README content

📝 chore(curlify.gemspec): add gemspec file for curlify gem

📝 chore(spec/curlify_spec.rb): add initial spec file for curlify gem
  • Loading branch information
marcuxyz committed Aug 31, 2023
1 parent 41e5f4b commit b87b970
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.gem
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Marcus Almeida

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
The gem convert ruby requests(net/http) into curl command.

## Installation

To install the gem use `bundle` or `gem`, see:

```bash
$ gem install curlify
```

or bundle:

```bash
$ bundle add curlify
```

## Usage

Import 'curlify', 'uri' and 'net/http' gems and execute curlify, see:

```python
require 'uri'
require 'net/http'
require 'curlify'

uri = URI('https://run.mocky.io/v3/b0f4ffd8-6696-4f90-8bab-4a3bcad9ef3f')
request = Net::HTTP::Get.new(uri, { 'content-type': 'application/json' })
curlify = Curlify.new(request)

puts curlify.to_curl # curl -X GET -H 'content-type: application/json' -H 'accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3' -H 'accept: */*' -H 'user-agent: Ruby' -H 'host: run.mocky.io' https://run.mocky.io/v3/b0f4ffd8-6696-4f90-8bab-4a3bcad9ef3f
```
23 changes: 23 additions & 0 deletions curlify.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Gem::Specification.new do |s|
s.name = 'curlify'
s.version = '1.0.0'
s.summary = 'Hola!'
s.description = 'The gem convert python requests object in curl command.'
s.authors = ['Marcus Almeida']
s.email = 'mpereirassa@gmail.com'
s.files = ['lib/curlify.rb']
s.homepage =
'https://rubygems.org/gems/curlify'
s.license = 'MIT'
s.metadata = {
'source_code_uri' => 'https://github.com/marcuxyz/curlify',
'bug_tracker_uri' => 'https://github.com/marcuxyz/curlify/issues',
'changelog_uri' => 'https://github.com/marcuxyz/curlify/releases',
'rubygems_mfa_required' => 'true'
}

s.rdoc_options = ['--charset=UTF-8']
s.extra_rdoc_files = %w[README.md LICENSE]

s.required_ruby_version = '>= 3.2.0'
end
1 change: 1 addition & 0 deletions spec/curlify_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'json'
require 'uri'
require 'net/http'

require './lib/curlify'

describe Curlify do
Expand Down

0 comments on commit b87b970

Please sign in to comment.