one40_proof 0.0.1 → 0.0.2

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/README.rdoc CHANGED
@@ -1,20 +1,103 @@
1
1
  = 140Proof API Wrapper
2
2
 
3
- A Ruby wrapper around the 140Proof API. Documentation can be found here - http://developers.140proof.com/docs
3
+ This is a wrapper around the 140 Proof API.
4
4
 
5
- It currently only supports JSON.
5
+ It is split into two parts. The first is a simple interface (One40Proof::Base) and the second is a multi interface (One40Proof::Multi::Base).
6
+
7
+ <b>The simple interface requires:</b>
8
+
9
+ - http://github.com/jnunemaker/httparty
10
+
11
+ <b>The multi interface requires:</b>
12
+
13
+ - http://github.com/pauldix/typhoeus
14
+
15
+ <b>They both require:</b>
16
+
17
+ - http://flori.github.com/json
18
+
19
+ The multi interface allows you to make parallel requests (benchmarks are below).
20
+
21
+ Documentation for the 140Proof API can be found here - http://developers.140proof.com/docs
6
22
 
7
23
  == Install
8
24
 
9
25
  gem sources -a http://gemcutter.org
10
26
  sudo gem install one40_proof
11
27
 
28
+ == Benchmarks
29
+
30
+ This can be found on the benchmark dir
31
+
32
+ n = 10
33
+ Benchmark.bm do |x|
34
+ x.report("Simple") do
35
+ n.times { One40Proof::Test.new }
36
+ end
37
+ x.report("Multi") do
38
+ query = []
39
+ n.times { query << {:method => :test} }
40
+ One40Proof::Multi::Base.new(query)
41
+ end
42
+ end
43
+
44
+ ## Ruby 1.9.1 ##
45
+ user system total real
46
+ Simple 0.030000 0.020000 0.050000 ( 2.507165)
47
+ Multi 0.010000 0.010000 0.020000 ( 0.426687)
48
+
12
49
  == How To Use
13
50
 
51
+ <b>Making Parallel Requests</b>
52
+
53
+ Queries are created using a hash and then placed in an array
54
+
55
+ require 'rubygems'
56
+ require 'one40_proof/multi'
57
+
58
+ queries = []
59
+
60
+ # One40Proof's "Test" method
61
+ queries << {:method => :test}
62
+
63
+ # One40Proof's "User" method
64
+ queries << {:method => :user, :user_id => 'sferik', :app_id => 'test'}
65
+
66
+ # One40Proof's "Search" method
67
+ queries << {:method => :search, :user_id => 'sferik', :app_id => 'test', :q => 'New York Mets'}
68
+
69
+ # We then initialize the calls to the service
70
+ a = One40Proof::Multi::Base.new(queries)
71
+
72
+ # Then we have access to all our ads
73
+ a.ads.each do |ad|
74
+ # The Ad
75
+ ad.image_url
76
+ ad.byline
77
+ ad.text
78
+
79
+ # User
80
+ ad.user.screen_name
81
+ ad.user.user_id
82
+ ad.user.profile_image_url
83
+ ad.user.name
84
+
85
+ # Action URLS
86
+ ad.action_urls.click_url
87
+ ad.action_urls.favorite_url # Or ad.action_urls.favourite_url for the English
88
+ ad.action_urls.impression_url
89
+ ad.action_urls.friendship_url
90
+ ad.action_urls.reply_url
91
+ ad.action_urls.retweet_url
92
+ end
93
+
94
+
95
+ <b>Making Single Requests</b>
96
+
14
97
  Testing ad placement while in development
15
98
 
16
99
  require 'rubygems'
17
- require 'one40_proof'
100
+ require 'one40_proof/simple'
18
101
 
19
102
  ad = One40Proof::Test.new
20
103
 
data/Rakefile CHANGED
@@ -23,7 +23,7 @@ end
23
23
  require 'spec/rake/spectask'
24
24
  Spec::Rake::SpecTask.new(:spec) do |spec|
25
25
  spec.libs << 'lib' << 'spec'
