alluc 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e37f4286ff882a8664a48c45421f7897d68f5ef
4
- data.tar.gz: da3c712ee8701469446474d1bab6e2e715eb16ce
3
+ metadata.gz: d49d3a77689f547f4a3db53c1479f191439ecf4c
4
+ data.tar.gz: 0713e4a546ac626dd45ca1e299cf2704f2c0dc73
5
5
  SHA512:
6
- metadata.gz: 228a46d861f569d0a51e5dbf999365d578ca19ddbf97d833ae415e27fd3a964036060877d5671722483317d77689cd89b370448f18886a67487ff22d0c428018
7
- data.tar.gz: ee1083a765595486d9faa09937dee7b1f7962df4a36c1735082a8321e744573a66507a353551d57e2740168afc52ab029a0d5c1b431871ff019ea8e548efc961
6
+ metadata.gz: e20bc36bbee6d148dd8a9688426d5d5af6d11f5fe11f2d949aceba3454aaa0ac885a6c2d260324901bd667eea88fe06b81f6bec26f70583d9b51e98dc8db817b
7
+ data.tar.gz: 82588c91e4ddabad7f853938913c270775cb49a81ae783b3f72ec7ab3404e27f58ce3b4b1836a4fbc516598bbbce7b710af71a41d168493957a8b5d1f7fecb06
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- alluc (1.0.0)
4
+ alluc (0.2.0)
5
5
  excon (~> 0.44.4)
6
6
 
7
7
  GEM
@@ -18,12 +18,11 @@ module Alluc
18
18
  ['stream', 'download'].each do |action|
19
19
  define_singleton_method("#{action}_links") do |query, opts = {}|
20
20
  params = Hash.new.tap do |hash|
21
- hash['query'] = CGI.escape(query)
22
- hash['count'] = opts[:count] if opts[:count] # count - max-amount of returned results. Can be between 1 - 100
23
- hash['from'] = opts[:from] if opts[:from] # from - where to start. For example if you want result 20-30, you will set count=10 and from=20
24
- hash['getmeta'] = opts[:getmeta] if opts[:getmeta] # getmeta - If you want additional info on hosterlinks and source, set this to 1. Only use if you really need it as it might make for slower queries.
21
+ hash[:count] = opts[:count] if opts[:count] # count - max-amount of returned results. Can be between 1 - 100
22
+ hash[:from] = opts[:from] if opts[:from] # from - where to start. For example if you want result 20-30, you will set count=10 and from=20
23
+ hash[:getmeta] = opts[:getmeta] if opts[:getmeta] # getmeta - If you want additional info on hosterlinks and source, set this to 1. Only use if you really need it as it might make for slower queries.
25
24
  end
26
- Alluc::Requester.get("search/#{action}", params)
25
+ Alluc::Requester.get("search/#{action}?query=#{CGI.escape(query)}", params)
27
26
  end
28
27
  end
29
28
 
@@ -28,7 +28,8 @@ module Alluc
28
28
  def url_for(action, params={})
29
29
  params[:apikey] = api_key if api_type == :alluc
30
30
  url = URI.join(actual_url, action) # Need some base_url / mashape_url logic here
31
- url.query = URI.encode_www_form(params) unless params.empty?
31
+ # url.query += URI.encode_www_form(params) unless params.empty?
32
+ url.query = [url.query, params.map{|k,v| "#{k}=#{v}"}].compact.join('&')
32
33
  url.to_s
33
34
  end
34
35
 
@@ -1,3 +1,3 @@
1
1
  module Alluc
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alluc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ahmet Abdi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-04-30 00:00:00.000000000 Z
11
+ date: 2015-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -68,7 +68,6 @@ files:
68
68
  - alluc.gemspec
69
69
  - bin/console
70
70
  - bin/setup
71
- - do_not_commit
72
71
  - lib/alluc.rb
73
72
  - lib/alluc/api.rb
74
73
  - lib/alluc/requester.rb
@@ -1,2 +0,0 @@
1
- allc: 1ca40c6e8c2ea9b1dad7fd44de022e41
2
- mashape: BUx9tctImLmshca3wFGurw35HlCip1X2N7gjsnerW5rfLyfr1s