factual-api 1.3.8 → 1.3.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ ## v1.3.9
2
+ * adding support for following redirects
3
+ * sunsetting monetize
4
+
1
5
  ## v1.3.8
2
6
  * adding user param for table and facets #15
3
7
 
@@ -1,20 +1,26 @@
1
1
  require 'rubygems'
2
2
  gem 'oauth'
3
3
 
4
+ require 'json'
5
+ require 'cgi'
6
+ require 'timeout'
7
+
4
8
  require 'oauth'
5
- require 'factual/api'
6
- require 'factual/query/table'
7
- require 'factual/query/facets'
8
- require 'factual/query/match'
9
- require 'factual/query/resolve'
10
- require 'factual/query/monetize'
11
- require 'factual/query/geocode'
12
- require 'factual/query/geopulse'
13
- require 'factual/write/flag'
14
- require 'factual/write/submit'
15
- require 'factual/write/clear'
16
- require 'factual/write/insert'
17
- require 'factual/multi'
9
+
10
+ require File.expand_path('../factual/api', __FILE__)
11
+ require File.expand_path('../factual/query/base', __FILE__)
12
+ require File.expand_path('../factual/query/table', __FILE__)
13
+ require File.expand_path('../factual/query/facets', __FILE__)
14
+ require File.expand_path('../factual/query/match', __FILE__)
15
+ require File.expand_path('../factual/query/resolve', __FILE__)
16
+ require File.expand_path('../factual/query/geocode', __FILE__)
17
+ require File.expand_path('../factual/query/geopulse', __FILE__)
18
+ require File.expand_path('../factual/write/base', __FILE__)
19
+ require File.expand_path('../factual/write/flag', __FILE__)
20
+ require File.expand_path('../factual/write/submit', __FILE__)
21
+ require File.expand_path('../factual/write/clear', __FILE__)
22
+ require File.expand_path('../factual/write/insert', __FILE__)
23
+ require File.expand_path('../factual/multi', __FILE__)
18
24
 
19
25
  class Factual
20
26
  def initialize(key, secret, options = {})
@@ -32,10 +38,6 @@ class Factual
32
38
  Query::Facets.new(@api, "t/#{table_id_or_alias}")
33
39
  end
34
40
 
35
- def monetize
36
- Query::Monetize.new(@api)
37
- end
38
-
39
41
  def match(values)
40
42
  Query::Match.new(@api, :values => values)
41
43
  end
@@ -1,10 +1,6 @@
1
- require 'json'
2
- require 'cgi'
3
- require 'timeout'
4
-
5
1
  class Factual
6
2
  class API
7
- VERSION = "1.3.8"
3
+ VERSION = "1.3.9"
8
4
  API_V3_HOST = "api.v3.factual.com"
9
5
  DRIVER_VERSION_TAG = "factual-ruby-driver-v" + VERSION
10
6
  PARAM_ALIASES = { :search => :q, :sort_asc => :sort }
@@ -116,6 +112,10 @@ class Factual
116
112
  elapsed_time = (Time.now - start_time) * 1000
117
113
  debug(url, method, headers, body, res, elapsed_time) if @debug_mode
118
114
 
115
+ if res.code == '301' && res['location']
116
+ res = make_request(res['location'])
117
+ end
118
+
119
119
  res
120
120
  end
121
121
 
@@ -1,5 +1,3 @@
1
- require 'factual/query/base'
2
-
3
1
  class Factual
4
2
  module Query
5
3
  class Facets < Base
@@ -1,5 +1,3 @@
1
- require 'factual/query/base'
2
-
3
1
  class Factual
4
2
  module Query
5
3
  class Geocode < Base
@@ -1,5 +1,3 @@
1
- require 'factual/query/base'
2
-
3
1
  class Factual
4
2
  module Query
5
3
  class Geopulse < Base
@@ -1,5 +1,3 @@
1
- require 'factual/query/base'
2
-
3
1
  class Factual
4
2
  module Query
5
3
  class Match < Base
@@ -1,5 +1,3 @@
1
- require 'factual/query/base'
2
-
3
1
  class Factual
4
2
  module Query
5
3
  class Resolve < Base
@@ -1,5 +1,3 @@
1
- require 'factual/query/base'
2
-
3
1
  class Factual
4
2
  module Query
5
3
  class Table < Base
@@ -1,5 +1,3 @@
1
- require 'factual/write/base'
2
-
3
1
  class Factual
4
2
  module Write
5
3
  class Clear < Base
@@ -1,5 +1,3 @@
1
- require 'factual/write/base'
2
-
3
1
  class Factual
4
2
  module Write
5
3
  class Flag < Base
@@ -1,5 +1,3 @@
1
- require 'factual/write/base'
2
-
3
1
  class Factual
4
2
  module Write
5
3
  class Insert < Base
@@ -1,5 +1,3 @@
1
- require 'factual/write/base'
2
-
3
1
  class Factual
4
2
  module Write
5
3
  class Submit < Base
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factual-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.8
4
+ version: 1.3.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-05-10 00:00:00.000000000 Z
13
+ date: 2013-09-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: oauth
@@ -75,7 +75,6 @@ files:
75
75
  - lib/factual/query/geocode.rb
76
76
  - lib/factual/query/geopulse.rb
77
77
  - lib/factual/query/match.rb
78
- - lib/factual/query/monetize.rb
79
78
  - lib/factual/query/resolve.rb
80
79
  - lib/factual/query/table.rb
81
80
  - lib/factual/write/base.rb
@@ -1,24 +0,0 @@
1
- require 'factual/query/base'
2
-
3
- class Factual
4
- module Query
5
- class Monetize < Base
6
- VALID_PARAMS = [
7
- :filters, :search, :geo,
8
- :limit, :offset
9
- ]
10
-
11
- def initialize(api, params = {})
12
- @path = "places/monetize"
13
- @action = :read
14
- super(api, params)
15
- end
16
-
17
- VALID_PARAMS.each do |param|
18
- define_method(param) do |*args|
19
- self.class.new(@api, @params.merge(param => form_value(args)))
20
- end
21
- end
22
- end
23
- end
24
- end