Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

first functionality skeleton

  • Loading branch information...
commit 2994011705d63139a6f98eb5343d09a584c1b971 1 parent f8d3c8c
Mikhailov Anatoly authored
View
20 MIT-LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2009 [name of plugin creator]
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
6 README
@@ -0,0 +1,6 @@
+RubyEncodingWrapper
+===================
+
+
+
+Copyright (c) 2009 Mikhailov Anatoly & Tsech Edward, released under the MIT license
View
23 Rakefile
@@ -0,0 +1,23 @@
+require 'rake'
+require 'rake/testtask'
+require 'rake/rdoctask'
+
+desc 'Default: run unit tests.'
+task :default => :test
+
+desc 'Test the ruby_encoding_wrapper plugin.'
+Rake::TestTask.new(:test) do |t|
+ t.libs << 'lib'
+ t.libs << 'test'
+ t.pattern = 'test/**/*_test.rb'
+ t.verbose = true
+end
+
+desc 'Generate documentation for the ruby_encoding_wrapper plugin.'
+Rake::RDocTask.new(:rdoc) do |rdoc|
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = 'RubyEncodingWrapper'
+ rdoc.options << '--line-numbers' << '--inline-source'
+ rdoc.rdoc_files.include('README')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
View
1  init.rb
@@ -0,0 +1 @@
+# Include hook code here
View
1  install.rb
@@ -0,0 +1 @@
+# Install hook code here
View
37 lib/ruby_encoding_wrapper.rb
@@ -0,0 +1,37 @@
+require 'rubygems'
+require 'uri'
+require 'net/http'
+require 'builder'
+
+class RubyEncodingWrapper
+
+ def initialize(user_id=nil,user_key=nil)
+ self.userid = user_id
+ self.userkey = user_key
+ self.url = 'manage.encoding.com:80'
+ end
+
+ def request_encoding(action,source,format={})
+ #xml generation
+ xml.instruct! :xml, :version => "1.1", :encoding => "UTF-8"
+ xml.userid 'id'
+ xml.userkey 'key'
+ xml.action 'AddMedia'
+ xml.source @video
+ xml.format do
+
+ end
+
+
+ request_send(xml)
+ end
+
+
+ private
+ def request_send(xml)
+ url = URI.parse('http://localhost:3000/someservice/')
+ request = Net::HTTP::Post.new(url.path)
+ request.body = "<?xml version='1.0' encoding='UTF-8'?><somedata><name>Test Name 1</name><description>Some data for Unit testing</description></somedata>"
+ response = Net::HTTP.start(url.host, url.port) {|http| http.request(request)}
+ end
+end
View
4 tasks/ruby_encoding_wrapper_tasks.rake
@@ -0,0 +1,4 @@
+# desc "Explaining what the task does"
+# task :ruby_encoding_wrapper do
+# # Task goes here
+# end
View
8 test/ruby_encoding_wrapper_test.rb
@@ -0,0 +1,8 @@
+require 'test_helper'
+
+class RubyEncodingWrapperTest < ActiveSupport::TestCase
+ # Replace this with your real tests.
+ test "the truth" do
+ assert true
+ end
+end
View
3  test/test_helper.rb
@@ -0,0 +1,3 @@
+require 'rubygems'
+require 'active_support'
+require 'active_support/test_case'
View
1  uninstall.rb
@@ -0,0 +1 @@
+# Uninstall hook code here

0 comments on commit 2994011

Please sign in to comment.
Something went wrong with that request. Please try again.