26
- spec.spec_files = FileList['spec/**/*_spec.rb']
26
+ spec.spec_files = FileList['spec/**/*_spec.rb'].uniq
27
27
  end
28
28
 
29
29
  Spec::Rake::SpecTask.new(:rcov) do |spec|
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -0,0 +1,21 @@
1
+ # Benchmark between
2
+ # One40Proof::Test
3
+ # One40Proof::Multi::Base
4
+
5
+ require 'rubygems'
6
+ require 'benchmark'
7
+ require File.expand_path(File.dirname(__FILE__) + '/../lib/one40_proof/simple')
8
+ require File.expand_path(File.dirname(__FILE__) + '/../lib/one40_proof/multi')
9
+
10
+ n = 10
11
+ query = []
12
+ n.times { query << {:method => :test} }
13
+
14
+ Benchmark.bm do |x|
15
+ x.report("Simple") do
16
+ n.times { One40Proof::Test.new }
17
+ end
18
+ x.report("Multi") do
19
+ One40Proof::Multi::Base.new(query)
20
+ end
21
+ end
@@ -2,7 +2,7 @@ module One40Proof
2
2
  class ActionUrls
3
3
 
4
4
  def initialize(data)
5
- @data = data['ads'][0]['action_urls']
5
+ @data = data
6
6
  end
7
7
 
8
8
  def click_url
@@ -0,0 +1,40 @@
1
+ require 'json'
2
+ require 'attributes/user'
3
+ require 'attributes/action_urls'
4
+ require 'attributes/status'
5
+
6
+ module One40Proof
7
+ class Ad
8
+
9
+ def initialize(data)
10
+ @data = JSON.parse(data)['ads'][0]
11
+ end
12
+
13
+ def image_url
14
+ @data['image_url']
15
+ end
16
+
17
+ # e.g "ads by Pizza Hut"
18
+ def byline
19
+ @data['byline']
20
+ end
21
+
22
+ # Ad text
23
+ def text
24
+ @data['text']
25
+ end
26
+
27
+ def user
28
+ @user ||= User.new(@data['user'])
29
+ end
30
+
31
+ def action_urls
32
+ @action_urls ||= ActionUrls.new(@data['action_urls'])
33
+ end
34
+
35
+ def status
36
+ @status ||= Status.new(@data['status'])
37
+ end
38
+
39
+ end
40
+ end
@@ -0,0 +1,13 @@
1
+ module One40Proof
2
+ class Status
3
+
4
+ def initialize(data)
5
+ @data = data
6
+ end
7
+
8
+ def id
9
+ @data['id']
10
+ end
11
+
12
+ end
13
+ end
@@ -2,7 +2,7 @@ module One40Proof
2
2
  class User
3
3
 
4
4
  def initialize(data)
5
- @data = data['ads'][0]['user']
5
+ @data = data
6
6
  end
7
7
 
8
8
  def profile_image_url
@@ -0,0 +1,59 @@
1
+ require 'typhoeus'
2
+ require 'attributes/ad'
3
+
4
+ module One40Proof
5
+ module Multi
6
+ class Base
7
+
8
+ def initialize(ad_requests)
9
+ hydra = Typhoeus::Hydra.new
10
+
11
+ ad_requests.each do |ad_request|
12
+ url = build_url(ad_request.delete(:method))
13
+
14
+ params = {:params => turn_keys_to_strings(ad_request)}
15
+ request = Typhoeus::Request.new(url, params)
16
+
17
+ request.on_complete do |response|
18
+ ads << Ad.new(response.body)
19
+ end
20
+
21
+ hydra.queue(request)
22
+ end
23
+
24
+ hydra.run
25
+ end
26
+
27
+ def ads
28
+ @ads ||= []
29
+ end
30
+
31
+ private
32
+
33
+ # I get undefined method `<=>' for :user_id:Symbol in Ruby 1.8.6
34
+ def turn_keys_to_strings(hash)
35
+ new_hash = {}
36
+ hash.each {|k,v| new_hash[k.to_s] = v}
37
+ new_hash
38
+ end
39
+
40
+ def build_url(method)
41
+ case method
42
+ when :test
43
+ path = '/test/ads.json'
44
+ when :user
45
+ path = '/ads/user.json'
46
+ when :search
47
+ path = '/ads/search.json'
48
+ end
49
+
50
+ base_uri + path
51
+ end
52
+
53
+ def base_uri
54
+ "http://api.140proof.com"
55
+ end
56
+
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,3 @@
1
+ $:.unshift(File.dirname(__FILE__))
2
+
3
+ require 'multi/base'
@@ -1,8 +1,6 @@
1
1
  require 'httparty'
