42
Warbler Nick Sieger [email protected] http://www.flickr.com/photos/19474221@N08/4380605668/

Warbler at RubyConf 2010

Embed Size (px)

Citation preview

Page 2: Warbler at RubyConf 2010

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

new audience

Warbler is all about taking Ruby to new audiences

Page 3: Warbler at RubyConf 2010

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

go places

Going places where it hasn’t been

Page 4: Warbler at RubyConf 2010

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

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

Page 5: Warbler at RubyConf 2010

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

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

Page 6: Warbler at RubyConf 2010

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

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

Page 7: Warbler at RubyConf 2010

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

then Warbler might not be for you.

Page 8: Warbler at RubyConf 2010

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.

Page 9: Warbler at RubyConf 2010

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

write once run anywhere?

Page 10: Warbler at RubyConf 2010

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

Page 11: Warbler at RubyConf 2010

Warbler Uses

Page 12: Warbler at RubyConf 2010

PortableWeb applications

Page 13: Warbler at RubyConf 2010

Ruby GUIs

Page 14: Warbler at RubyConf 2010

Distribution without source code

Page 15: Warbler at RubyConf 2010

No control over deployment

Page 16: Warbler at RubyConf 2010

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.

Page 17: Warbler at RubyConf 2010

http

://w

ww

.flic

kr.c

om/p

hoto

s/m

ario

raff

in/3

6841

4252

/

Windows!

Page 18: Warbler at RubyConf 2010

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

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

Page 19: Warbler at RubyConf 2010

rails_app

controllers

config

db

lib

images

test

vendor

app

helpers

models

views

public

javascripts

stylesheets

Page 20: Warbler at RubyConf 2010

WEB-INF

webapp.war

Page 21: Warbler at RubyConf 2010

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

Page 22: Warbler at RubyConf 2010

INSTALL gem install warbler

Getting Started

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

Page 23: Warbler at RubyConf 2010

$ warblerm -f railsapp.warCreating railsapp.war

Page 24: Warbler at RubyConf 2010

That’s it!

Page 25: Warbler at RubyConf 2010

Gemfile

Page 26: Warbler at RubyConf 2010

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

Page 27: Warbler at RubyConf 2010

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

Page 28: Warbler at RubyConf 2010

# config/warble.rb

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

Page 29: Warbler at RubyConf 2010

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

Page 30: Warbler at RubyConf 2010

Task

Config

Jar

Trai

ts

War

Jar

Bundler

Gemspec

Rails

Rack

Page 31: Warbler at RubyConf 2010

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")

Page 32: Warbler at RubyConf 2010

$ 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

Page 33: Warbler at RubyConf 2010

Featureswarble executable compiled war

Page 34: Warbler at RubyConf 2010

Demos!

Page 35: Warbler at RubyConf 2010

SSID: NickSieger

http://vanguard.local/ringpiano.jar

Page 36: Warbler at RubyConf 2010

Coming Soon

Page 37: Warbler at RubyConf 2010

Unpacking/Caching

Page 38: Warbler at RubyConf 2010

Choose web server:Jetty or Winstone

(or ______ )

Page 39: Warbler at RubyConf 2010

Summer of Code:ruby_archive

Page 40: Warbler at RubyConf 2010

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

Page 41: Warbler at RubyConf 2010

bugs + your feedback

Page 42: Warbler at RubyConf 2010

Warbler 1.3.0beta1 available now

INSTALL gem install warbler --pre