pixabay_api 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6a330512cd2bc8440f1b4a571d958efa61223607
4
- data.tar.gz: 46a0644c2a888e6a3a210b2ec950001aca024d1a
3
+ metadata.gz: '082b720cdec82b8a82da3e58b1f502c66959d022'
4
+ data.tar.gz: a24241bdb3c35a3ab6b381789a828ade60b6ae37
5
5
  SHA512:
6
- metadata.gz: c1923a5b0a38d3ba14c26e8dcae7a307a0e4dd463fb190a2d7bfdc0882537e126f97b48431b59f62fda01dab3da0bdd491bc1933080e042a398bc216cde63cd6
7
- data.tar.gz: b2449cd30e461848bad3b14b462d56e23852f2923aa4341d6e39fc405765047031b560f21e9b0e99948d305c86d38f1e3f4b2a9179389d1ad7abff3eeb756518
6
+ metadata.gz: a4267cac8b5ef077ae87af56f65830fc6a8576be6991b053c6491a503683d2725193754f967fb06b9cbace8b900d5cd5866be3d96eecc1e48ef8230e6a663983
7
+ data.tar.gz: 9755d184b178b82e60eaaab5ea62f8e171cf0a60e135a26af1f5c9acd65fdb63301a29c147098368e5eb46365ff01570d873a028916930bc98954957a4941241
data/README.md CHANGED
@@ -43,7 +43,8 @@ You can configure as below:
43
43
 
44
44
  ```ruby
45
45
  images_api = PixabayApi::ImagesApi.new
46
- pictures = images_api.find(keyword: 'test')
46
+ options = { id: 888 }
47
+ pictures = images_api.find(keyword: 'test', options: options)
47
48
 
48
49
  p pictures.success?
49
50
  p pictures.body['totalHits']
@@ -84,6 +85,7 @@ samples return
84
85
  ]
85
86
  }
86
87
  ```
88
+ - There is many options - https://github.com/haanhduclinh/pixabay_api#search-images
87
89
 
88
90
  ## Get picture array data
89
91
 
@@ -209,6 +211,9 @@ To keep the Pixabay API fast for everyone, requests must be cached for 24 hours.
209
211
  # Run test
210
212
  - `bundle exec rspec`
211
213
 
214
+ # Require
215
+ - ruby 2.3
216
+
212
217
 
213
218
  # Author
214
219
 
@@ -1,4 +1,4 @@
1
- require 'pixabay_api'
1
+ require './lib/pixabay_api'
2
2
 
3
3
  PixabayApi.configure do |c|
4
4
  c.api_key = '4339817-195df6b39f70c8fb254ba4656'
@@ -6,5 +6,7 @@ end
6
6
 
7
7
  images_api = PixabayApi::ImagesApi.new
8
8
 
9
- pictures = images_api.find_and_return_array(keyword: 'test')
10
- p pictures.size
9
+ options = { id: 888 }
10
+ pictures = images_api.find_and_return_array(keyword: 'test', options: options)
11
+ p pictures.size
12
+ p pictures.first
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'resolv-replace'
4
- require 'cgi'
5
4
 
6
5
  module PixabayApi
7
6
  class Request
@@ -23,7 +22,7 @@ module PixabayApi
23
22
  end
24
23
 
25
24
  def params_to_s(params)
26
- CGI.escape(params.map { |k, v| "#{k}=#{v}" }.join('&'))
25
+ params.map { |k, v| "#{k}=#{v}" }.join('&')
27
26
  end
28
27
  end
29
28
  end
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PixabayApi
4
- VERSION = '0.0.1'
4
+ VERSION = '0.0.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pixabay_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Duc Linh