ratlas 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +14 -0
- data/Gemfile.lock +30 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +43 -0
- data/Rakefile +37 -0
- data/VERSION +1 -0
- data/lib/patches/string.rb +17 -0
- data/lib/ratlas.rb +19 -0
- data/lib/ratlas/content.rb +24 -0
- data/lib/ratlas/discover.rb +18 -0
- data/lib/ratlas/query.rb +71 -0
- data/lib/ratlas/queryable.rb +29 -0
- data/lib/ratlas/response.rb +10 -0
- data/lib/ratlas/schedule.rb +18 -0
- data/lib/ratlas/search.rb +18 -0
- data/spec/container_spec.rb +58 -0
- data/spec/fixtures/content.json +1 -0
- data/spec/live_container_spec.rb +53 -0
- data/spec/ratlas_spec.rb +13 -0
- metadata +128 -0
data/Gemfile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
5
|
+
|
6
|
+
# Add dependencies to develop your gem here.
|
7
|
+
# Include everything needed to run rake, tests, features, etc.
|
8
|
+
group :development do
|
9
|
+
gem "rspec"
|
10
|
+
gem "bundler", "~> 1.0.0"
|
11
|
+
gem "jeweler", "~> 1.5.2"
|
12
|
+
gem "hashie"
|
13
|
+
gem "addressable"
|
14
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
addressable (2.2.4)
|
5
|
+
diff-lcs (1.1.2)
|
6
|
+
git (1.2.5)
|
7
|
+
hashie (1.0.0)
|
8
|
+
jeweler (1.5.2)
|
9
|
+
bundler (~> 1.0.0)
|
10
|
+
git (>= 1.2.5)
|
11
|
+
rake
|
12
|
+
rake (0.8.7)
|
13
|
+
rspec (2.5.0)
|
14
|
+
rspec-core (~> 2.5.0)
|
15
|
+
rspec-expectations (~> 2.5.0)
|
16
|
+
rspec-mocks (~> 2.5.0)
|
17
|
+
rspec-core (2.5.1)
|
18
|
+
rspec-expectations (2.5.0)
|
19
|
+
diff-lcs (~> 1.1.2)
|
20
|
+
rspec-mocks (2.5.0)
|
21
|
+
|
22
|
+
PLATFORMS
|
23
|
+
ruby
|
24
|
+
|
25
|
+
DEPENDENCIES
|
26
|
+
addressable
|
27
|
+
bundler (~> 1.0.0)
|
28
|
+
hashie
|
29
|
+
jeweler (~> 1.5.2)
|
30
|
+
rspec
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Daniel Cooper
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
= ratlas
|
2
|
+
|
3
|
+
Ratlas is a lightweight ruby library for consuming the lovely Atlas Api (http://docs.atlasapi.org/)
|
4
|
+
|
5
|
+
== Installation
|
6
|
+
|
7
|
+
gem install ratlas
|
8
|
+
|
9
|
+
== API
|
10
|
+
|
11
|
+
Please see the atlas api documentation for a list of methods and their arguments.
|
12
|
+
|
13
|
+
== Example
|
14
|
+
|
15
|
+
Ratlas::Discover.find(:all).where(:genre=> "drama", :media_type => 'video').each do |n|
|
16
|
+
puts n.title
|
17
|
+
end
|
18
|
+
|
19
|
+
Ratlas::Schedule.find(:all).where(:genre=> "drama", :media_type => 'video').each do |n|
|
20
|
+
puts n.title
|
21
|
+
end
|
22
|
+
|
23
|
+
#http://atlasapi.org/3.0/schedule.json?from=now&to=now.plus.24h&channel=bbcone&publisher=bbc.co.uk,itv.com
|
24
|
+
Ratlas::Schedule.find(:all).where(:from => Time.now.to_i, :to=> Time.now.to_i + 3600).and(:channel => 'bbcone', :publisher => 'bbc.co.uk').each do |n|
|
25
|
+
puts "#{n.channel_title} has the following programs in the next hour:"
|
26
|
+
n.items {|program| puts "-#{program.first.title}"}
|
27
|
+
end
|
28
|
+
|
29
|
+
== Contributing to ratlas
|
30
|
+
|
31
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
32
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
33
|
+
* Fork the project
|
34
|
+
* Start a feature/bugfix branch
|
35
|
+
* Commit and push until you are happy with your contribution
|
36
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
37
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
38
|
+
|
39
|
+
== Copyright
|
40
|
+
|
41
|
+
Copyright (c) 2011 Daniel Cooper. See LICENSE.txt for
|
42
|
+
further details.
|
43
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'rake'
|
11
|
+
|
12
|
+
require 'jeweler'
|
13
|
+
Jeweler::Tasks.new do |gem|
|
14
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
|
+
gem.name = "ratlas"
|
16
|
+
gem.homepage = "http://github.com/daniel_cooper/ratlas"
|
17
|
+
gem.license = "MIT"
|
18
|
+
gem.summary = %Q{A Atlas api Ruby client}
|
19
|
+
gem.description = %Q{Rutlas allows you to consume to the Atlas api without getting your hands dirty}
|
20
|
+
gem.email = "daniel@14lines.com"
|
21
|
+
gem.authors = ["Daniel Cooper"]
|
22
|
+
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
23
|
+
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
24
|
+
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
25
|
+
# gem.add_development_dependency 'rspec', '> 1.2.3'
|
26
|
+
end
|
27
|
+
Jeweler::RubygemsDotOrgTasks.new
|
28
|
+
|
29
|
+
require 'rake/rdoctask'
|
30
|
+
Rake::RDocTask.new do |rdoc|
|
31
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
32
|
+
|
33
|
+
rdoc.rdoc_dir = 'rdoc'
|
34
|
+
rdoc.title = "ratlas #{version}"
|
35
|
+
rdoc.rdoc_files.include('README*')
|
36
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
37
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.1
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class String
|
2
|
+
|
3
|
+
|
4
|
+
def self.camelize(lower_case_and_underscored_word, first_letter_in_uppercase = true)
|
5
|
+
if first_letter_in_uppercase
|
6
|
+
lower_case_and_underscored_word.to_s.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
|
7
|
+
else
|
8
|
+
lower_case_and_underscored_word.to_s[0].chr.downcase + camelize(lower_case_and_underscored_word)[1..-1]
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def camelize! (first_letter_in_uppercase = true)
|
13
|
+
String.camelize(self, first_letter_in_uppercase)
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
end
|
data/lib/ratlas.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'patches/string'
|
2
|
+
require 'ratlas/query'
|
3
|
+
require 'ratlas/queryable'
|
4
|
+
require 'ratlas/discover'
|
5
|
+
require 'ratlas/search'
|
6
|
+
require 'ratlas/content'
|
7
|
+
require 'ratlas/schedule'
|
8
|
+
require 'ratlas/response'
|
9
|
+
require "addressable/uri"
|
10
|
+
require 'json'
|
11
|
+
require 'hashie'
|
12
|
+
require 'net/http'
|
13
|
+
module Ratlas
|
14
|
+
|
15
|
+
ENDPOINT = "atlasapi.org"
|
16
|
+
ENDPOINT_VERSION = "3.0"
|
17
|
+
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
|
2
|
+
module Ratlas
|
3
|
+
class Content
|
4
|
+
|
5
|
+
include ::Ratlas::Queryable
|
6
|
+
|
7
|
+
@resource_name = 'content'
|
8
|
+
@exclude_list = [:limit]
|
9
|
+
|
10
|
+
|
11
|
+
def self.resource_name
|
12
|
+
@resource_name
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.resource_key
|
16
|
+
@resource_name + 's'
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.exclude
|
20
|
+
@exclude_list
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
data/lib/ratlas/query.rb
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
module Ratlas
|
2
|
+
class Query
|
3
|
+
|
4
|
+
def initialize(target, scope = :all, conditions = {})
|
5
|
+
@target = target
|
6
|
+
@scope = scope
|
7
|
+
@conditions = {:limit => "50"}.merge(conditions)
|
8
|
+
@conditions.delete_if{|k,v| @target.respond_to?(:exclude) && @target.exclude.include?(k)}
|
9
|
+
end
|
10
|
+
|
11
|
+
def where(conditions)
|
12
|
+
raise "#where expects a conditions hash" unless conditions.is_a?(Hash)
|
13
|
+
add_conditions(conditions)
|
14
|
+
self
|
15
|
+
end
|
16
|
+
|
17
|
+
def each &block
|
18
|
+
execute.each &block
|
19
|
+
end
|
20
|
+
|
21
|
+
def to_a
|
22
|
+
execute.to_a
|
23
|
+
end
|
24
|
+
|
25
|
+
def and(conditions)
|
26
|
+
where(conditions)
|
27
|
+
end
|
28
|
+
|
29
|
+
def limit(limit)
|
30
|
+
add_condition(:limit => limit )
|
31
|
+
end
|
32
|
+
|
33
|
+
def to_params
|
34
|
+
to_uri.query
|
35
|
+
end
|
36
|
+
|
37
|
+
def to_uri
|
38
|
+
uri = Addressable::URI.new
|
39
|
+
uri.host = Ratlas::ENDPOINT
|
40
|
+
uri.path = Ratlas::ENDPOINT_VERSION + '/' + @target.resource_name + '.json'
|
41
|
+
uri.query_values = conditions_for_query
|
42
|
+
uri
|
43
|
+
end
|
44
|
+
|
45
|
+
def request
|
46
|
+
JSON.parse(Net::HTTP.get_response(URI.parse('http:'+to_uri.to_s)).body)
|
47
|
+
end
|
48
|
+
|
49
|
+
def execute
|
50
|
+
Ratlas::Response.new(request, @target.resource_key)
|
51
|
+
end
|
52
|
+
|
53
|
+
protected
|
54
|
+
|
55
|
+
def conditions_for_query
|
56
|
+
output = {}
|
57
|
+
@conditions.each{|k,v| output[k.to_s.camelize!(false)] = v}
|
58
|
+
return output
|
59
|
+
end
|
60
|
+
|
61
|
+
def add_condition(key, value)
|
62
|
+
@conditions[key.to_sym] = value.to_s
|
63
|
+
end
|
64
|
+
|
65
|
+
def add_conditions(conditions)
|
66
|
+
conditions.each do |key, value|
|
67
|
+
add_condition(key, value)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Ratlas
|
2
|
+
module Queryable
|
3
|
+
def self.included(base)
|
4
|
+
base.extend(ClassMethods)
|
5
|
+
|
6
|
+
end
|
7
|
+
|
8
|
+
module ClassMethods
|
9
|
+
|
10
|
+
def where(args)
|
11
|
+
find(args)
|
12
|
+
end
|
13
|
+
|
14
|
+
def find(args)
|
15
|
+
if args.is_a?(Symbol)
|
16
|
+
Ratlas::Query.new(self, args)
|
17
|
+
elsif args.is_a?(Hash)
|
18
|
+
Ratlas::Query.new(self, :all, args)
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require './lib/ratlas'
|
2
|
+
require 'rspec'
|
3
|
+
require 'rspec-expectations'
|
4
|
+
|
5
|
+
module Ratlas
|
6
|
+
class Query
|
7
|
+
|
8
|
+
def request
|
9
|
+
JSON.parse(File.open("spec/fixtures/content.json").read)
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
describe Ratlas::Discover do
|
18
|
+
|
19
|
+
context "when searching" do
|
20
|
+
|
21
|
+
it "returns a query object on find" do
|
22
|
+
Ratlas::Discover.find(:test => 'why_not').class.should == Ratlas::Query
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should provide a chainable search" do
|
26
|
+
container = Ratlas::Discover.find(:all).where(:arg1 => 'test').and(:arg2 => "test2")
|
27
|
+
container.to_params.include?("arg1=test&arg2=test2").should == true
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should camelCase keys" do
|
31
|
+
container = Ratlas::Discover.find(:all).where(:arg_one => 'test').and(:arg_two => "test2")
|
32
|
+
container.to_params.include?("argOne=test&argTwo=test2").should == true
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should produce a queryable url" do
|
36
|
+
container = Ratlas::Discover.find(:all).where(:arg_one => 'test').and(:arg_two => "test2")
|
37
|
+
container.to_uri.to_s.include?("atlasapi.org/3.0/discover.json?argOne=test&argTwo=test2").should == true
|
38
|
+
end
|
39
|
+
|
40
|
+
context "and returning results" do
|
41
|
+
|
42
|
+
it "should return some results" do
|
43
|
+
Ratlas::Discover.find(:all).where(:arg_one => 'test').and(:arg_two => "test2").execute.class.should == Ratlas::Response
|
44
|
+
end
|
45
|
+
|
46
|
+
it "should be itterable" do
|
47
|
+
Ratlas::Discover.find(:all).where(:arg_one => 'test').and(:arg_two => "test2").each do |n|
|
48
|
+
n.class.should == Hashie::Mash
|
49
|
+
["audio", "video"].include?(n.media_type).should == true
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
{"contents":[{"locations":[],"broadcasts":[{"transmission_time":"31-Mar-2009 23:05:00","transmission_end_time":"31-Mar-2009 23:20:00","broadcast_duration":900,"broadcast_on":"http://www.bbc.co.uk/services/bbcone/ni","duration":900,"restriction":{}}],"people":[],"title":"Secret Gardens","description":"Darryl Grimason visits local gardens around the province.","publisher":{"key":"bbc.co.uk","name":"BBC","country":"GB"},"image":"http://www.bbc.co.uk/iplayer/images/episode/b00jsb9y_640_360.jpg","thumbnail":"http://www.bbc.co.uk/iplayer/images/episode/b00jsb9y_150_84.jpg","genres":["http://ref.atlasapi.org/genres/atlas/lifestyle","http://www.bbc.co.uk/programmes/genres/factual/homesandgardens"],"tags":[],"clips":[],"same_as":[],"media_type":"video","specialization":"tv","aliases":["http://bbc.co.uk/i/jsb9y/","http://www.bbc.co.uk/iplayer/episode/b00jsb9y"],"uri":"http://www.bbc.co.uk/programmes/b00jsb9y","curie":"bbc:b00jsb9y"},{"locations":[],"broadcasts":[{"transmission_time":"31-Dec-2007 20:35:00","transmission_end_time":"31-Dec-2007 21:00:00","broadcast_duration":1500,"broadcast_on":"http://www.bbc.co.uk/services/bbcone/scotland","duration":1500,"restriction":{}}],"people":[],"title":"Scotland on Film","description":"Scotland on Film returns with a festive special recalling all our Christmas pasts and special Hogmanay memories.","publisher":{"key":"bbc.co.uk","name":"BBC","country":"GB"},"image":"http://www.bbc.co.uk/iplayer/images/episode/b008mqkc_640_360.jpg","thumbnail":"http://www.bbc.co.uk/iplayer/images/episode/b008mqkc_150_84.jpg","genres":["http://www.bbc.co.uk/programmes/genres/factual"],"tags":[],"clips":[],"same_as":[],"media_type":"video","specialization":"tv","aliases":["http://bbc.co.uk/i/8mqkc/","http://www.bbc.co.uk/iplayer/episode/b008mqkc"],"uri":"http://www.bbc.co.uk/programmes/b008mqkc","curie":"bbc:b008mqkc"},{"locations":[],"broadcasts":[{"transmission_time":"05-Sep-2007 20:00:00","transmission_end_time":"05-Sep-2007 20:30:00","broadcast_duration":1800,"broadcast_on":"http://www.bbc.co.uk/services/bbcone/ni","restriction":{}}],"people":[],"title":"Out-Take TV","description":"Paul O'Grady, the man behind Lily Savage, presents amusing outtakes from TV shows.","publisher":{"key":"bbc.co.uk","name":"BBC","country":"GB"},"image":"http://www.bbc.co.uk/iplayer/images/episode/b007cwr8_640_360.jpg","thumbnail":"http://www.bbc.co.uk/iplayer/images/episode/b007cwr8_150_84.jpg","genres":[],"tags":[],"clips":[],"same_as":[],"media_type":"video","specialization":"tv","aliases":["http://bbc.co.uk/i/7cwr8/","http://www.bbc.co.uk/iplayer/episode/b007cwr8"],"uri":"http://www.bbc.co.uk/programmes/b007cwr8","curie":"bbc:b007cwr8"},{"locations":[],"broadcasts":[{"transmission_time":"22-Mar-2008 23:45:00","transmission_end_time":"23-Mar-2008 01:20:00","broadcast_duration":5700,"broadcast_on":"http://www.bbc.co.uk/services/bbcone/cambridge","duration":5700,"restriction":{"restricted":true,"message":"Contains very strong language."}},{"transmission_time":"22-Mar-2008 23:45:00","transmission_end_time":"23-Mar-2008 01:20:00","broadcast_duration":5700,"broadcast_on":"http://www.bbc.co.uk/services/bbcone/east","duration":5700,"restriction":{"restricted":true,"message":"Contains very strong language."}},{"transmission_time":"22-Mar-2008 23:45:00","transmission_end_time":"23-Mar-2008 01:20:00","broadcast_duration":5700,"broadcast_on":"http://www.bbc.co.uk/services/bbcone/london","duration":5700,"restriction":{"restricted":true,"message":"Contains very strong language."}},{"transmission_time":"22-Mar-2008 23:45:00","transmission_end_time":"23-Mar-2008 01:20:00","broadcast_duration":5700,"broadcast_on":"http://www.bbc.co.uk/services/bbcone/oxford","duration":5700,"restriction":{"restricted":true,"message":"Contains very strong language."}},{"transmission_time":"22-Mar-2008 23:45:00","transmission_end_time":"23-Mar-2008 01:20:00","broadcast_duration":5700,"broadcast_on":"http://www.bbc.co.uk/services/bbcone/scotland","duration":5700,"restriction":{"restricted":true,"message":"Contains very strong language."}},{"transmission_time":"13-Jun-2008 21:00:00","transmission_end_time":"13-Jun-2008 22:35:00","broadcast_duration":5700,"broadcast_on":"http://www.bbc.co.uk/services/bbcthree","duration":5700,"restriction":{"restricted":true,"message":"Contains very strong language."}}],"people":[],"title":"Road Kill","description":"Thriller. Three college students get sucked into a nightmare when a psychotic truck driver, known only by his CB handle Rusty Nail, seeks revenge for a practical joke.","publisher":{"key":"bbc.co.uk","name":"BBC","country":"GB"},"image":"http://www.bbc.co.uk/iplayer/images/episode/b009nlwk_640_360.jpg","thumbnail":"http://www.bbc.co.uk/iplayer/images/episode/b009nlwk_150_84.jpg","genres":["http://ref.atlasapi.org/genres/atlas/drama","http://www.bbc.co.uk/programmes/genres/drama/thriller"],"tags":[],"clips":[],"same_as":[],"media_type":"video","specialization":"film","aliases":["http://bbc.co.uk/i/9nlwk/","http://www.bbc.co.uk/iplayer/episode/b009nlwk"],"uri":"http://www.bbc.co.uk/programmes/b009nlwk","curie":"bbc:b009nlwk"},{"locations":[{"data_container_format":"application/x-shockwave-flash","video_coding":"video/H264","availability_start":"08-Feb-2011 04:19:14","availability_end":"14-Feb-2011 23:34:00","available_countries":["GB"],"revenue_contract":"free_to_view","transport_type":"link","uri":"http://www.bbc.co.uk/iplayer/episode/b00yf80q","available":false,"duration":3600,"restriction":{}}],"broadcasts":[{"transmission_time":"07-Feb-2011 22:35:00","transmission_end_time":"07-Feb-2011 23:35:00","broadcast_duration":3600,"broadcast_on":"http://www.bbc.co.uk/services/bbcone/ni","duration":3600,"restriction":{}}],"people":[],"title":"Robinson","description":"In 2008, after 25-years as Ian Paisley's deputy, Peter Robinson finally got his hands on power, becoming leader of the DUP and Northern Ireland's First Minister. Less than two years later, he was facing personal and political ruin after he was alleged to have failed to alert the authorities to his wife's financial dealings with two property developers and her 19-year-old lover. Yet today, the First Minister appears stronger than ever. With interviews from enemies and colleagues, past and present, this documentary examines the political life of Peter Robinson, a journey that has taken him from street protests to power sharing.","publisher":{"key":"bbc.co.uk","name":"BBC","country":"GB"},"image":"http://www.bbc.co.uk/iplayer/images/episode/b00yf80q_640_360.jpg","thumbnail":"http://www.bbc.co.uk/iplayer/images/episode/b00yf80q_150_84.jpg","genres":["http://www.bbc.co.uk/programmes/genres/factual"],"tags":[],"clips":[],"same_as":[],"media_type":"video","specialization":"tv","aliases":["http://bbc.co.uk/i/yf80q/","http://www.bbc.co.uk/iplayer/episode/b00yf80q"],"uri":"http://www.bbc.co.uk/programmes/b00yf80q","curie":"bbc:b00yf80q"},{"content":[{"locations":[],"broadcasts":[{"transmission_time":"16-Sep-2007 03:00:00","transmission_end_time":"16-Sep-2007 06:00:00","broadcast_duration":10800,"broadcast_on":"http://www.bbc.co.uk/services/radio1/england","restriction":{}}],"brand_summary":{"title":"Radio 1's After Show","description":"The sound of the morning after the night before. Radio 1's post-weekend music show","uri":"http://www.bbc.co.uk/programmes/b006wk8k","curie":"bbc:b006wk8k"},"people":[],"title":"16/09/2007","description":"With the Trophy Twins. The sound of the morning after the night before.","publisher":{"key":"bbc.co.uk","name":"BBC","country":"GB"},"image":"http://www.bbc.co.uk/iplayer/images/episode/b007yrcx_640_360.jpg","thumbnail":"http://www.bbc.co.uk/iplayer/images/episode/b007yrcx_150_84.jpg","genres":["http://www.bbc.co.uk/programmes/genres/music/danceandelectronica","http://ref.atlasapi.org/genres/atlas/music"],"tags":[],"clips":[],"same_as":[],"media_type":"audio","specialization":"radio","aliases":["http://bbc.co.uk/i/7yrcx/","http://www.bbc.co.uk/iplayer/episode/b007yrcx"],"uri":"http://www.bbc.co.uk/programmes/b007yrcx","curie":"bbc:b007yrcx"},{"locations":[],"broadcasts":[{"transmission_time":"22-Sep-2007 03:00:00","transmission_end_time":"22-Sep-2007 06:00:00","broadcast_duration":10800,"broadcast_on":"http://www.bbc.co.uk/services/radio1/england","restriction":{}}],"brand_summary":{"title":"Radio 1's After Show","description":"The sound of the morning after the night before. Radio 1's post-weekend music show","uri":"http://www.bbc.co.uk/programmes/b006wk8k","curie":"bbc:b006wk8k"},"people":[],"title":"22/09/2007","description":"With the Trophy Twins. The sound of the morning after the night before.","publisher":{"key":"bbc.co.uk","name":"BBC","country":"GB"},"image":"http://www.bbc.co.uk/iplayer/images/episode/b007ys9n_640_360.jpg","thumbnail":"http://www.bbc.co.uk/iplayer/images/episode/b007ys9n_150_84.jpg","genres":["http://www.bbc.co.uk/programmes/genres/music/danceandelectronica","http://ref.atlasapi.org/genres/atlas/music"],"tags":[],"clips":[],"same_as":[],"media_type":"audio","specialization":"radio","aliases":["http://bbc.co.uk/i/7ys9n/","http://www.bbc.co.uk/iplayer/episode/b007ys9n"],"uri":"http://www.bbc.co.uk/programmes/b007ys9n","curie":"bbc:b007ys9n"},{"locations":[],"broadcasts":[{"transmission_time":"23-Sep-2007 03:00:00","transmission_end_time":"23-Sep-2007 06:00:00","broadcast_duration":10800,"broadcast_on":"http://www.bbc.co.uk/services/radio1/england","restriction":{}}],"brand_summary":{"title":"Radio 1's After Show","description":"The sound of the morning after the night before. Radio 1's post-weekend music show","uri":"http://www.bbc.co.uk/programmes/b006wk8k","curie":"bbc:b006wk8k"},"people":[],"title":"23/09/2007","description":"With the Trophy Twins. The sound of the morning after the night before.","publisher":{"key":"bbc.co.uk","name":"BBC","country":"GB"},"image":"http://www.bbc.co.uk/iplayer/images/episode/b007zbtm_640_360.jpg","thumbnail":"http://www.bbc.co.uk/iplayer/images/episode/b007zbtm_150_84.jpg","genres":["http://www.bbc.co.uk/programmes/genres/music/danceandelectronica","http://ref.atlasapi.org/genres/atlas/music"],"tags":[],"clips":[],"same_as":[],"media_type":"audio","specialization":"radio","aliases":["http://bbc.co.uk/i/7zbtm/","http://www.bbc.co.uk/iplayer/episode/b007zbtm"],"uri":"http://www.bbc.co.uk/programmes/b007zbtm","curie":"bbc:b007zbtm"},{"locations":[],"broadcasts":[{"transmission_time":"29-Sep-2007 03:00:00","transmission_end_time":"29-Sep-2007 06:00:00","broadcast_duration":10800,"broadcast_on":"http://www.bbc.co.uk/services/radio1/england","restriction":{}}],"brand_summary":{"title":"Radio 1's After Show","description":"The sound of the morning after the night before. Radio 1's post-weekend music show","uri":"http://www.bbc.co.uk/programmes/b006wk8k","curie":"bbc:b006wk8k"},"people":[],"title":"29/09/2007","description":"With the Trophy Twins. The sound of the morning after the night before.","publisher":{"key":"bbc.co.uk","name":"BBC","country":"GB"},"image":"http://www.bbc.co.uk/iplayer/images/episode/b007zcql_640_360.jpg","thumbnail":"http://www.bbc.co.uk/iplayer/images/episode/b007zcql_150_84.jpg","genres":["http://www.bbc.co.uk/programmes/genres/music/danceandelectronica","http://ref.atlasapi.org/genres/atlas/music"],"tags":[],"clips":[],"same_as":[],"media_type":"audio","specialization":"radio","aliases":["http://bbc.co.uk/i/7zcql/","http://www.bbc.co.uk/iplayer/episode/b007zcql"],"uri":"http://www.bbc.co.uk/programmes/b007zcql","curie":"bbc:b007zcql"},{"locations":[],"broadcasts":[{"transmission_time":"30-Sep-2007 05:00:00","transmission_end_time":"30-Sep-2007 06:00:00","broadcast_duration":3600,"broadcast_on":"http://www.bbc.co.uk/services/radio1/england","restriction":{}}],"brand_summary":{"title":"Radio 1's After Show","description":"The sound of the morning after the night before. Radio 1's post-weekend music show","uri":"http://www.bbc.co.uk/programmes/b006wk8k","curie":"bbc:b006wk8k"},"people":[],"title":"30/09/2007","description":"With the Trophy Twins. The sound of the morning after the night before.","publisher":{"key":"bbc.co.uk","name":"BBC","country":"GB"},"image":"http://www.bbc.co.uk/iplayer/images/episode/b007zxcy_640_360.jpg","thumbnail":"http://www.bbc.co.uk/iplayer/images/episode/b007zxcy_150_84.jpg","genres":["http://www.bbc.co.uk/programmes/genres/music/danceandelectronica","http://ref.atlasapi.org/genres/atlas/music"],"tags":[],"clips":[],"same_as":[],"media_type":"audio","specialization":"radio","aliases":["http://bbc.co.uk/i/7zxcy/","http://www.bbc.co.uk/iplayer/episode/b007zxcy"],"uri":"http://www.bbc.co.uk/programmes/b007zxcy","curie":"bbc:b007zxcy"},{"locations":[],"broadcasts":[{"transmission_time":"06-Oct-2007 03:00:00","transmission_end_time":"06-Oct-2007 06:00:00","broadcast_duration":10800,"broadcast_on":"http://www.bbc.co.uk/services/radio1/england","restriction":{}}],"brand_summary":{"title":"Radio 1's After Show","description":"The sound of the morning after the night before. Radio 1's post-weekend music show","uri":"http://www.bbc.co.uk/programmes/b006wk8k","curie":"bbc:b006wk8k"},"people":[],"title":"06/10/2007","description":"With the Trophy Twins. The sound of the morning after the night before.","publisher":{"key":"bbc.co.uk","name":"BBC","country":"GB"},"image":"http://www.bbc.co.uk/iplayer/images/episode/b007zy4m_640_360.jpg","thumbnail":"http://www.bbc.co.uk/iplayer/images/episode/b007zy4m_150_84.jpg","genres":["http://www.bbc.co.uk/programmes/genres/music/danceandelectronica","http://ref.atlasapi.org/genres/atlas/music"],"tags":[],"clips":[],"same_as":[],"media_type":"audio","specialization":"radio","aliases":["http://bbc.co.uk/i/7zy4m/","http://www.bbc.co.uk/iplayer/episode/b007zy4m"],"uri":"http://www.bbc.co.uk/programmes/b007zy4m","curie":"bbc:b007zy4m"},{"locations":[],"broadcasts":[{"transmission_time":"07-Oct-2007 03:00:00","transmission_end_time":"07-Oct-2007 06:00:00","broadcast_duration":10800,"broadcast_on":"http://www.bbc.co.uk/services/radio1/england","restriction":{}}],"brand_summary":{"title":"Radio 1's After Show","description":"The sound of the morning after the night before. Radio 1's post-weekend music show","uri":"http://www.bbc.co.uk/programmes/b006wk8k","curie":"bbc:b006wk8k"},"people":[],"title":"07/10/2007","description":"With the Trophy Twins. The sound of the morning after the night before.","publisher":{"key":"bbc.co.uk","name":"BBC","country":"GB"},"image":"http://www.bbc.co.uk/iplayer/images/episode/b0080mjj_640_360.jpg","thumbnail":"http://www.bbc.co.uk/iplayer/images/episode/b0080mjj_150_84.jpg","genres":["http://www.bbc.co.uk/programmes/genres/music/danceandelectronica","http://ref.atlasapi.org/genres/atlas/music"],"tags":[],"clips":[],"same_as":[],"media_type":"audio","specialization":"radio","aliases":["http://bbc.co.uk/i/80mjj/","http://www.bbc.co.uk/iplayer/episode/b0080mjj"],"uri":"http://www.bbc.co.uk/programmes/b0080mjj","curie":"bbc:b0080mjj"}],"title":"Radio 1's After Show","description":"The sound of the morning after the night before. Radio 1's post-weekend music show","publisher":{"key":"bbc.co.uk","name":"BBC","country":"GB"},"genres":["http://www.bbc.co.uk/programmes/genres/music/danceandelectronica","http://ref.atlasapi.org/genres/atlas/music"],"tags":[],"clips":[],"same_as":[],"media_type":"video","aliases":[],"uri":"http://www.bbc.co.uk/programmes/b006wk8k","curie":"bbc:b006wk8k"},{"locations":[],"broadcasts":[{"transmission_time":"27-Jan-2009 22:30:00","transmission_end_time":"27-Jan-2009 23:30:00","broadcast_duration":3600,"broadcast_on":"http://www.bbc.co.uk/services/radio2","duration":3600,"restriction":{}}],"people":[],"title":"'I Hope We Passed The Audition'","description":"'I hope we passed the audition': John Lennon's final words from the Beatles' last public performance, a rooftop concert in 1969. This programme explores how the concert came about.","publisher":{"key":"bbc.co.uk","name":"BBC","country":"GB"},"image":"http://www.bbc.co.uk/iplayer/images/episode/b00h3450_640_360.jpg","thumbnail":"http://www.bbc.co.uk/iplayer/images/episode/b00h3450_150_84.jpg","genres":["http://ref.atlasapi.org/genres/atlas/music","http://www.bbc.co.uk/programmes/genres/music/classicpopandrock"],"tags":[],"clips":[],"same_as":[],"media_type":"audio","specialization":"radio","aliases":["http://bbc.co.uk/i/h3450/","http://www.bbc.co.uk/iplayer/episode/b00h3450"],"uri":"http://www.bbc.co.uk/programmes/b00h3450","curie":"bbc:b00h3450"},{"content":[{"episode_number":123,"series_number":123,"locations":[],"broadcasts":[{"transmission_time":"30-Jan-2011 12:00:00","transmission_end_time":"30-Jan-2011 14:00:00","broadcast_duration":7200,"broadcast_on":"http://www.bbc.co.uk/services/northampton","id":"bbc:p00d6gz4","published_duration":7200,"restriction":{}}],"brand_summary":{"title":"Green Welly Show","uri":"http://www.bbc.co.uk/programmes/p001d7q3","curie":"bbc:p001d7q3"},"people":[],"title":"30/01/2011","description":"Gardening tips and advice with Johnnie Amos and Mark Dean.","publisher":{"key":"bbc.co.uk","name":"BBC","country":"GB"},"image":"http://node2.bbcimg.co.uk/iplayer/images/episode/p00d6gyp_640_360.jpg","thumbnail":"http://node2.bbcimg.co.uk/iplayer/images/episode/p00d6gyp_150_84.jpg","genres":[],"tags":[],"clips":[],"same_as":[],"media_type":"video","aliases":[],"uri":"http://www.bbc.co.uk/programmes/p00d6gyp","curie":"bbc:p00d6gyp"}],"title":"Green Welly Show","publisher":{"key":"bbc.co.uk","name":"BBC","country":"GB"},"genres":[],"tags":[],"clips":[],"same_as":[],"media_type":"video","aliases":[],"uri":"http://www.bbc.co.uk/programmes/p001d7q3","curie":"bbc:p001d7q3"},{"content":[{"episode_number":1,"locations":[],"broadcasts":[{"transmission_time":"14-Nov-2007 23:00:00","transmission_end_time":"14-Nov-2007 23:30:00","broadcast_duration":1800,"broadcast_on":"http://www.bbc.co.uk/services/radio2","restriction":{}}],"brand_summary":{"title":"Hep to the Jive","description":"A celebration of the career of US singer and bandleader Cab Calloway","uri":"http://www.bbc.co.uk/programmes/b0088xhr","curie":"bbc:b0088xhr"},"series_summary":{"title":"Hep to the Jive","description":"A celebration of the career of US singer and bandleader Cab Calloway","uri":"http://www.bbc.co.uk/programmes/b0088xhr","curie":"bbc:b0088xhr"},"people":[],"title":"Episode 1","description":"Cab Calloway at 100\n\n1/4. Clarke Peters begins a celebration of his musical hero - singer, bandleader, film star, dancer and chief hepster Cab Calloway. It's the 100th anniverary of Cab's birth. He rose from the back streets of Baltimore to lead the best-paid black swing orchestra of the 1930s, was a pioneer in radio and drew new audiences in the 1950s in musical theatre.","publisher":{"key":"bbc.co.uk","name":"BBC","country":"GB"},"image":"http://www.bbc.co.uk/iplayer/images/episode/b007kmjf_640_360.jpg","thumbnail":"http://www.bbc.co.uk/iplayer/images/episode/b007kmjf_150_84.jpg","genres":["http://ref.atlasapi.org/genres/atlas/music","http://www.bbc.co.uk/programmes/genres/music/jazzandblues"],"tags":[],"clips":[],"same_as":[],"media_type":"audio","specialization":"radio","aliases":["http://bbc.co.uk/i/7kmjf/","http://www.bbc.co.uk/iplayer/episode/b007kmjf"],"uri":"http://www.bbc.co.uk/programmes/b007kmjf","curie":"bbc:b007kmjf"},{"episode_number":2,"locations":[],"broadcasts":[{"transmission_time":"21-Nov-2007 23:00:00","transmission_end_time":"21-Nov-2007 23:30:00","broadcast_duration":1800,"broadcast_on":"http://www.bbc.co.uk/services/radio2","restriction":{}}],"brand_summary":{"title":"Hep to the Jive","description":"A celebration of the career of US singer and bandleader Cab Calloway","uri":"http://www.bbc.co.uk/programmes/b0088xhr","curie":"bbc:b0088xhr"},"series_summary":{"title":"Hep to the Jive","description":"A celebration of the career of US singer and bandleader Cab Calloway","uri":"http://www.bbc.co.uk/programmes/b0088xhr","curie":"bbc:b0088xhr"},"people":[],"title":"Episode 2","description":"Clarke Peters continues a celebration of his musical hero - singer, bandleader, film star, dancer and chief hepster Cab Calloway. The revised series also marks the centenary of Cab's birth.\n\n2/4. With his outrageous suits, jive talking, powerful singing and hi-de-ho-ing, Cab becomes a legend at New York's famous Cotton Club.","publisher":{"key":"bbc.co.uk","name":"BBC","country":"GB"},"image":"http://www.bbc.co.uk/iplayer/images/episode/b007kmk6_640_360.jpg","thumbnail":"http://www.bbc.co.uk/iplayer/images/episode/b007kmk6_150_84.jpg","genres":["http://ref.atlasapi.org/genres/atlas/music","http://www.bbc.co.uk/programmes/genres/music/jazzandblues"],"tags":[],"clips":[],"same_as":[],"media_type":"audio","specialization":"radio","aliases":["http://bbc.co.uk/i/7kmk6/","http://www.bbc.co.uk/iplayer/episode/b007kmk6"],"uri":"http://www.bbc.co.uk/programmes/b007kmk6","curie":"bbc:b007kmk6"},{"episode_number":3,"locations":[],"broadcasts":[{"transmission_time":"28-Nov-2007 23:00:00","transmission_end_time":"28-Nov-2007 23:30:00","broadcast_duration":1800,"broadcast_on":"http://www.bbc.co.uk/services/radio2","restriction":{}}],"brand_summary":{"title":"Hep to the Jive","description":"A celebration of the career of US singer and bandleader Cab Calloway","uri":"http://www.bbc.co.uk/programmes/b0088xhr","curie":"bbc:b0088xhr"},"series_summary":{"title":"Hep to the Jive","description":"A celebration of the career of US singer and bandleader Cab Calloway","uri":"http://www.bbc.co.uk/programmes/b0088xhr","curie":"bbc:b0088xhr"},"people":[],"title":"Episode 3","description":"Clarke Peters continues his celebration of his musical hero - singer, bandleader, film star, dancer and chief hepster Cab Calloway. The revised series also marks the centenary of Cab's birth.\n\n3/4. The Cab Calloway Orchestra becomes one of the highest-paid bands of the swing era - no real surprise with jazz legends Dizzy Gillespie and Ben Webster as sidemen.","publisher":{"key":"bbc.co.uk","name":"BBC","country":"GB"},"image":"http://www.bbc.co.uk/iplayer/images/episode/b007kmkv_640_360.jpg","thumbnail":"http://www.bbc.co.uk/iplayer/images/episode/b007kmkv_150_84.jpg","genres":["http://ref.atlasapi.org/genres/atlas/music","http://www.bbc.co.uk/programmes/genres/music/jazzandblues"],"tags":[],"clips":[],"same_as":[],"media_type":"audio","specialization":"radio","aliases":["http://bbc.co.uk/i/7kmkv/","http://www.bbc.co.uk/iplayer/episode/b007kmkv"],"uri":"http://www.bbc.co.uk/programmes/b007kmkv","curie":"bbc:b007kmkv"},{"episode_number":4,"locations":[],"broadcasts":[{"transmission_time":"05-Dec-2007 23:00:00","transmission_end_time":"05-Dec-2007 23:30:00","broadcast_duration":1800,"broadcast_on":"http://www.bbc.co.uk/services/radio2","restriction":{}}],"brand_summary":{"title":"Hep to the Jive","description":"A celebration of the career of US singer and bandleader Cab Calloway","uri":"http://www.bbc.co.uk/programmes/b0088xhr","curie":"bbc:b0088xhr"},"series_summary":{"title":"Hep to the Jive","description":"A celebration of the career of US singer and bandleader Cab Calloway","uri":"http://www.bbc.co.uk/programmes/b0088xhr","curie":"bbc:b0088xhr"},"people":[],"title":"Episode 4","description":"Clarke Peters concludes this celebration of his musical hero - singer, bandleader, film star, dancer and chief hepster Cab Calloway. The revised series also marks the centenary of Cab's birth. \n\n4/4. This episode traces Cab's transformation from band leader and singer to an icon of African-American music.","publisher":{"key":"bbc.co.uk","name":"BBC","country":"GB"},"image":"http://www.bbc.co.uk/iplayer/images/episode/b007kmlk_640_360.jpg","thumbnail":"http://www.bbc.co.uk/iplayer/images/episode/b007kmlk_150_84.jpg","genres":["http://ref.atlasapi.org/genres/atlas/music","http://www.bbc.co.uk/programmes/genres/music/jazzandblues"],"tags":[],"clips":[],"same_as":[],"media_type":"audio","specialization":"radio","aliases":["http://bbc.co.uk/i/7kmlk/","http://www.bbc.co.uk/iplayer/episode/b007kmlk"],"uri":"http://www.bbc.co.uk/programmes/b007kmlk","curie":"bbc:b007kmlk"}],"title":"Hep to the Jive","description":"A celebration of the career of US singer and bandleader Cab Calloway","publisher":{"key":"bbc.co.uk","name":"BBC","country":"GB"},"genres":["http://ref.atlasapi.org/genres/atlas/music","http://www.bbc.co.uk/programmes/genres/music/jazzandblues"],"tags":[],"clips":[],"same_as":[],"media_type":"video","aliases":[],"uri":"http://www.bbc.co.uk/programmes/b0088xhr","curie":"bbc:b0088xhr"},{"locations":[{"data_container_format":"application/x-shockwave-flash","video_coding":"video/H264","availability_start":"24-Dec-2010 00:03:43","availability_end":"30-Dec-2010 21:59:00","available_countries":["GB"],"revenue_contract":"free_to_view","transport_type":"link","uri":"http://www.bbc.co.uk/iplayer/episode/b00xp4ps","available":false,"duration":3600,"restriction":{}}],"broadcasts":[{"transmission_time":"23-Dec-2010 21:00:00","transmission_end_time":"23-Dec-2010 22:00:00","broadcast_duration":3600,"broadcast_on":"http://www.bbc.co.uk/services/bbcone/scotland","duration":3600,"restriction":{}}],"people":[],"title":"The Rise and Lies of Tommy Sheridan","description":"The story of the rise and fall of the former Scottish Socialist MSP Tommy Sheridan. Convicted of perjury for lying about a sex scandal, the film interviews Tommy Sheridan just before his conviction, shows the police video tapes of Tommy Sheridan's interrogation and speaks to the people linked to the trial that gripped Scotland.","publisher":{"key":"bbc.co.uk","name":"BBC","country":"GB"},"image":"http://www.bbc.co.uk/iplayer/images/episode/b00xp4ps_640_360.jpg","thumbnail":"http://www.bbc.co.uk/iplayer/images/episode/b00xp4ps_150_84.jpg","genres":["http://www.bbc.co.uk/programmes/genres/factual/politics","http://ref.atlasapi.org/genres/atlas/factual"],"tags":[],"clips":[],"same_as":[],"media_type":"video","specialization":"tv","aliases":["http://bbc.co.uk/i/xp4ps/","http://www.bbc.co.uk/iplayer/episode/b00xp4ps"],"uri":"http://www.bbc.co.uk/programmes/b00xp4ps","curie":"bbc:b00xp4ps"}]}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
require './lib/ratlas'
|
2
|
+
require 'rspec'
|
3
|
+
require 'rspec-expectations'
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
describe Ratlas::Discover do
|
8
|
+
|
9
|
+
context "when used" do
|
10
|
+
|
11
|
+
it "should be able to tell me about drama on the bbc" do
|
12
|
+
|
13
|
+
Ratlas::Discover.find(:genre => 'drama').and(:publisher => 'bbc.co.uk').each do |n|
|
14
|
+
n.title.class.should == String
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
describe Ratlas::Search do
|
24
|
+
|
25
|
+
context "when used" do
|
26
|
+
|
27
|
+
it "should be able to tell glee" do
|
28
|
+
|
29
|
+
Ratlas::Search.find(:q => 'glee').each do |n|
|
30
|
+
n.title.class.should == String
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
describe Ratlas::Schedule do
|
41
|
+
|
42
|
+
context "when used" do
|
43
|
+
|
44
|
+
it "should be able to tell me about a url" do
|
45
|
+
|
46
|
+
Ratlas::Schedule.find(:all).where(:from => Time.now.to_i, :to=> Time.now.to_i + 3600).and(:channel => 'bbcone', :publisher => 'bbc.co.uk').each do |n|
|
47
|
+
n.items.class.should == Array
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
data/spec/ratlas_spec.rb
ADDED
metadata
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ratlas
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Daniel Cooper
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-04-06 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rspec
|
16
|
+
requirement: &10678740 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *10678740
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: bundler
|
27
|
+
requirement: &10673720 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.0.0
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *10673720
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: jeweler
|
38
|
+
requirement: &10608440 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 1.5.2
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *10608440
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: hashie
|
49
|
+
requirement: &10585940 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *10585940
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: addressable
|
60
|
+
requirement: &10552200 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *10552200
|
69
|
+
description: Rutlas allows you to consume to the Atlas api without getting your hands
|
70
|
+
dirty
|
71
|
+
email: daniel@14lines.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files:
|
75
|
+
- LICENSE.txt
|
76
|
+
- README.rdoc
|
77
|
+
files:
|
78
|
+
- Gemfile
|
79
|
+
- Gemfile.lock
|
80
|
+
- LICENSE.txt
|
81
|
+
- README.rdoc
|
82
|
+
- Rakefile
|
83
|
+
- VERSION
|
84
|
+
- lib/patches/string.rb
|
85
|
+
- lib/ratlas.rb
|
86
|
+
- lib/ratlas/content.rb
|
87
|
+
- lib/ratlas/discover.rb
|
88
|
+
- lib/ratlas/query.rb
|
89
|
+
- lib/ratlas/queryable.rb
|
90
|
+
- lib/ratlas/response.rb
|
91
|
+
- lib/ratlas/schedule.rb
|
92
|
+
- lib/ratlas/search.rb
|
93
|
+
- spec/container_spec.rb
|
94
|
+
- spec/fixtures/content.json
|
95
|
+
- spec/live_container_spec.rb
|
96
|
+
- spec/ratlas_spec.rb
|
97
|
+
homepage: http://github.com/daniel_cooper/ratlas
|
98
|
+
licenses:
|
99
|
+
- MIT
|
100
|
+
post_install_message:
|
101
|
+
rdoc_options: []
|
102
|
+
require_paths:
|
103
|
+
- lib
|
104
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
segments:
|
111
|
+
- 0
|
112
|
+
hash: 2724427395774470526
|
113
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
|
+
none: false
|
115
|
+
requirements:
|
116
|
+
- - ! '>='
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
requirements: []
|
120
|
+
rubyforge_project:
|
121
|
+
rubygems_version: 1.7.2
|
122
|
+
signing_key:
|
123
|
+
specification_version: 3
|
124
|
+
summary: A Atlas api Ruby client
|
125
|
+
test_files:
|
126
|
+
- spec/container_spec.rb
|
127
|
+
- spec/live_container_spec.rb
|
128
|
+
- spec/ratlas_spec.rb
|