badfruit 0.0.5 → 1.0.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.
@@ -0,0 +1,3 @@
1
+ �������˰���On�
2
+ K���÷�(�k{p�Y��h�o ��{,"
3
+ <���1��G�(������MC� ��tP�fϹ�,�[�m�SQo��+�ǡ|.�3����#��yB�iخw�Ϙ[-�]&��x���~���& �G:t,TRX+Y�� ����K:
data/Manifest CHANGED
@@ -3,6 +3,10 @@ Manifest
3
3
  README.md
4
4
  Rakefile
5
5
  badfruit.gemspec
6
+ features/client_creation.feature
7
+ features/client_query.feature
8
+ features/client_reviews.feature
9
+ features/step_definitions/step_definitions.rb
6
10
  lib/badfruit.rb
7
11
  lib/badfruit/Actors/actor.rb
8
12
  lib/badfruit/Lists/lists.rb
data/README.md CHANGED
@@ -15,17 +15,17 @@ Usage
15
15
 
16
16
  So there are two main parts of the api, movies and lists. Each of these parts return movie objects, but they are in different contexts. For example. (bf is a BadFruit client instance).
17
17
 
18
- >bf.lists.new_dvd_releases
18
+ bf.lists.new_dvd_releases
19
19
 
20
20
  Will return you an array of movie objects that represent that latest dvd releases. From this array you can execute actions on the individual movies themselves like...
21
21
 
22
- >movies = bf.lists.new_dvd_releases
22
+ movies = bf.lists.new_dvd_releases
23
23
  movies[0].full_cast
24
24
  movies[0].reviews
25
25
 
26
26
  Very similar to the actual movie section of the api which I've included an example below...
27
27
 
28
- >require 'badfruit'
28
+ require 'badfruit'
29
29
  bf = BadFruit.new("YOUR_API_KEY_HERE")
30
30
  movies = bf.movies.search_by_name("Hackers")
31
31
  cast = movies[0].full_cast
@@ -33,6 +33,8 @@ Very similar to the actual movie section of the api which I've included an examp
33
33
 
34
34
  This should get you started, I should also mention that there are probably more tweaks needed to the list part of the api, but it should work for most people. Feel free to contact me or open an issue if need be.
35
35
 
36
+ PLEASE NOTE: You will need to add replace the "API_KEY_HERE" text with your key to make the tests pass.
37
+
36
38
  Version
37
39
  --------
38
40
  The current version of the gem is 0.0.5, I could probably bump it to a 1.0 but..umm, well...who cares.
data/Rakefile CHANGED
@@ -2,11 +2,12 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('badfruit', '0.0.5') do |p|
5
+ Echoe.new('badfruit', '1.0.0') do |p|
6
6
  p.description = "Interface with the Rotten Tomatoes API"
7
7
  p.url = "http://www.github.com/brianmichel/badfruit"
8
8
  p.author = "Brian Michel"
9
9
  p.email = "brian.michel@gmail.com"
10
+ p.development_dependencies = ["cucumber"]
10
11
  p.runtime_dependencies = ["json", "httparty"]
11
12
  end
12
13
 
@@ -2,20 +2,22 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{badfruit}
5
- s.version = "0.0.5"
5
+ s.version = "1.0.0"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Brian Michel"]
9
- s.date = %q{2011-04-17}
9
+ s.cert_chain = ["/Users/brianmichel/gem-public_cert.pem"]
10
+ s.date = %q{2011-07-08}
10
11
  s.description = %q{Interface with the Rotten Tomatoes API}
11
12
  s.email = %q{brian.michel@gmail.com}
12
13
  s.extra_rdoc_files = ["LICENSE", "README.md", "lib/badfruit.rb", "lib/badfruit/Actors/actor.rb", "lib/badfruit/Lists/lists.rb", "lib/badfruit/Movies/movie.rb", "lib/badfruit/Movies/movies.rb", "lib/badfruit/Posters/posters.rb", "lib/badfruit/Reviews/review.rb", "lib/badfruit/Scores/scores.rb", "lib/badfruit/base.rb"]
13
- s.files = ["LICENSE", "Manifest", "README.md", "Rakefile", "badfruit.gemspec", "lib/badfruit.rb", "lib/badfruit/Actors/actor.rb", "lib/badfruit/Lists/lists.rb", "lib/badfruit/Movies/movie.rb", "lib/badfruit/Movies/movies.rb", "lib/badfruit/Posters/posters.rb", "lib/badfruit/Reviews/review.rb", "lib/badfruit/Scores/scores.rb", "lib/badfruit/base.rb"]
14
+ s.files = ["LICENSE", "Manifest", "README.md", "Rakefile", "badfruit.gemspec", "features/client_creation.feature", "features/client_query.feature", "features/client_reviews.feature", "features/step_definitions/step_definitions.rb", "lib/badfruit.rb", "lib/badfruit/Actors/actor.rb", "lib/badfruit/Lists/lists.rb", "lib/badfruit/Movies/movie.rb", "lib/badfruit/Movies/movies.rb", "lib/badfruit/Posters/posters.rb", "lib/badfruit/Reviews/review.rb", "lib/badfruit/Scores/scores.rb", "lib/badfruit/base.rb"]
14
15
  s.homepage = %q{http://www.github.com/brianmichel/badfruit}
15
16
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Badfruit", "--main", "README.md"]
16
17
  s.require_paths = ["lib"]
17
18
  s.rubyforge_project = %q{badfruit}
18
19
  s.rubygems_version = %q{1.7.2}
20
+ s.signing_key = %q{/Users/brianmichel/gem-private_key.pem}
19
21
  s.summary = %q{Interface with the Rotten Tomatoes API}
20
22
 
21
23
  if s.respond_to? :specification_version then
@@ -24,12 +26,15 @@ Gem::Specification.new do |s|
24
26
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
25
27
  s.add_runtime_dependency(%q<json>, [">= 0"])
26
28
  s.add_runtime_dependency(%q<httparty>, [">= 0"])
29
+ s.add_development_dependency(%q<cucumber>, [">= 0"])
27
30
  else
28
31
  s.add_dependency(%q<json>, [">= 0"])
29
32
  s.add_dependency(%q<httparty>, [">= 0"])
33
+ s.add_dependency(%q<cucumber>, [">= 0"])
30
34
  end
31
35
  else
32
36
  s.add_dependency(%q<json>, [">= 0"])
33
37
  s.add_dependency(%q<httparty>, [">= 0"])
38
+ s.add_dependency(%q<cucumber>, [">= 0"])
34
39
  end
35
40
  end
@@ -0,0 +1,12 @@
1
+ Feature: Creation
2
+ In order to create a badfruit client instance
3
+ As an Rotten Tomatoes API user
4
+ I want to create an client instance with my API key
5
+
6
+ Scenario Outline: Create new client
7
+ Given I make a new client with <api_key>
8
+ Then the result should contain the same <api_key>
9
+
10
+ Examples:
11
+ | api_key |
12
+ | "API_KEY_HERE" |
@@ -0,0 +1,14 @@
1
+ Feature: Query
2
+ In order to query the Rotten Tomatoes API
3
+ As an Rotten Tomatoes API user
4
+ I want to query the API for a movie of my choice and get it's details
5
+
6
+ Scenario Outline: Query The Rotten Tomatoes API
7
+ Given I make a new client with <api_key>
8
+ And I query the API for <movie_name>
9
+ Then the results should contain the <movie_name>
10
+
11
+ Examples:
12
+ | api_key | movie_name |
13
+ | "API_KEY_HERE" | "Hackers" |
14
+ | "API_KEY_HERE" | "Gone With the Wind" |
@@ -0,0 +1,15 @@
1
+ Feature: Reviews
2
+ In order to get reviews for a movie
3
+ As an Rotten Tomatoes API user
4
+ I want to query the API for a movie of my choice and then get it's reviews
5
+
6
+ Scenario Outline: Get Reviews For Specific Movie
7
+ Given I make a new client with <api_key>
8
+ And I query the API for <movie_name>
9
+ And I fetch the reviews for <movie_name>
10
+ Then the results should contain reviews
11
+
12
+ Examples:
13
+ | api_key | movie_name |
14
+ | "API_KEY_HERE" | "Hackers" |
15
+ | "API_KEY_HERE" | "Gone With the Wind" |
@@ -0,0 +1,33 @@
1
+ require 'badfruit'
2
+
3
+ Given /I make a new client with "([^"]*)"$/ do |key|
4
+ @badfruit = BadFruit.new("#{key}")
5
+ @badfruit.should_not == nil
6
+ end
7
+
8
+ Given /I query the API for "([^"]*)"$/ do |movie_name|
9
+ @movies = @badfruit.movies.search_by_name("#{movie_name}",50)
10
+ end
11
+
12
+ Given /I fetch the reviews for "([^"]*)"$/ do |movie_name|
13
+ @reviews = @movies[0].reviews
14
+ end
15
+
16
+
17
+ Then /the result should contain the same "([^"]*)"$/ do |key|
18
+ @badfruit.api_key.should == key
19
+ end
20
+
21
+ Then /the results should contain the "([^"]*)"$/ do |movie_name|
22
+ movie_to_test = @movies[0]
23
+ should_be_true = movie_to_test.name.include? "#{movie_name}"
24
+ should_be_true.should == true
25
+ end
26
+
27
+ Then /the results should contain reviews/ do
28
+ @reviews.each do |review|
29
+ review.critic.should_not == nil
30
+ review.quote.should_not == nil
31
+ review.publication.should_not == nil
32
+ end
33
+ end
@@ -1,5 +1,5 @@
1
1
  require 'httparty'