2
- require 'json'
3
- require 'one40_proof/attributes/action_urls'
4
- require 'one40_proof/attributes/user'
5
- require 'one40_proof/exceptions'
2
+ require 'attributes/ad'
3
+ require 'simple/exceptions'
6
4
 
7
5
  module One40Proof
8
6
  class Base
@@ -15,31 +13,33 @@ module One40Proof
15
13
  end
16
14
 
17
15
  def action_urls
18
- @action_urls ||= ActionUrls.new(json)
16
+ ad.action_urls
19
17
  end
20
18
 
21
19
  def user
22
- @user ||= User.new(json)
20
+ ad.user
21
+ end
22
+
23
+ def status
24
+ ad.status
23
25
  end
24
26
 
25
27
  def image_url
26
- json['ads'][0]['image_url']
28
+ ad.image_url
27
29
  end
28
30
 
29
- # e.g "ads by Pizza Hut"
30
31
  def byline
31
- json['ads'][0]['byline']
32
+ ad.byline
32
33
  end
33
34
 
34
- # Ad text
35
35
  def text
36
- json['ads'][0]['text']
36
+ ad.text
37
37
  end
38
38
 
39
39
  private
40
40
 
41
- def json
42
- @json ||= JSON.parse(@response.body)
41
+ def ad
42
+ @ad ||= Ad.new(@response.body)
43
43
  end
44
44
 
45
45
  def validate_response(response)
@@ -1,4 +1,4 @@
1
- require 'one40_proof/base'
1
+ require 'simple/base'
2
2
 
3
3
  # Returns an ad for a specified user.
4
4
  # Returns an HTTP 404 error if the user does not exist, if the publisher does not exist, or if a targetted ad could not be found for the user.
@@ -1,4 +1,4 @@
1
- require 'one40_proof/base'
1
+ require 'simple/base'
2
2
 
3
3
  # Returns an ad. Use for testing and verifying your ad-serving code while in development.
4
4
 
@@ -1,4 +1,4 @@
1
- require 'one40_proof/base'
1
+ require 'simple/base'
2
2
 
3
3
  # Returns an ad for a specified user.
4
4
  # Returns an HTTP 404 error if the user does not exist, if the publisher does not exist, or if a targetted ad could not be found for the user.
