prx / amara Goto Github PK
View Code? Open in Web Editor NEWRuby Gem to access the Amara API
License: MIT License
Ruby Gem to access the Amara API
License: MIT License
client = Amara::Client.new
client.videos.create({})
This raises an error, and i have no idea how to find out what actually went wrong - even though the raw response from Amara does include debugging information. I'd like to be able to receive a response object even when my request results in an error.
I think it would be relatively straightforward to implement create!
alongside the existing create
. (Similar bang methods could be created for get
, update
, delete
, etc.)
The only difference would be that the bang versions raise an exception when Amara returns a non-200 response, while the non-bang versions always return an Amara::Response
instance. Using the non-bang versions, the client would be able to look at the response and get the troubleshooting information they need.
@kookster Would you be open to a PR that adds this feature? I expect it would require a major version bump, since the behavior of non-bang methods (like create
) would change substantially. But the upgrade path would be very simple - add a !
if you want to keep old behavior.
Currently base_path in Amara::API
does not take into account team-slug
which needs to be injected into the path for any Amara::Teams methods to hit valid Amara endpoints.
With the current code-base calling the following:
Amara::Client.new.teams.members.list!
base_path returns:
teams/members
which is not a valid path. Instead it needs to return:
teams/(team-slug)/members
As shown here: http://amara.readthedocs.io/en/latest/api.html#members-resource
The workaround for this at the moment is using Amara::Client#path
with the correct path, but it would be ideal to have these methods either functioning, or not offered.
This is something I might be able to look into, but the code changes aren't straight forward at this time, so I will use the work around until I have more time to invest into these changes.
i should be able to add new URLs to a video resource, per the Amara documentation.
client = Amara::Client.new
client
.videos('abcdef123')
.urls
.create!(
url: 'https://s3.amazonaws.com/ted.conferences/transcript-video.mp4',
primary: true
)
this code always fails because the url
option is interpreted as being part of the endpoint which the request should be posted to.
this results in a request like https://s3.amazonaws.com/ted.conferences/transcript-video.mp4/videos/FcliJD1cEomT/urls/
RubyGems.org doesn't report a license for your gem. This is because it is not specified in the gemspec of your last release.
via e.g.
spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']
Including a license in your gemspec is an easy way for rubygems.org and other tools to check how your gem is licensed. As you can image, scanning your repository for a LICENSE file or parsing the README, and then attempting to identify the license or licenses is much more difficult and more error prone. So, even for projects that already specify a license, including a license in your gemspec is a good practice. See, for example, how rubygems.org uses the gemspec to display the rails gem license.
There is even a License Finder gem to help companies/individuals ensure all gems they use meet their licensing needs. This tool depends on license information being available in the gemspec. This is an important enough issue that even Bundler now generates gems with a default 'MIT' license.
I hope you'll consider specifying a license in your gemspec. If not, please just close the issue with a nice message. In either case, I'll follow up. Thanks for your time!
Appendix:
If you need help choosing a license (sorry, I haven't checked your readme or looked for a license file), GitHub has created a license picker tool. Code without a license specified defaults to 'All rights reserved'-- denying others all rights to use of the code.
Here's a list of the license names I've found and their frequencies
p.s. In case you're wondering how I found you and why I made this issue, it's because I'm collecting stats on gems (I was originally looking for download data) and decided to collect license metadata,too, and make issues for gemspecs not specifying a license as a public service :). See the previous link or my blog post about this project for more information.
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.