binged 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -0
- data/HISTORY +3 -0
- data/VERSION +1 -1
- data/binged.gemspec +4 -1
- data/lib/binged.rb +1 -1
- data/lib/binged/search/base.rb +10 -5
- metadata +17 -1
data/Gemfile
CHANGED
data/HISTORY
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0
|
1
|
+
1.1.0
|
data/binged.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "binged"
|
8
|
-
s.version = "1.0
|
8
|
+
s.version = "1.1.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kevin Faustino", "Ben Woosley"]
|
@@ -57,12 +57,14 @@ Gem::Specification.new do |s|
|
|
57
57
|
|
58
58
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
59
59
|
s.add_runtime_dependency(%q<hashie>, [">= 0"])
|
60
|
+
s.add_runtime_dependency(%q<faraday>, [">= 0"])
|
60
61
|
s.add_runtime_dependency(%q<activesupport>, [">= 3.0.0"])
|
61
62
|
s.add_development_dependency(%q<rspec>, [">= 1.3.0"])
|
62
63
|
s.add_development_dependency(%q<fakeweb>, [">= 1.2.8"])
|
63
64
|
s.add_development_dependency(%q<yard>, [">= 0"])
|
64
65
|
else
|
65
66
|
s.add_dependency(%q<hashie>, [">= 0"])
|
67
|
+
s.add_dependency(%q<faraday>, [">= 0"])
|
66
68
|
s.add_dependency(%q<activesupport>, [">= 3.0.0"])
|
67
69
|
s.add_dependency(%q<rspec>, [">= 1.3.0"])
|
68
70
|
s.add_dependency(%q<fakeweb>, [">= 1.2.8"])
|
@@ -70,6 +72,7 @@ Gem::Specification.new do |s|
|
|
70
72
|
end
|
71
73
|
else
|
72
74
|
s.add_dependency(%q<hashie>, [">= 0"])
|
75
|
+
s.add_dependency(%q<faraday>, [">= 0"])
|
73
76
|
s.add_dependency(%q<activesupport>, [">= 3.0.0"])
|
74
77
|
s.add_dependency(%q<rspec>, [">= 1.3.0"])
|
75
78
|
s.add_dependency(%q<fakeweb>, [">= 1.2.8"])
|
data/lib/binged.rb
CHANGED
data/lib/binged/search/base.rb
CHANGED
@@ -55,6 +55,12 @@ module Binged
|
|
55
55
|
@fetch
|
56
56
|
end
|
57
57
|
|
58
|
+
def connection
|
59
|
+
Faraday.new.tap do |faraday|
|
60
|
+
faraday.basic_auth(@client.account_key, @client.account_key)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
58
64
|
# Performs a GET call to Bing API
|
59
65
|
#
|
60
66
|
# @return [Hash] Hash of Bing API response
|
@@ -69,11 +75,10 @@ module Binged
|
|
69
75
|
query_options = default_options.merge(query).to_query
|
70
76
|
query_options.gsub! '%2B', '+'
|
71
77
|
url.query = query_options
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
}
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
response = connection.get(url)
|
77
82
|
begin
|
78
83
|
JSON.parse(response.body)
|
79
84
|
rescue JSON::ParserError => e
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: binged
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -28,6 +28,22 @@ dependencies:
|
|
28
28
|
- - ! '>='
|
29
29
|
- !ruby/object:Gem::Version
|
30
30
|
version: '0'
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
name: faraday
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
|
+
none: false
|
35
|
+
requirements:
|
36
|
+
- - ! '>='
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
type: :runtime
|
40
|
+
prerelease: false
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
31
47
|
- !ruby/object:Gem::Dependency
|
32
48
|
name: activesupport
|
33
49
|
requirement: !ruby/object:Gem::Requirement
|