@@ -0,0 +1,5 @@
1
+ $:.unshift(File.dirname(__FILE__))
2
+
3
+ require 'simple/test'
4
+ require 'simple/user_ad'
5
+ require 'simple/search'
data/one40_proof.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{one40_proof}
8
- s.version = "0.0.1"
8
+ s.version = "0.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["reddavis"]
12
- s.date = %q{2010-02-19}
12
+ s.date = %q{2010-03-07}
13
13
  s.description = %q{A Ruby wrapper around the 140Proof API. Documentation can be found here - http://developers.140proof.com/docs/}
14
14
  s.email = %q{reddavis@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -23,36 +23,47 @@ Gem::Specification.new do |s|
23
23
  "README.rdoc",
24
24
  "Rakefile",
25
25
  "VERSION",
26
- "lib/one40_proof.rb",
26
+ "benchmark/benchmark.rb",
27
27
  "lib/one40_proof/attributes/action_urls.rb",
28
+ "lib/one40_proof/attributes/ad.rb",
29
+ "lib/one40_proof/attributes/status.rb",
28
30
  "lib/one40_proof/attributes/user.rb",
29
- "lib/one40_proof/base.rb",
30
- "lib/one40_proof/exceptions.rb",
31
- "lib/one40_proof/search.rb",
32
- "lib/one40_proof/test.rb",
33
- "lib/one40_proof/user_ad.rb",
31
+ "lib/one40_proof/multi.rb",
32
+ "lib/one40_proof/multi/base.rb",
33
+ "lib/one40_proof/simple.rb",
34
+ "lib/one40_proof/simple/base.rb",
35
+ "lib/one40_proof/simple/exceptions.rb",
36
+ "lib/one40_proof/simple/search.rb",
37
+ "lib/one40_proof/simple/test.rb",
38
+ "lib/one40_proof/simple/user_ad.rb",
34
39
  "one40_proof.gemspec",
35
40
  "spec/one40_proof/attributes/action_urls_spec.rb",
41
+ "spec/one40_proof/attributes/ad_spec.rb",
42
+ "spec/one40_proof/attributes/status_spec.rb",
36
43
  "spec/one40_proof/attributes/user_spec.rb",
37
- "spec/one40_proof/base_spec.rb",
38
- "spec/one40_proof/search_spec.rb",
39
- "spec/one40_proof/test_spec.rb",
40
- "spec/one40_proof/user_ad_spec.rb",
44
+ "spec/one40_proof/multi/base_spec.rb",
45
+ "spec/one40_proof/simple/base_spec.rb",
46
+ "spec/one40_proof/simple/search_spec.rb",
47
+ "spec/one40_proof/simple/test_spec.rb",
48
+ "spec/one40_proof/simple/user_ad_spec.rb",
41
49
  "spec/spec.opts",
42
50
  "spec/spec_helper.rb"
43
51
  ]
44
52
  s.homepage = %q{http://github.com/reddavis/One40Proof}
45
53
  s.rdoc_options = ["--charset=UTF-8"]
46
54
  s.require_paths = ["lib"]
47
- s.rubygems_version = %q{1.3.5}
55
+ s.rubygems_version = %q{1.3.6}
48
56
  s.summary = %q{A Ruby wrapper around the 140Proof API}
49
57
  s.test_files = [
50
58
  "spec/one40_proof/attributes/action_urls_spec.rb",
59
+ "spec/one40_proof/attributes/ad_spec.rb",
60
+ "spec/one40_proof/attributes/status_spec.rb",
51
61
  "spec/one40_proof/attributes/user_spec.rb",
52
- "spec/one40_proof/base_spec.rb",
53
- "spec/one40_proof/search_spec.rb",
54
- "spec/one40_proof/test_spec.rb",
55
- "spec/one40_proof/user_ad_spec.rb",
62
+ "spec/one40_proof/multi/base_spec.rb",
63
+ "spec/one40_proof/simple/base_spec.rb",
64
+ "spec/one40_proof/simple/search_spec.rb",
65
+ "spec/one40_proof/simple/test_spec.rb",
66
+ "spec/one40_proof/simple/user_ad_spec.rb",
56
67
  "spec/spec_helper.rb"
57
68
  ]
58
69
 
@@ -1,8 +1,9 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
+ require 'one40_proof/multi'
2
3
 
3
4
  describe "ActionUrls" do
4
5
  before(:all) do
5
- parsed_json = JSON.parse(test_ad_data)
6
+ parsed_json = JSON.parse(test_ad_data)['ads'][0]['action_urls']
6
7
  @action_urls = One40Proof::ActionUrls.new(parsed_json)
7
8
  end
8
9
 
@@ -0,0 +1,32 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
+ require 'one40_proof/multi'
3
+
4
+ describe "Ad" do
5
+ before(:all) do
6
+ @ad = One40Proof::Ad.new(test_ad_data)
7
+ end
8
+
9
+ it "should have an image_url" do
10
+ @ad.image_url.should_not be_nil
11
+ end
12
+
13
+ it "should have byline" do
14
+ @ad.byline.should_not be_nil
15
+ end
16
+
17
+ it "should have text" do
18
+ @ad.text.should_not be_nil
19
+ end
20
+
21
+ it "should return a User object" do
22
+ @ad.user.should be_a(One40Proof::User)
23
+ end
24
+
25
+ it "should return an ActionUrls object" do
26
+ @ad.action_urls.should be_a(One40Proof::ActionUrls)
27
+ end
28
+
29
+ it "should return a Status object" do
30
+ @ad.status.should be_a(One40Proof::Status)
31
+ end
32
+ end
@@ -0,0 +1,13 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
+ require 'one40_proof/multi'
3
+
4
+ describe "Status" do
5
+ before(:all) do
6
+ parsed_json = JSON.parse(test_ad_data)['ads'][0]['status']
7
+ @status = One40Proof::Status.new(parsed_json)
8
+ end
9
+
10
+ it "should return status id" do
11
+ @status.id.should == 6017128450
12
+ end
13
+ end
@@ -1,8 +1,9 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
+ require 'one40_proof/multi'
2
3
 
3
4
  describe "User" do
4
5
  before(:all) do
5
- parsed_json = JSON.parse(test_ad_data)
6
+ parsed_json = JSON.parse(test_ad_data)['ads'][0]['user']
6
7
  @user = One40Proof::User.new(parsed_json)
7
8
  end
8
9
 
@@ -0,0 +1,39 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
+ require 'one40_proof/multi'
3
+
4
+ describe "MultiBase" do
5
+ before(:all) do
6
+ hydra = Typhoeus::Hydra.new
7
+ test_response = Response.new(:code => 200, :body => test_ad_data)
8
+ user_response = Response.new(:code => 200, :body => user_ad_data)
9
+
10
+ # I receive undefined method `request=' for #<WebMock::Response:0x7fc658> without these:
11
+ test_response.stub!(:request=)
12
+ user_response.stub!(:request=)
13
+
14
+ hydra.stub(:get, "http://api.140proof.com/test/ads.json").and_return(test_response)
15
+ hydra.stub(:get, "http://api.140proof.com/ads/user.json?app_id=test&user_id=sferik").and_return(user_response)
16
+ hydra.stub(:get, "http://api.140proof.com/ads/search.json?app_id=test&q=New+York+Mets&user_id=sferik").and_return(user_response)
17
+
18
+ Typhoeus::Hydra.stub!(:new).and_return(hydra)
19
+
20
+ @a = One40Proof::Multi::Base.new(queries)
21
+ @a.ads.should be_an(Array)
22
+ end
23
+
24
+ it "should return an Array of Ads" do
25
+ @a.ads.should be_an(Array)
26
+ end
27
+
28
+ it "should create 3 ads" do
29
+ @a.ads.size.should == 3
30
+ end
31
+
32
+ def queries
33
+ [
34
+ {:method => :test},
35
+ {:method => :user, :user_id => 'sferik', :app_id => 'test'},
36
+ {:method => :search, :user_id => 'sferik', :app_id => 'test', :q => 'New York Mets'}
37
+ ]
38
+ end
39
+ end
@@ -1,7 +1,8 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
+ require 'one40_proof/simple'
2
3
 
3
4
  describe "Base" do
4
-
5
+
5
6
  describe "200 OK" do
6
7
  before(:all) do
7
8
  stub_request(:get, base_url).to_return(:body => user_ad_data)
@@ -15,6 +16,10 @@ describe "Base" do
15
16
  it "should return a User object" do
16
17
  @base.user.should be_a(One40Proof::User)
17
18
  end
19
+
20
+ it "should return a Status object" do
21
+ @base.status.should be_a(One40Proof::Status)
22
+ end
18
23
 
19
24
  it "should return image_url" do
20
25
  @base.image_url.should == "http://img.tweetimag.es/i/LittleSkillet_n"
@@ -0,0 +1,11 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
+
3
+ describe "Search" do
4
+ it "should request GET /ads/search.json..." do
5
+ url = base_url + '/ads/search.json?user_id=sferik&app_id=test&q=New%20York%20Mets'
6
+ stub_request(:get, url)
7
+ One40Proof::Search.new(:user_id => 'sferik', :app_id => 'test', :q => 'New York Mets')
8
+
9
+ WebMock.should have_requested(:get, url)
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
+
3
+ describe "Test" do
4
+ describe "Connection to the service" do
5
+ it "should request GET /test/ads.json" do
6
+ url = base_url + '/test/ads.json'
7
+ stub_request(:get, url)
8
+ One40Proof::Test.new
9
+
10
+ WebMock.should have_requested(:get, url)
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
+
3
+ describe "UserAd" do
4
+ it "should request GET /ads/user.json..." do
5
+ url = base_url + '/ads/user.json?user_id=sferik&app_id=test'
6
+ stub_request(:get, url)
7
+ One40Proof::UserAd.new(:user_id => 'sferik', :app_id => 'test')
8
+
9
+ WebMock.should have_requested(:get, url)
10
+ end
11
+ end
12
+
13
+
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  $LOAD_PATH.unshift(File.dirname(__FILE__))
2
2
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
3
  require 'rubygems'
4
- require 'one40_proof'
5
4
  require 'spec'
6
5
  require 'spec/autorun'
7
6
  require 'webmock/rspec'
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: one40_proof
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 2
9
+ version: 0.0.2
5
10
  platform: ruby
6
11
  authors:
7
12
  - reddavis
@@ -9,39 +14,47 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-02-19 00:00:00 +00:00
17
+ date: 2010-03-07 00:00:00 +00:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: rspec
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 1
29
+ - 2
30
+ - 9
23
31
  version: 1.2.9
24
- version:
32
+ type: :development
33
+ version_requirements: *id001
25
34
  - !ruby/object:Gem::Dependency
26
35
  name: json
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
30
38
  requirements:
31
39
  - - ">="
32
40
  - !ruby/object:Gem::Version
41
+ segments:
42
+ - 0
33
43
  version: "0"
34
- version:
44
+ type: :runtime
45
+ version_requirements: *id002
35
46
  - !ruby/object:Gem::Dependency
36
47
  name: httparty
37
- type: :runtime
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
48
+ prerelease: false
49
+ requirement: &id003 !ruby/object:Gem::Requirement
40
50
  requirements:
41
51
  - - ">="
42
52
  - !ruby/object:Gem::Version
53
+ segments:
54
+ - 0
43
55
  version: "0"
44
- version:
56
+ type: :runtime
57
+ version_requirements: *id003
45
58
  description: A Ruby wrapper around the 140Proof API. Documentation can be found here - http://developers.140proof.com/docs/
46
59
  email: reddavis@gmail.com
47
60
  executables: []
@@ -58,21 +71,29 @@ files:
58
71
  - README.rdoc
59
72
  - Rakefile
60
73
  - VERSION
61
- - lib/one40_proof.rb
74
+ - benchmark/benchmark.rb
62
75
  - lib/one40_proof/attributes/action_urls.rb
76
+ - lib/one40_proof/attributes/ad.rb
77
+ - lib/one40_proof/attributes/status.rb
63
78
  - lib/one40_proof/attributes/user.rb
64
- - lib/one40_proof/base.rb
65
- - lib/one40_proof/exceptions.rb
66
- - lib/one40_proof/search.rb
67
- - lib/one40_proof/test.rb
68
- - lib/one40_proof/user_ad.rb
79
+ - lib/one40_proof/multi.rb
80
+ - lib/one40_proof/multi/base.rb
81
+ - lib/one40_proof/simple.rb
82
+ - lib/one40_proof/simple/base.rb
83
+ - lib/one40_proof/simple/exceptions.rb
84
+ - lib/one40_proof/simple/search.rb
85
+ - lib/one40_proof/simple/test.rb
86
+ - lib/one40_proof/simple/user_ad.rb
69
87
  - one40_proof.gemspec
70
88
  - spec/one40_proof/attributes/action_urls_spec.rb
89
+ - spec/one40_proof/attributes/ad_spec.rb
90
+ - spec/one40_proof/attributes/status_spec.rb
71
91
  - spec/one40_proof/attributes/user_spec.rb
72
- - spec/one40_proof/base_spec.rb
73
- - spec/one40_proof/search_spec.rb
74
- - spec/one40_proof/test_spec.rb
75
- - spec/one40_proof/user_ad_spec.rb
92
+ - spec/one40_proof/multi/base_spec.rb
93
+ - spec/one40_proof/simple/base_spec.rb
94
+ - spec/one40_proof/simple/search_spec.rb
95
+ - spec/one40_proof/simple/test_spec.rb
96
+ - spec/one40_proof/simple/user_ad_spec.rb
76
97
  - spec/spec.opts
77
98
  - spec/spec_helper.rb
78
99
  has_rdoc: true
@@ -88,26 +109,31 @@ required_ruby_version: !ruby/object:Gem::Requirement
88
109
  requirements:
89
110
  - - ">="
90
111
  - !ruby/object:Gem::Version
112
+ segments:
113
+ - 0
91
114
  version: "0"
92
- version:
93
115
  required_rubygems_version: !ruby/object:Gem::Requirement
94
116
  requirements:
95
117
  - - ">="
96
118
  - !ruby/object:Gem::Version
119
+ segments:
120
+ - 0
97
121
  version: "0"
98
- version:
99
122
  requirements: []
100
123
 
101
124
  rubyforge_project:
102
- rubygems_version: 1.3.5
125
+ rubygems_version: 1.3.6
103
126
  signing_key:
104
127
  specification_version: 3
105
128
  summary: A Ruby wrapper around the 140Proof API
106
129
  test_files:
107
130
  - spec/one40_proof/attributes/action_urls_spec.rb
131
+ - spec/one40_proof/attributes/ad_spec.rb
132
+ - spec/one40_proof/attributes/status_spec.rb
108
133
  - spec/one40_proof/attributes/user_spec.rb
109
- - spec/one40_proof/base_spec.rb
110
- - spec/one40_proof/search_spec.rb
111
- - spec/one40_proof/test_spec.rb
112
- - spec/one40_proof/user_ad_spec.rb
134
+ - spec/one40_proof/multi/base_spec.rb
135
+ - spec/one40_proof/simple/base_spec.rb
136
+ - spec/one40_proof/simple/search_spec.rb
137
+ - spec/one40_proof/simple/test_spec.rb
138
+ - spec/one40_proof/simple/user_ad_spec.rb
113
139
  - spec/spec_helper.rb
data/lib/one40_proof.rb DELETED
@@ -1,5 +0,0 @@
1
- $:.unshift(File.dirname(__FILE__) + '/../lib')
2
-
3
- require 'one40_proof/test'
4
- require 'one40_proof/user_ad'
5
- require 'one40_proof/search'
@@ -1,11 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
-
3
- describe "Search" do
4
- it "should request GET /ads/search.json..." do
5
- url = base_url + '/ads/search.json?user_id=sferik&app_id=test&q=New%20York%20Mets'
6
- stub_request(:get, url)
7
- One40Proof::Search.new(:user_id => 'sferik', :app_id => 'test', :q => 'New York Mets')
8
-
9
- WebMock.should have_requested(:get, url)
10
- end
11
- end
@@ -1,13 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
-
3
- describe "Test" do
4
- describe "Connection to the service" do
5
- it "should request GET /test/ads.json" do
6
- url = base_url + '/test/ads.json'
7
- stub_request(:get, url)
8
- One40Proof::Test.new
9
-
10
- WebMock.should have_requested(:get, url)
11
- end
12
- end
13
- end
@@ -1,11 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
-
3
- describe "UserAd" do
4
- it "should request GET /ads/user.json..." do
5
- url = base_url + '/ads/user.json?user_id=sferik&app_id=test'
6
- stub_request(:get, url)
7
- One40Proof::UserAd.new(:user_id => 'sferik', :app_id => 'test')
8
-
9
- WebMock.should have_requested(:get, url)
10
- end
11
- end