2
- require 'JSON'
2
+ require 'json'
3
3
  require 'cgi'
4
4
 
5
5
  require File.join(File.expand_path(File.dirname(__FILE__)), 'badfruit', 'base')
@@ -56,11 +56,9 @@ module BadFruit
56
56
 
57
57
  def get(url)
58
58
  data = nil
59
- puts "Getting #{url}"
60
59
  resp = HTTParty.get(url)
61
60
 
62
61
  if resp.code == 200
63
- puts "Response: OK"
64
62
  return resp.body
65
63
  end
66
64
  end
metadata CHANGED
@@ -2,15 +2,36 @@
2
2
  name: badfruit
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.5
5
+ version: 1.0.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Brian Michel
9
9
  autorequire:
10
10
  bindir: bin
11
- cert_chain: []
11
+ cert_chain:
12
+ - |
13
+ -----BEGIN CERTIFICATE-----
14
+ MIIDOjCCAiKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBDMRUwEwYDVQQDDAxicmlh
15
+ bi5taWNoZWwxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkW
16
+ A2NvbTAeFw0xMTA0MTcyMDI0NThaFw0xMjA0MTYyMDI0NThaMEMxFTATBgNVBAMM
17
+ DGJyaWFuLm1pY2hlbDEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPy
18
+ LGQBGRYDY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5cchExCg
19
+ Hd69HKgtJ0S+D/bM2HAVo4NXS05bSfTjmUKjsA2z74zJ0zMqVRD/hnqjpdqZzVUS
20
+ J1h9qaA/W/mUvctKYsLWRjpNQfQIijSnORqSL2+TZJsYbeWGqjsSoIJ4D6ItRaQM
21
+ 8sSgADNFB65SIVkr+tfMRB2aR7BkqH3mhhGOxPPZzgqqYiRsRtxQXPTMToBx4qWl
22
+ OKNIjJstMdgAZnkgb0OOchorUSzxnd5i79CDQsIm2uGT3BKVrny8fCfgHnAfoqC9
23
+ mlmD7p0msgT0I7VPLWqfFNVY0GK2D1r1u8xCFh0hHVG9Q4KTCkZbRAeH3ROrvb7E
24
+ qtxlRMiOCP9U8QIDAQABozkwNzAJBgNVHRMEAjAAMB0GA1UdDgQWBBSWGHbMmXV5
25
+ N9FI14B6O0/b+VxVSzALBgNVHQ8EBAMCBLAwDQYJKoZIhvcNAQEFBQADggEBAD00
26
+ RNOEOntX+gPkfj7YrDp3ySRavY+ePbsnHc422W2/Z/BOIWvRMFgL4DkgrgUdrUcv
27
+ W30HR5XxmOxW0yhVWIJz/xLw2SyXVzMmWnSPXcZ7KzVzYHgGPIt8CZPzR39AGBxr
28
+ yRRlxiqH7BgFzH9VkyXUAbx8O86YpTXZ1yXe6UijkuJTbrQ31jRo9QjSWa0sFnQn
29
+ DFj3tzlB8+UnHvCV/X9s61B77aCONi8rEDZ0mBTbbWNXj9e1HDo8QIsPj0cs2u/L
30
+ sooatL31MCdYuKj7Uno8Xt6BCYzn5gEuo98AyedB+XpImFvrNeTUltSVwlCVwFaE
31
+ BcUuq0IKVG0Sd9yo6rY=
32
+ -----END CERTIFICATE-----
12
33
 
13
- date: 2011-04-17 00:00:00 Z
34
+ date: 2011-07-08 00:00:00 Z
14
35
  dependencies:
15
36
  - !ruby/object:Gem::Dependency
16
37
  name: json
@@ -34,6 +55,17 @@ dependencies:
34
55
  version: "0"
35
56
  type: :runtime
36
57
  version_requirements: *id002
58
+ - !ruby/object:Gem::Dependency
59
+ name: cucumber
60
+ prerelease: false
61
+ requirement: &id003 !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: "0"
67
+ type: :development
68
+ version_requirements: *id003
37
69
  description: Interface with the Rotten Tomatoes API
38
70
  email: brian.michel@gmail.com
39
71
  executables: []
@@ -58,6 +90,10 @@ files:
58
90
  - README.md
59
91
  - Rakefile
60
92
  - badfruit.gemspec
93
+ - features/client_creation.feature
94
+ - features/client_query.feature
95
+ - features/client_reviews.feature
96
+ - features/step_definitions/step_definitions.rb
61
97
  - lib/badfruit.rb
62
98
  - lib/badfruit/Actors/actor.rb
63
99
  - lib/badfruit/Lists/lists.rb
Binary file