Version bump. Make sure the console uses local paapi

This commit is contained in:
Dan Milne
2023-04-20 15:41:26 +10:00
parent 9297799555
commit 09e635fc6f
4 changed files with 11 additions and 16 deletions

View File

@@ -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

View File

@@ -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.

View File

@@ -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

View File

@@ -1,3 +1,3 @@
module Paapi
VERSION = '0.1.7'
VERSION = '0.1.8'
end