warbler at rubyconf 2010

Post on 20-Aug-2015

1.690 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

WarblerNick Sieger

nsieger@engineyard.com

http

://w

ww

.flic

kr.c

om/p

hoto

s/19

4742

21@N

08/

4380

6056

68/

http://www.flickr.com/photos/emayoh/479260033/

new audience

Warbler is all about taking Ruby to new audiences

http://www.flickr.com/photos/tochis/3431207670/

go places

Going places where it hasn’t been

http://www.flickr.com/photos/ramdac/373881476/

and make it easy for you as well as others to operate the application.

http://www.flickr.com/photos/jpellgen/4376586751/

so if you are the operator and you’re used to having control

http://www.flickr.com/photos/richardholden/1161508160/

and you don’t need to throw a deployable over the wall to someone else

http://www.flickr.com/photos/piratealice/3082374723/

then Warbler might not be for you.

http://www.flickr.com/photos/jamesjordan/2570457478/

Home Sweet JVM

However, if you’re willing to run wherever there’s a JVM, then we can do some interesting things.

http://duke.kenai.com/SunRIP/index.html

write once run anywhere?

http://www.flickr.com/photos/bagalute/5075946007/

write cext compile everywhere!

putting a c compiler on your production box always felt to me likerepaving a road every time you start a new trip

Warbler Uses

PortableWeb applications

Ruby GUIs

Distribution without source code

No control over deployment

Simplify deployment

package once, copy to all the machines where you need to deploy it.no setting up ruby, gemsalso can version easily since JRuby is bundled in the war file.

http

://w

ww

.flic

kr.c

om/p

hoto

s/m

ario

raff

in/3

6841

4252

/

Windows!

http://www.flickr.com/photos/epublicist/3546059144/

Warbler started as a square-peg-round-hole kind of problem.

rails_app

controllers

config

db

lib

images

test

vendor

app

helpers

models

views

public

javascripts

stylesheets

WEB-INF

webapp.war

images

javascripts

stylesheets

WEB-INF

controllers

config

app

helpers

models

views

lib

vendor

rails_app rails_app.war

classes

controllers

config

db

lib

images

test

vendor

app

helpers

models

views

public

javascripts

stylesheets

INSTALL gem install warbler

Getting Started

You don’t even have to have JRuby installed at this point.

$ warblerm -f railsapp.warCreating railsapp.war

That’s it!

Gemfile

Gem::Specification.new do |s| s.name = %q{rake} s.version = "0.8.7"

s.default_executable = %q{rake} s.files = [ ... ] s.require_paths = ["lib"] # s.add_dependency 'lib', ["= VERS"]end

$ warble configcp .../warble.rb config/warble.rb

# config/warble.rb

# Warbler web application assembly configuration fileWarbler::Config.new do |config| # full documentation hereend

Warbler::Task.new("jar1", Warbler::Config.new do |config| config.jar_name = "jar1"end)

Warbler::Task.new("jar2", Warbler::Config.new do |config| config.jar_name = "jar2"end)

require 'warbler'Warbler::Task.new

Task

Config

Jar

Trai

ts

War

Jar

Bundler

Gemspec

Rails

Rack

require 'warbler'jar = Warbler::Jar.newjar.files["directory"] = nil # directory entryjar.files["inline.txt"] = StringIO.new("in memory")jar.files["path/a.txt"] = "a.txt" # disk filejar.create("sample.jar")

$ unzip -l sample.jar Archive: sample.jar Length Date Time Name -------- ---- ---- ---- 0 11-11-10 13:17 directory/ 9 11-11-10 13:17 inline.txt 0 11-11-10 13:17 path/ 0 11-11-10 13:17 path/a.txt -------- ------- 9 4 files

Featureswarble executable compiled war

Demos!

SSID: NickSieger

http://vanguard.local/ringpiano.jar

Coming Soon

Unpacking/Caching

Choose web server:Jetty or Winstone

(or ______ )

Summer of Code:ruby_archive

java -jar railsapp.war-S rake db:migrate

bugs + your feedback

Warbler 1.3.0beta1 available now

INSTALL gem install warbler --pre

top related