diff --git a/README.md b/README.md index 4dd815f..48990d8 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,14 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run If you create a file `config.rb`, it will be loaded by `bin/console`, allowing you to configure keys and markets. +```ruby +Paapi.configure do |config| + config.access_key = 'access_key' + config.secret_key = 'secret_key' + config.partner_market = {au: 'au_tag', us: 'us_tag', uk: 'uk_tag', ca: 'ca_tag_'} +end +``` + To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). ## Contributing diff --git a/bin/console b/bin/console index 93a47f6..4dc3fcf 100755 --- a/bin/console +++ b/bin/console @@ -1,7 +1,8 @@ #!/usr/bin/env ruby require 'bundler/setup' -require 'paapi' +#require 'paapi' +require './lib/paapi.rb' # 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. diff --git a/lib/paapi/client.rb b/lib/paapi/client.rb index 27ccd3a..94e42de 100644 --- a/lib/paapi/client.rb +++ b/lib/paapi/client.rb @@ -106,7 +106,6 @@ module Paapi end def post(url:, body:, headers:) - puts "Not Deprecated" uri = URI.parse(url) post_request = Net::HTTP::Post.new(uri.path) @@ -115,21 +114,8 @@ module Paapi headers.each { |k, v| post_request[k] = v } post_request.body = body.to_json - #Client.post(client: @http, url: url, body: body, headers: headers) http.request uri, post_request end - - def self.post(url:, body:, headers:, client: nil) - puts "Deprecated" - uri = URI.parse(url) - request = client || Net::HTTP::Post.new(uri) - request.content_type = 'application/json; charset=UTF-8' - headers.each { |k, v| request[k] = v } - request.body = body.to_json - Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http| - http.request(request) - end - end end end diff --git a/lib/paapi/version.rb b/lib/paapi/version.rb index 56d8c97..6eb9671 100644 --- a/lib/paapi/version.rb +++ b/lib/paapi/version.rb @@ -1,3 +1,3 @@ module Paapi - VERSION = '0.1.7' + VERSION = '0.1.8' end