Rename gem from AwsPaa to Paapi

This commit is contained in:
Dan Milne
2019-09-09 11:17:47 +10:00
parent 8b835e80ec
commit 14045af846
10 changed files with 36 additions and 28 deletions

View File

@@ -1,8 +1,6 @@
# AwsPaa # AwsPaa
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/aws_paa`. To experiment with that code, run `bin/console` for an interactive prompt. `aws_paa` is a slim wrapper around [Amazon's Product Advertising API 5.0](https://webservices.amazon.com/paapi5/documentation/).
TODO: Delete this and the text above, and describe your gem
## Installation ## Installation
@@ -22,7 +20,17 @@ Or install it yourself as:
## Usage ## Usage
TODO: Write usage instructions here ```ruby
require 'aws_paa'
client = AwsPaa::Client.new(access_key: ENV['access_key'], secret_key: ENV['secret_key'], marketplace: :au, partner_tag: ENV['partner_tag'])
gi = client.get_items(item_ids: '1857231384')
si = client.search_items(keywords: 'Harry Potter')
gv = client.get_variations(asin: 'B00422MCUS')
```
## Development ## Development
@@ -32,7 +40,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
## Contributing ## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/aws_paa. Bug reports and pull requests are welcome on GitHub at https://github.com/dkam/aws_paa.
## License ## License

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
require "bundler/setup" require "bundler/setup"
require "aws_paa" require "paapi"
# You can add fixtures and/or initialization code here to make experimenting # You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like. # with your gem easier. You can also use a different console, if you like.

View File

@@ -1,12 +0,0 @@
require "aws_paa/version"
require 'aws_paa/locales'
require 'aws_paa/aws_request'
require 'aws_paa/client'
require 'aws_paa/request'
require 'aws_paa/response'
module AwsPaa
class Error < StandardError; end
class NotImplemented < StandardError; end
end

12
lib/paapi.rb Normal file
View File

@@ -0,0 +1,12 @@
require "paapi/version"
require 'paapi/locales'
require 'paapi/aws_request'
require 'paapi/client'
require 'paapi/request'
require 'paapi/response'
module Paapi
class Error < StandardError; end
class NotImplemented < StandardError; end
end

View File

@@ -1,6 +1,6 @@
require 'http' require 'http'
module AwsPaa module Paapi
class Client class Client
attr_accessor :marketplace, :partner_tag attr_accessor :marketplace, :partner_tag
attr_reader :partner_type, :access_key, :secret_key attr_reader :partner_type, :access_key, :secret_key

View File

@@ -1,6 +1,6 @@
require 'byebug' require 'byebug'
module AwsPaa module Paapi
class Request class Request
include AwsRequest include AwsRequest
attr_accessor :client, :marketplace, :resources, :payload, :service, :partner_type attr_accessor :client, :marketplace, :resources, :payload, :service, :partner_type

View File

@@ -1,6 +1,6 @@
require 'json' require 'json'
module AwsPaa module Paapi
class Response class Response
attr_reader :status, :data attr_reader :status, :data
def initialize(response) def initialize(response)

View File

@@ -1,3 +1,3 @@
module AwsPaa module Paapi
VERSION = "0.0.1" VERSION = "0.0.1"
end end

View File

@@ -1,15 +1,15 @@
lib = File.expand_path("lib", __dir__) lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "aws_paa/version" require "paapi/version"
Gem::Specification.new do |spec| Gem::Specification.new do |spec|
spec.name = "aws_paa" spec.name = "paapi"
spec.version = AwsPaa::VERSION spec.version = Paapi::VERSION
spec.authors = ["Dan Milne"] spec.authors = ["Dan Milne"]
spec.email = ["d@nmilne.com"] spec.email = ["d@nmilne.com"]
spec.summary = %q{Client library for Amazon's Product Advertising API v5} spec.summary = %q{Client library for Amazon's Product Advertising API v5}
spec.homepage = "https://github.com/dkam/aws_paa" spec.homepage = "https://github.com/dkam/pappi"
spec.license = "MIT" spec.license = "MIT"
spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'" spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"

View File

@@ -1,8 +1,8 @@
require "test_helper" require "test_helper"
class AwsPaaTest < Minitest::Test class PaapiTest < Minitest::Test
def test_that_it_has_a_version_number def test_that_it_has_a_version_number
refute_nil ::AwsPaa::VERSION refute_nil ::Paapi::VERSION
end end
def test_it_does_something_useful def test_it_does_something_useful