
Security News
Rspack Introduces Rslint, a TypeScript-First Linter Written in Go
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.
Api Client for Typhoeus
.json
method that returns parsed JSON or nil
if parsing fails.Add gem "ac"
to your Gemfile or install it yourself with gem install ac
.
Subclass Ac::Base and define BASE_URL, then you can use get(path, options)
(or put/patch/delete).
class HttpbinClient < Ac::Base
BASE_URL = "https://httpbin.org"
def my_ip_address
get("/ip").json["origin"]
end
end
client = HttpbinClient.new
puts client.my_ip_address
# => 177.62.72.86
Implement retries by passing a block that blows up or retruns false if the resquest should be retried.
class JsonPlaceholderClient < Ac::Base
BASE_URL = "https://jsonplaceholder.typicode.com"
def find_post id
res = get("posts/#{id}") do |response|
Integer(response.json["id"])
end
res.json
end
end
client = JsonPlaceholderClient.new
puts client.find_post 2
# => {"userId"=>1, "id"=>2, "title"=>"qui est esse", "body"=>"est rerum tempore vi...
Bug reports and pull requests are welcome on GitHub at https://github.com/felipedmesquita/ac.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that ac demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.
Security News
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.