Skip to content

Commit

Permalink
Adding some info to the readme and renaming Facade to Queue
Browse files Browse the repository at this point in the history
  • Loading branch information
knaveofdiamonds committed Dec 7, 2009
1 parent 2e37276 commit 9c088f0
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 7 deletions.
39 changes: 38 additions & 1 deletion README.rdoc
@@ -1,6 +1,37 @@
= encoding-dot-com

Description goes here.
A client library for the encoding.com API.

Supports all the actions of the encoding.com API. Example usage:

require "encoding_dot_com"

# Create an interface to the encoding.com queue with your user id and secret
queue = EncodingDotCom::Queue.new(1234, "secret")

# Create one or more output formats
format = EncodingDotCom::Format.create("output" => "flv")

# Get an media item processed. You can pass multiple output formats in a hash.
media_id = queue.add_and_process("http://source/url/here", "http://destination/url/here" => format)

queue.status(media_id) # => returns a string like "Waiting for encoder" or "Finished"
queue.info(media_id) # => returns information about an item in the queue

See the API documentation for more details.

By default the library uses Curb for http - there is also a Net/HTTP
adapter and it is easy to write your own.

== Dependencies

* Nokogiri
* (Optionally) curb

== TODOs

* Flesh out validations to ensure that bad data does not get submitted to
encoding.com

== Note on Patches/Pull Requests

Expand All @@ -13,6 +44,12 @@ Description goes here.
bump version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.

== Authors

* Roland Swingler
* Alan Kennedy
* Levent Ali

== Copyright

Copyright (c) 2009 Enrich Social Productions Ltd. See LICENSE for details.
2 changes: 1 addition & 1 deletion lib/encoding-dot-com.rb
@@ -1,5 +1,5 @@
require 'encoding_dot_com/errors'
require 'encoding_dot_com/facade'
require 'encoding_dot_com/queue'
require 'encoding_dot_com/attribute_restrictions'
require 'encoding_dot_com/format'
require 'encoding_dot_com/video_format'
Expand Down
2 changes: 2 additions & 0 deletions lib/encoding_dot_com.rb
@@ -0,0 +1,2 @@
require 'encoding-dot-com'

Expand Up @@ -4,7 +4,7 @@ module EncodingDotCom
# A remote facade to the encoding.com API.
#
# The facade is stateless and can be reused for multiple requests.
class Facade
class Queue
# Where encoding.com expects messages to be posted to.
ENDPOINT = "http://manage.encoding.com/"

Expand Down
6 changes: 3 additions & 3 deletions spec/facade_spec.rb → spec/queue_spec.rb
@@ -1,14 +1,14 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "Encoding.com Facade" do
describe "Encoding.com Queue facade" do

before :each do
@http = mock("Http Interface")
@facade = EncodingDotCom::Facade.new(1234, "abcd", @http)
@facade = EncodingDotCom::Queue.new(1234, "abcd", @http)
end

def expect_xml_with_xpath(xpath)
@http.should_receive(:post).with(EncodingDotCom::Facade::ENDPOINT,
@http.should_receive(:post).with(EncodingDotCom::Queue::ENDPOINT,
EncodingXpathMatcher.new(xpath)).and_return(stub("Http Response", :code => "200", :body => ""))
end

Expand Down
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Expand Up @@ -5,7 +5,6 @@
require 'spec'
require 'spec/autorun'
require 'nokogiri'
require 'encoding_dot_com/facade'

class EncodingXpathMatcher
def initialize(xpath)
Expand Down

0 comments on commit 9c088f0

Please sign in to comment.