pius-ruby-satisfaction 0.4.2 → 0.4.3
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.
- data/VERSION.yml +1 -1
- data/lib/satisfaction/search.rb +0 -2
- data/lib/satisfaction.rb +9 -1
- data/ruby-satisfaction.gemspec +2 -2
- metadata +2 -2
data/VERSION.yml
CHANGED
data/lib/satisfaction/search.rb
CHANGED
@@ -9,13 +9,11 @@ class Sfn::Search
|
|
9
9
|
|
10
10
|
def for_likely_matches_to(name, entities = %w(companies products))
|
11
11
|
@results = entities.inject({}) {|hash, entity|
|
12
|
-
#raise @root_url.inspect
|
13
12
|
query_string = "#{@root_url}/#{entity}.json?q=#{name}"
|
14
13
|
#result = Net::HTTP.get_response(URI.parse(query_string)).body
|
15
14
|
answer = @loader.get(query_string)
|
16
15
|
if answer[0] == :ok
|
17
16
|
result = answer[1]
|
18
|
-
#raise result.inspect
|
19
17
|
hash.merge({entity => JSON.parse(result)['data']})
|
20
18
|
else
|
21
19
|
raise "Search service not available at the moment, please try again later."
|
data/lib/satisfaction.rb
CHANGED
@@ -105,8 +105,16 @@ class Satisfaction
|
|
105
105
|
end
|
106
106
|
|
107
107
|
def access_token(token)
|
108
|
+
log = Logger.new(STDOUT)
|
109
|
+
log.level = Logger::INFO
|
110
|
+
log.info("Trying to retrieve access token ...")
|
108
111
|
result, body = *@loader.get("#{options[:access_token_url]}", :force => true, :consumer => @consumer, :token => token)
|
109
|
-
|
112
|
+
unless result == :ok
|
113
|
+
log.error("Could not retrieve access token! Result was #{result} and the body was #{body}")
|
114
|
+
log.info("consumer was #{@consumer}")
|
115
|
+
raise "Could not retrieve access token"
|
116
|
+
end
|
117
|
+
|
110
118
|
response = CGI.parse(body)
|
111
119
|
OAuth::Token.new(response["oauth_token"], response["oauth_token_secret"])
|
112
120
|
end
|
data/ruby-satisfaction.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{ruby-satisfaction}
|
5
|
-
s.version = "0.4.
|
5
|
+
s.version = "0.4.3"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Scott Fleckenstein", "Josh Nichols", "Pius Uzamere"]
|
9
|
-
s.date = %q{2009-07-
|
9
|
+
s.date = %q{2009-07-23}
|
10
10
|
s.description = %q{Ruby interface to Get Satisfaction}
|
11
11
|
s.email = %q{scott@getsatisfaction.com}
|
12
12
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pius-ruby-satisfaction
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Fleckenstein
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2009-07-
|
14
|
+
date: 2009-07-23 00:00:00 -07:00
|
15
15
|
default_executable:
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|