A summary of data about the Ruby ecosystem.

https://github.com/Fingertips/nap

Nap is a really simple REST library.
https://github.com/Fingertips/nap

Keywords from Contributors

cocoapods dependency-manager mac objective-c activerecord deployment apps fastlane screenshots feature-flag

Last synced: about 22 hours ago
JSON representation

Repository metadata

Nap is a really simple REST library.

README.md

Nap

Nap is an extremely simple REST client for Ruby. It was built to quickly
fire off HTTP requests without having to research net/http internals.

Example

gem 'nap'
require 'rest'
require 'json'

response = REST.get('http://twitter.com/statuses/friends_timeline.json', {},
  {:username => '_evan', :password => 'buttonscat'}
)
if response.ok?
  timeline = JSON.parse(response.body)
  puts(timeline.map do |item|
    "#{item['user']['name']}\n\n#{item['text']}"
  end.join("\n\n--\n\n"))
elsif response.forbidden?
  puts "Are you sure you're `_evan' and your password is the name of your cat?"
else
  puts "Something went wrong (#{response.status_code})"
  puts response.body
end

Advanced request configuration

If you need more control over the Net::HTTP request you can pass a block to all of the request methods.

response = REST.get('http://google.com') do |http_request|
  http_request.open_timeout = 15
  http_request.set_debug_output(STDERR)
end

Proxy support

To enable the proxy settings in Nap, you can either use the HTTP_PROXY or http_proxy enviroment variable.

$ env HTTP_PROXY=http://rob:secret@192.167.1.254:665 ruby app.rb

Exceptions

Nap defines one top-level and three main error types which allow you to catch a whole range of exceptions thrown by underlying protocol implementations.

  • REST::Error: Any type of error
  • REST::Error::Timeout: Read timeouts of various sorts
  • REST::Error::Connection: Connection errors caused by dropped sockets
  • REST::Error::Protocol: Request failed because of a problem when handling the HTTP request or response

In the most basic case you can rescue from the top-level type to warn about fetching problems.

begin
  REST.get('http://example.com/pigeons/12')
rescue REST::Error
  puts "[!] Failed to fetch Pigeon number 12."
end

Contributions

Nap couldn't be the shining beacon in the eternal darkness without help from:

  • Eloy Durán
  • Joshua Sierles
  • Thijs van der Vossen

For all other great human beings, please visit the GitHub contributors page.

Changes from 1.0.0 to 1.1.0

  • REST::Request now allows all HTTP verbs to send a body entity.

Changes from 0.8.0 to 1.0.0

  • Removed REST::DisconnectedError, please use REST::Error::Connection instead.

Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 2 days ago

Total Commits: 109
Total Committers: 9
Avg Commits per committer: 12.111
Development Distribution Score (DDS): 0.138

Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0

Name Email Commits
Manfred Stienstra m****d@f****m 94
Eloy Durán e****e@g****m 5
Orta Therox o****x@g****m 2
Kyle Fuller i****x@k****k 2
Joshua Sierles j****s@g****m 2
dependabot[bot] 4****] 1
Thijs van der Vossen t****s@f****m 1
Felix Krause K****x 1
Clemens Gruber c****u@g****m 1

Committer domains:


Issue and Pull Request metadata

Last synced: 6 days ago

Total issues: 2
Total pull requests: 11
Average time to close issues: 25 days
Average time to close pull requests: 17 days
Total issue authors: 1
Total pull request authors: 8
Average comments per issue: 6.0
Average comments per pull request: 4.55
Merged pull request: 9
Bot issues: 0
Bot pull requests: 1

Past year issues: 0
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 0
Past year average comments per issue: 0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/Fingertips/nap

Top Issue Authors

  • alloy (2)

Top Pull Request Authors

  • alloy (3)
  • Manfred (2)
  • clemensg (1)
  • kylef (1)
  • KrauseFx (1)
  • dependabot[bot] (1)
  • orta (1)
  • neonichu (1)

Top Issue Labels

Top Pull Request Labels

  • dependencies (1)

Package metadata

gem.coop: nap

Nap is a really simple REST library. It allows you to perform HTTP requests with minimal amounts of code.

  • Homepage: https://github.com/Fingertips/nap
  • Documentation: http://www.rubydoc.info/gems/nap/
  • Licenses: MIT
  • Latest release: 1.1.0 (published about 10 years ago)
  • Last Synced: 2026-03-01T15:32:07.172Z (2 days ago)
  • Versions: 15
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 169,399,848 Total
  • Docker Downloads: 457,131,127
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 0.098%
    • Downloads: 0.153%
    • Docker downloads count: 0.24%
  • Maintainers (3)
rubygems.org: nap

Nap is a really simple REST library. It allows you to perform HTTP requests with minimal amounts of code.

  • Homepage: https://github.com/Fingertips/nap
  • Documentation: http://www.rubydoc.info/gems/nap/
  • Licenses: MIT
  • Latest release: 1.1.0 (published about 10 years ago)
  • Last Synced: 2026-02-28T23:22:47.715Z (3 days ago)
  • Versions: 15
  • Dependent Packages: 17
  • Dependent Repositories: 31,250
  • Downloads: 169,384,351 Total
  • Docker Downloads: 457,131,127
  • Rankings:
    • Downloads: 0.172%
    • Dependent repos count: 0.196%
    • Docker downloads count: 0.342%
    • Dependent packages count: 1.232%
    • Average: 3.372%
    • Stargazers count: 9.124%
    • Forks count: 9.168%
  • Maintainers (3)

Dependencies

Gemfile rubygems
  • peck >= 0
  • rake >= 0
Gemfile.lock rubygems
  • peck 0.5.4
  • rake 12.3.3
nap.gemspec rubygems
  • peck ~> 0.5 development
  • rake ~> 12 development

Score: 26.642601258641733