require 'xml/libxml'
require 'xml/libxslt'
xslt = XML::XSLT.new()
xslt.xml = "news_links.xml"
xslt.xsl = "links2html.xsl"
out = xslt.serve()
print out;
Harjeet Singh's Library tagged → View Popular
Economical Use of Amazon S3 with Ruby on Rails
Economical Use of Amazon S3 with Ruby on Rails
Sending mail asynchronously in Rails using Workling
Sending mail asynchronously in Rails using Workling
If you want to send mail asynchronously in your rails app, but don’t want to bother with using a queue server like Starling, then have a go at this…
First, run this:
./script/plugin install git://github.com/purzelrakete/workling.git
./script/plugin install git://github.com/langalex/workling_mailer.git
./script/plugin install git://github.com/matthewrudy/rudeq.git
rake queue:setup
rake db:migrate
-
If you want to send mail asynchronously in your rails app, but don’t want to bother with using a queue server like Starling, then have a go at this…
First, run this:
./script/plugin install git://github.com/purzelrakete/workling.git
./script/plugin install git://github.com/langalex/workling_mailer.git
./script/plugin install git://github.com/matthewrudy/rudeq.git
rake queue:setup
rake db:migratenow add this to your environment:
Workling::Clients::MemcacheQueueClient.memcache_client_class = RudeQ::Client
Workling::Remote.dispatcher = Workling::Remote::Runners::ClientRunner.newFinally, add this into the body of your mailer classes:
include AsynchMailnow start the workling client:
./script/workling_client startdone!
Sending mail asynchronously in Rails using Workling
Sending mail asynchronously in Rails using Workling
If you want to send mail asynchronously in your rails app, but don’t want to bother with using a queue server like Starling, then have a go at this…
-
include AsynchMailnow start the workling client:
./script/workling_client start
matthewrudy's rudeq at master - GitHub
Description: A rails DB-based queue plugin
-
RudeQ
=============
A simple DB based queue,
designed for situations where a server based queue is unnecessary.
The complete guide to setting up Starling | Ruby Pond
The complete guide to setting up Starling
Simple AMQP Library for Ruby
Simple AMQP Library for Ruby
-
- It is designed for highly scalable deployment scenarios, so it will give you room to grow without having to re-architect your software;
- It defines a language-neutral wire format, so you can use it to integrate with other languages;
- It incorporates a robust and generalized message routing infrastructure.
AMQP model does have some nice benefits:
Starling: A Ruby Persistent Queue Server That Speaks Memcached
Starling: A Ruby Persistent Queue Server
RabbitMQ
RudeQ
Scaling
Beanstalkd
-
It's been around for a while now, but Starling is a "light-weight persistent queue server that speaks the MemCache protocol." Starling makes it ridiculously easy to set up a network-accessible queue (or many queues) for, say, asynchronous job processing between multiple processes and machines. It was developed by Twitter to handle the heavy amount of queueing necessary to keep their service ticking over.
-
FiveRuns have even created their own fork that, they say, is significantly faster.
- 5 more annotations...
DZone Snippets: Store, sort and share source code, with tag goodness
DZone Snippets
17093 users tagging and storing useful source code snippets
Pretty Print XML using Ruby [ruby] [xml] [xslt] [format] [pretty] [print]
Pretty Print XML using Ruby
-
require 'rexml/document'
include REXML
def pretty_print(parent_node, itab)
buffer = ''
parent_node.elements.each do |node|
buffer += ' ' * itab + "<#{node.name}#{get_att_list(node)}"
if node.to_a.length > 0
buffer += ">"
if node.text.nil?
buffer += "\n"
buffer += pretty_print(node,itab+2)
buffer += ' ' * itab + "</#{node.name}>\n"
else
node_text = node.text.strip
if node_text != ''
buffer += node_text
buffer += "</#{node.name}>\n"
else
buffer += "\n" + pretty_print(node,itab+2)
buffer += ' ' * itab + "</#{node.name}>\n"
end
end
else
buffer += "/>\n"
end
end
buffer
end
def get_att_list(node)
att_list = ''
node.attributes.each { |attribute, val| att_list += " #{attribute}='#{val}'" }
att_list
end
def pretty_xml(doc)
buffer = ''
xml_declaration = doc.to_s.match('<\?.*\?>').to_s
buffer += "#{xml_declaration}\n" if not xml_declaration.nil?
xml_doctype = doc.to_s.match('<\!.*\">').to_s
buffer += "#{xml_doctype}\n" if not xml_doctype.nil?
buffer += "<#{doc.root.name}#{get_att_list(doc.root)}"
if doc.root.to_a.length > 0
buffer +=">\n#{pretty_print(doc.root,2)}</#{doc.root.name}>"
else
buffer += "/>\n"
end
end
xml_data = "<hi id='124'><yo><a id='1'/><b/><c/></yo><sushi><love>Ruby</love></sushi></hi>"
doc = Document.new(xml_data)
pretty_xml(doc) -
Although I haven't tried running the following XSL code, this might actually have been a better solution to my problem. source: http://www.printk.net/~bds/indent.html
*Pretty Print XML using XSLT* - 1 more annotations...
Transform an XML document with XSLT [ruby] [xml] [xslt]
Transform an XML document with XSLT
-
// Transform an XML file into HTML using XSLT. sources: Ruby/XSLT - http://urltea.com/1nql ruby-talk-google - http://urltea.com/1nqm
xmlformat: XML Document Formatter
xmlformat: XML Document Formatter
xmlformat is a configurable formatter (or "pretty-printer") for XML documents. It provides control over indentation, line-breaking, and text wrapping. These properties can be defined on a per-element basis.
-
xmlformat: XML Document Formatter
xmlformat is a configurable formatter (or "pretty-printer") for XML documents.
It provides control over indentation, line-breaking, and text wrapping.
These properties can be defined on a per-element basis. -
Distribution files:
xmlformat-1.04.tar.gz
(153 KB)
(last modified: August 14, 2006)
xmlformat-1.04.zip
(195 KB)
(last modified: August 14, 2006)
predic8 Announces Open Source SOAP Monitor
predic8 Announces Open Source SOAP Monitor
-
predic8 Announces Open Source SOAP Monitor
Posted by:
Thomas Bayer
on
July 02, 2009
DIGG
<script type="text/javascript">
function _parseDiggURL() {
var _diggURL = "http://digg.com/submit?phase=2&topic=Programming&url="
_diggURL += encodeURIComponent(location.href);
_diggURL += "&title=";
_diggURL += escape ( "predic8 Announces Open Source SOAP Monitor") ;
_diggURL += "&bodytext=";
_diggURL += escape ( "predic8 GmbH released an open source distribution of its SOAP tool <a href="http://www.predic8.com/open-source/soap-monitor/">Membrane Monitor</a>. <br><br>The tool helps developers to log and analyse SOAP messages. Captured SOAP messages are formatted by a new XML beautifier that makes it easy to analyse even complex messages.<br><br>Membrane Monitor basically is an HTTP forwarding proxy but it recognizes XML and SOAP in the payload of a message. The monitor starts out of the box without any configuration. The requirements are Windows and at least a Java 1.5 runtime.<br> <br>To learn more visit <a href="http://www.predic8.com">predic8.com</a>").substring(0,300);
return _diggURL ;
}
</script>
predic8 GmbH released an open source distribution of its SOAP tool Membrane Monitor.
The tool helps developers to log and analyse SOAP messages. Captured SOAP messages are formatted by a new XML beautifier that makes it easy to analyse even complex messages.
Membrane Monitor basically is an HTTP forwarding proxy but it recognizes XML and SOAP in the payload of a message. The monitor starts out of the box without any configuration. The requirements are Windows and at least a Java 1.5 runtime.
To learn more visit predic8.com
http-access2 - Trac
'httpclient' gives something like the functionality of libwww-perl (LWP) in Ruby. 'httpclient' formerly known as 'http-access2'.
-
- methods like GET/HEAD/POST/* via HTTP/1.1.
- HTTPS(SSL), Cookies, proxy, authentication(Digest, NTLM, Basic), etc.
- asynchronous HTTP request, streaming HTTP request.
- by contrast with net/http in standard distribution;
- Cookies support
- MT-safe
- streaming POST (POST with File/IO)
- Digest auth
- Negotiate/NTLM auth for WWW-Authenticate (requires net/htlm module)
- NTLM auth for WWW-Authenticate/Proxy-Authenticate (requires win32/sspi module)
- extensible with filter interface
- you don't have to care HTTP/1.1 persistent connection
(httpclient cares instead of you) - Not supported now
- Cache
- Rather advanced HTTP/1.1 usage such as Range, deflate, etc.
(of course you can set it in header by yourself)
- Cache
- Cookies support
Features:
- methods like GET/HEAD/POST/* via HTTP/1.1.
Getting Started with SOAP4R — Quick off the Mark
Getting Started with SOAP4R
-
# Create Lyris Driver
require "soap/wsdlDriver"
wsdl = "http://lyris:82/?wsdl"
driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
# Add authentication
user = "admin"
pass = "xxxxx"
driver.options["protocol.http.basic_auth"] << [wsdl,user,pass]
SOAP Lite Client, the Documentation » File: README
SOAP Lite Client
-
SYNOPSIS:
require 'soap/lc'
wsdl = "http://localhost:3000/simple/wsdl"
s = SOAP::LC.new( ).wsdl( wsdl ).call( "HelloWorld", { :from => "Greg" } )
r = s.result
puts r.to_h
# Or
r = SOAP::LC["http://localhost:3000/wsdl"].HelloWorld( :from => "greg" ).result
ruote - index
Ruote is a workflow engine written in Ruby. It’s a runtime for long running [business] processes.
-
Ruote is a workflow engine written in Ruby. It’s a runtime for long running [business] processes.
-
There is a small quickstart available, it focuses on the ruote ‘gem’. For an example integration in Rails there is an online demo (though it’s still running an old version)
Processes are explicitely defined and may be explicitely handled (start, pause, cancel, update).
A process is started by handing a [business] process definition to the engine. A process definition is expressed in ruote’s own process definition language, which comes in two flavours : XML and a Ruby DSL.
A process definition will describe the flow of work among participants.
A ruote engine can handle simultaneously multiple process instances, created from one or more different process definitions. A process instance can be modified on the fly.
Remember The Milk - Services / API
The Remember The Milk API allows anyone to write applications that interact with Remember The Milk. At this time, the API is available for non-commercial use by outside developers (commercial use requires prior arrangement). The design of the Remember The Milk API was inspired by the Flickr API.
SIP Servlets - SIp vs Jain
JRuby/Rails Integration with Torquebox Telco Framework
-
Mobicents Sip Servlets is compatible with the Torquebox Telco Framework JRuby on Rails integration. The framework allows you to create powerful, pure or converged VoIP JRuby on Rails applications.
JRuby features a powerful and well deployed scripting language that allows you to modify your application at runtime (this is true even for the SIP and Media part that Mobicents Sip Servlets offer) without restarting the server. In addition, TorqueBox is a new kind of Ruby application platform that integrates popular technologies such as Ruby-on-Rails, while extending the footprint of Ruby applications to include support for Job Scheduling, Task Queues, SOAP Handling, and other capabilities.
To obtain more information about building pure JRuby-Rails applications that leverage Mobicents SIP Servlets SIP and mediat capabilities, refer to the Torquebox User Documentation.
Check this blog post to help you create your first pure Torquebox JRuby Telco application and our pure JRuby on Rails TorqueBox Telco example showcasing this integration.
-
Sip Servlets
JAIN SLEE
Application Architecture
Based on HTTP Servlets. Unit of logic is the SIP Servlets
Component based, Object Orientated architecture. Unit of logic is the Service Building Block
Composition through Application Router
Composition through parent-child relationship
Application State
Servlets are stateless
SBBs may be stateful.
Shared state stored in a session and visible to all Servlets with access to the session
SBB state is transacted and a property of the SBB itself. Shared state may be stored in a separate ActivityContext via a type safe interface
Concurrency Control
Application managed : use of Java monitors
System Managed : isolation of concurrent transactions
Facilities (Utilities for Applications)
Timer, Listeners
Timer, Trace, Alarm, Statistics, Profiles.
Protocol Support
SIP and HTTP
Protocol agnostic. Consistent event model, regardless of protocol/resource
Availability Mechanisms
Container managed state (session object) that can be replicated
Container managed state (SBB CMP, Facility, ActivityContext) that can be replicated
No transaction context for SIP message processing
Transaction context for event delivery
Non transacted state operations
Container managed state operations are transacted
Facilities are non transacted
Facilities, timers, are transacted
No defined failure model
Well defined and understood failure model via transactions
Management
No standard management mechanisms defined
JMX Interface for managing applications, life cycle, upgrades, ...
TorqueBox: Home
TorqueBox is a new kind of Ruby application platform that integrates popular technologies such as Ruby-on-Rails, while extending the footprint of Ruby applications to include support for Job Scheduling, Task Queues, SOAP Handling, and Telecom.
TorqueBox provides an all-in-one environment, built upon the latest, most powerful JBoss AS Java application server. Functionality such as clustering and cloud deployment is included right out-of-the-box.
-
TorqueBox is a new kind of Ruby application platform that integrates popular
technologies such as Ruby-on-Rails, while extending the footprint of Ruby applications
to include support for Job Scheduling, Task Queues, SOAP Handling, and Telecom.
TorqueBox provides an all-in-one environment, built upon the latest, most powerful JBoss AS
Java application server. Functionality such as clustering and cloud deployment is included
right out-of-the-box.
Rails: disabling database access for rails app's
Add following line in environment.rb located in /config directory\nview plainprint?\n\n 1. config.frameworks -= [ :active_record ] \n\n \n config.frameworks -= [ :active_record ]\n \n\n\nThis line should come after following line\nview plainprint?\n\n 1. Rails::Initializer.run do |config| \n\n \n Rails::Initializer.run do |config|\n \n\n\n\n2. Comment all the lines starting with ActiveRecord::Base in /config/initializers/new_rails_defaults.rb
-
- config.frameworks -= [ :active_record ]
- Rails::Initializer.run do |config|
Add following line in environment.rb located in /config directory
2. Comment all the lines starting with ActiveRecord::Base in /config/initializers/new_rails_defaults.rb -
- config.frameworks -= [ :active_record ]
- Rails::Initializer.run do |config|
Add following line in environment.rb located in /config directory
2. Comment all the lines starting with ActiveRecord::Base in /config/initializers/new_rails_defaults.rb
Selected Tags
Related Tags
Sponsored Links
Top Contributors
Groups interested in ruby
-
Ruby Stduy
start to study ruby
Items: 18 | Visits: 106
Created by: swan lin
-
ror-project
Items: 1 | Visits: 104
Created by: A. D.
-
Rspec Intro
RSpec is a Behaviour Driven...
Items: 11 | Visits: 234
Created by: Vincent Tsao
Diigo is about better ways to research, share and collaborate on information. Learn more »
Join Diigo
