o-i / marvel Goto Github PK
View Code? Open in Web Editor NEWRuby wrapper for the Marvel API
Home Page: https://rubygems.org/gems/marvel_api
License: MIT License
Ruby wrapper for the Marvel API
Home Page: https://rubygems.org/gems/marvel_api
License: MIT License
I'm not sure what is 'optimally' flexible, but it seems '>= 0' might be a tad too generous. Look into what other gems using faraday, faraday_middleware, and hashie on Ruby 1.9.3+ are doing.
There appears to be a problem with either gem dependencies or just how Rspec is set up in the gem. In any case, running rake spec
returns
/Users/Raevynheart/Code/marvel/lib/marvel/connection.rb:1:in `require': cannot load such file -- faraday_middleware (LoadError)
as currently set up. Troubleshooting...
Most successful results will contain an “etag” attribute and ETag HTTP header with a digest of the returned content. In order to save bandwidth and make your application more performant, you may optionally pass an “if-none-match” HTTP header with that digest for subsequent requests to the same URL. If the content has not changed since the last request, the response code will return with an empty body and a 304/Not Modified HTTP header and you can use a previously-stored value for the content.
When I attempt to run my program, I am getting the following:
You are setting a key that conflicts with a built-in method Hashie::Mash#count defined in Enumerable
Not sure what I am doing wrong.
It doesn't look like renaming the gem to marvel_api was done correctly. Troubleshooting...
This just may be an issue with how I'm using RVM, but I get a LoadError
when trying to require 'marvel_api'
:
/Users/Raevynheart/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- marvel_api (LoadError)
from /Users/Raevynheart/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from test.rb:1:in `<main>'
Investigating...
Allow the user to configure the client to get the raw JSON response returned by the Marvel API if desired. Additionally, a flag to exclude pagination metadata (limit, offset, count, total) would be nice. Again, instagram-ruby-gem (specifically, request.rb) seems to be a good role model for implementing this.
I thought I could relax the dependency. Apparently not:
/Users/Raevynheart/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:2000:in
'raise_if_conflicts': Unable to activate faraday_middleware-0.9.0, because faraday-0.9.0 conflicts with faraday (< 0.9, >= 0.7.4) (Gem::LoadError) from /Users/Raevynheart/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:1238:in
activate'
from /Users/Raevynheart/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems.rb:194:inrescue in try_activate' from /Users/Raevynheart/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems.rb:191:in
try_activate'
from /Users/Raevynheart/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:132:inrescue in require' from /Users/Raevynheart/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:144:in
require'
from /Users/Raevynheart/Code/marvel/lib/marvel/connection.rb:1:in<top (required)>' from lib/marvel/client.rb:6:in
require_relative'
from lib/marvel/client.rb:6:in `
Fixing...
I think the current convention is only to declare development dependencies for a Ruby gem in the Gemfile (but research). There is an issue with some of these dependencies and the Ruby versions no longer being compatible. Investigate the Travis failures and update accordingly.
Test missing/invalid API key and invalid hash, timestamp, key combination.
This may sound like a silly question, but for those of us who aren't as familiar with the output of an API call, what exactly are we supposed to do with the material returned? If I want to actually get something useful out of this, what do I do with the output? I see everything is returned as some "Hashie::Mash" but how do I make that usable?
Instead of returning an array of Hashie::Mash
objects for every successful request, return the corresponding Marvel Entity. For example, if I make a call to v1/public/characters
, I should get an array of Marvel::Character
objects back.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.